Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] Messages in different Colours


Ryujin
 Share

Recommended Posts

This is my second Tutorial.

I tell you, how to can send messages in different colours.

Before we beginn, we need following things:
1x ComboBox (cbColours)

First, click on the ComboBox (cbColours) and search in the properties for **List**
Enter the following into the list:
```
Black
Blue
Green
Cyan
Red
Magenta
Brown
Grey
DarkGrey
BrightBlue
BrightGreen
BrightCyan
BrightRed
Pink
Yellow
White
```
**THEN CHANGE IN THE PROPERTIES AT "STYLE" 0 TO 2**

Second, search for **Private Sub Form_Load()**.
Below **Call UsersOnline_Start** add **cbColours.Text = "White"**

Thirdly, search for **Private Sub txtChat_KeyPress(KeyAscii As Integer)**

Change this:
```
Private Sub txtChat_KeyPress(KeyAscii As Integer)

    If KeyAscii = vbKeyReturn Then
        If LenB(Trim$(txtChat.Text)) > 0 Then
            Call GlobalMsg(txtChat.Text, White)
            Call TextAdd("Server: " & txtChat.Text)
            txtChat.Text = vbNullString
        End If

        KeyAscii = 0
    End If

End Sub
```
WITH THIS (THX to [7](http://www.touchofdeathforums.com/smf/index.php?action=profile;u=22287)):
```
Private Sub txtChat_KeyPress(KeyAscii As Integer)

If KeyAscii = vbKeyReturn Then
        If LenB(Trim$(txtChat.Text)) > 0 Then
            Select Case cbColours.Text
                Case "Black"
                    Call GlobalMsg("Server: " & txtChat.Text, Black)
                Case "Blue"
                    Call GlobalMsg("Server: " & txtChat.Text, Blue)
                Case "Green"
                    Call GlobalMsg("Server: " & txtChat.Text, Green)
                Case "Cyan"
                    Call GlobalMsg("Server: " & txtChat.Text, Cyan)
                Case "Red"
                    Call GlobalMsg("Server: " & txtChat.Text, Red)
                Case "Magenta"
                    Call GlobalMsg("Server: " & txtChat.Text, Magenta)
                Case "Brown"
                    Call GlobalMsg("Server: " & txtChat.Text, Brown)
                Case "Grey"
                    Call GlobalMsg("Server: " & txtChat.Text, Grey)
                Case "DarkGrey"
                    Call GlobalMsg("Server: " & txtChat.Text, DarkGrey)
                Case "BrightBlue"
                    Call GlobalMsg("Server: " & txtChat.Text, BrightBlue)
                Case "BrightGreen"
                    Call GlobalMsg("Server: " & txtChat.Text, BrightGreen)
                Case "BrightCyan"
                    Call GlobalMsg("Server: " & txtChat.Text, BrightCyan)
                Case "BrightRed"
                    Call GlobalMsg("Server: " & txtChat.Text, BrightRed)
                Case "Pink"
                    Call GlobalMsg("Server: " & txtChat.Text, Pink)
                Case "Yellow"
                    Call GlobalMsg("Server: " & txtChat.Text, Yellow)
                Case "White"
                    Call GlobalMsg("Server: " & txtChat.Text, White)
                Case Else
                    Call GlobalMsg("Server: " & txtChat.Text, Black)
                End Select

            Call TextAdd("Server: " & txtChat.Text)
            txtChat.Text = vbNullString
        End If

        KeyAscii = 0
    End If

End Sub
```
Done!

**At the end it looks like this:**
![](http://www.freemmorpgmaker.com/files/imagehost/pics/27388679143c496c6898ff7553ad7ae2.JPG)

**Big THX to the DEVELOPERS OF ES SERVER EDIT!**

**EDITED: Now is done!**
Link to comment
Share on other sites

@Ryoku:

> Nice edit, but not very useful. ^_^

Truthfully I think it is useful, you could have different types of annoucements in different colours, for example you could announce countdowns to events in blue and advertise new maps in green, etc, etc :)
Link to comment
Share on other sites

Thanks for this, was needing something like this.

Well, just to share, for organisations sake;

```
If KeyAscii = vbKeyReturn Then
        If LenB(Trim$(txtChat.Text)) > 0 Then
            Select Case cbColours.Text
                Case "Black"
                    Call GlobalMsg("Server: " & txtChat.Text, Black)
                Case "Blue"
                    Call GlobalMsg("Server: " & txtChat.Text, Blue)
                Case "Green"
                    Call GlobalMsg("Server: " & txtChat.Text, Green)
                Case "Cyan"
                    Call GlobalMsg("Server: " & txtChat.Text, Cyan)
                Case "Red"
                    Call GlobalMsg("Server: " & txtChat.Text, Red)
                Case "Magenta"
                    Call GlobalMsg("Server: " & txtChat.Text, Magenta)
                Case "Brown"
                    Call GlobalMsg("Server: " & txtChat.Text, Brown)
                Case "Grey"
                    Call GlobalMsg("Server: " & txtChat.Text, Grey)
                Case "DarkGrey"
                    Call GlobalMsg("Server: " & txtChat.Text, DarkGrey)
                Case "BrightBlue"
                    Call GlobalMsg("Server: " & txtChat.Text, BrightBlue)
                Case "BrightGreen"
                    Call GlobalMsg("Server: " & txtChat.Text, BrightGreen)
                Case "BrightCyan"
                    Call GlobalMsg("Server: " & txtChat.Text, BrightCyan)
                Case "BrightRed"
                    Call GlobalMsg("Server: " & txtChat.Text, BrightRed)
                Case "Pink"
                    Call GlobalMsg("Server: " & txtChat.Text, Pink)
                Case "Yellow"
                    Call GlobalMsg("Server: " & txtChat.Text, Yellow)
                Case "White"
                    Call GlobalMsg("Server: " & txtChat.Text, White)
                Case Else
                    Call GlobalMsg("Server: " & txtChat.Text, Black)
                End Select

            Call TextAdd("Server: " & txtChat.Text)
            txtChat.Text = vbNullString
        End If

        KeyAscii = 0
    End If
```
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...