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

How to broadcast using /b instead of 'message here


Warconn
 Share

Recommended Posts

Alright guys, i got real angry with eclipse the other day because i had to keep typing /help to see the different options such as 'is broadcast, and - is emote. I realized that first time players might be angry aswell, so i decided to  change it to something easier to remember such as /b, /e, and /w. I will show you how to do that, and to change them to which ever you would like.

Ok we start of Client SIde in ModGameLogic

find

```
Sub HandleKeypresses(ByVal KeyAscii As Integer)

```
and scroll down till you see

' Broadcast message

select all of the following text
```
        If Mid$(MyText, 1, 1) = "'" Then
            ChatText = Mid$(MyText, 2, Len(MyText) - 1)
            If Len(Trim$(ChatText)) > 0 Then
                Call BroadcastMsg(ChatText)
            End If
            MyText = vbNullString
            Exit Sub
        End If

```
replace it with this
```
If LCase$(Mid$(MyText, 1, 3)) = "/b " Then
            ChatText = LCase$(Mid$(MyText, 4, Len(MyText) - 3))
            If Len(Trim$(ChatText)) > 0 Then
                Call BroadcastMsg(ChatText)
            End If
            MyText = vbNullString
            Exit Sub
        End If
```
next you want to find

```
' Emote message
        If Mid$(MyText, 1, 1) = "-" Then
            ChatText = Mid$(MyText, 2, Len(MyText) - 1)
            If Len(Trim$(ChatText)) > 0 Then
                Call EmoteMsg(ChatText)
            End If
            MyText = vbNullString
            Exit Sub
        End If

```
and replace it with

```
' Emote message
        If LCase$(Mid$(MyText, 1, 3)) = "/e " Then
            ChatText = LCase$(Mid$(MyText, 4, Len(MyText) - 3))
            If Len(Trim$(ChatText)) > 0 Then
                Call EmoteMsg(ChatText)
            End If
            MyText = vbNullString
            Exit Sub
        End If
```
and lastly the whisper command

```
' Player message
        If Mid$(MyText, 1, 1) = "!" Then
            ChatText = Mid$(MyText, 2, Len(MyText) - 1)
            Name = vbNullString

            ' Get the desired player from the user text
            For i = 1 To Len(ChatText)
                If Mid$(ChatText, i, 1) <> " " Then
                    Name = Name & Mid$(ChatText, i, 1)
                Else
                    Exit For
                End If
            Next i

            ' Make sure they are actually sending something
            If Len(ChatText) - i > 0 Then
                ChatText = Mid$(ChatText, i + 1, Len(ChatText) - i)

                ' Send the message to the player
                Call PlayerMsg(ChatText, Name)
            Else
                Call AddText("Usage: !playername msghere", AlertColor)
            End If
            MyText = vbNullString
            Exit Sub
        End If

```
change that with

```
    ' Player message
            If LCase$(Mid$(MyText, 1, 3)) = "/w " Then
            ChatText = LCase$(Mid$(MyText, 4, Len(MyText) - 3))
            Name = vbNullString

            ' Get the desired player from the user text
            For i = 1 To Len(ChatText)
                If LCase$(Mid$(ChatText, i, 1)) <> " " Then
                    Name = Name & Mid$(ChatText, i, 1)
                Else
                    Exit For
                End If
            Next i
                'Warconn message change

            ' Make sure they are actually sending something
            If Len(ChatText) - i > 0 Then
                ChatText = LCase$(Mid$(ChatText, i + 1, Len(ChatText) - i))

                ' Send the message to the player
                Call PlayerMsg(ChatText, Name)
            Else
                Call AddText("Usage: /w playername msghere", AlertColor)
            End If
            MyText = vbNullString
            Exit Sub
        End If

```

that is how to change all of the commands

what everything means

If LCase$(Mid$(MyText, 1, 3)) = "/b " Then
            ChatText = LCase$(Mid$(MyText, 4, Len(MyText) - 3))
            If Len(Trim$(ChatText)) > 0 Then
                Call BroadcastMsg(ChatText)
            End If
            MyText = vbNullString
            Exit Sub
        End If
this is how many characters are in between the quotes including spaces, exmp: if it was "/broadcast " the number would be 11

This is always one more then the red number

and that is all you need to change to change the  broadcast/emote/whisper commands

this is one of the many snippets added to New Colony Online, check it out from the link in my sig.

Thanks
Warconn
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...