Valhalla Legends Forums Archive | Battle.net Bot Development | How can i add bot commands.

AuthorMessageTime
OuTLawZGoSu
Sup... ( Sorry for taking up so much space on the forum) I need some help wit bot commands. i cant get the righ tcode.
this is what i have.

__________________________________________________
[CODE]
Public Sub DispatchMessage(ByVal databuf As String)
Dim EID As Long, Ping As Long, username As String, message As String, Client As String, STATS As Long
EID = MakeLong(Mid$(databuf, 5, 4))
flags = MakeLong(Mid$(databuf, 9, 4))
Ping = MakeLong(Mid$(databuf, 13, 4))
username = KillNull(Mid$(databuf, 29))
message = KillNull(Mid$(databuf, Len(username) + 30))

If EID = lasteid And flags = lastflags And Ping = lastping And username = lastusername And message = lastmessage Then Exit Sub
lasteid = MakeLong(Mid$(databuf, 5, 4))
lastflags = MakeLong(Mid$(databuf, 9, 4))
lastping = MakeLong(Mid$(databuf, 13, 4))
lastusername = KillNull(Mid$(databuf, 29))
lastmessage = KillNull(Mid$(databuf, Len(username) + 30))

Select Case EID

Case ID_USER
message = Left(message, 4)
Form1.List1.AddItem username & " [" & Ping & "] - " & message
If flags = 2 Then
AddC RGB(179, 179, 179), username & " has aquired ops"
Form1.List1.RemoveItem SendMessage(Form1.List1.hwnd, LB_FINDSTRING, 0, username & " [" & Ping & "] - " & message)
Form1.List1.AddItem username & " [" & Ping & "] - " & message, 0
End If
If flags = 18 Then
AddC RGB(179, 179, 179), username & " has aquired ops"
Form1.List1.RemoveItem SendMessage(Form1.List1.hwnd, LB_FINDSTRING, 0, username & " [" & Ping & "] - " & message)
Form1.List1.AddItem username & " [" & Ping & "] - " & message, 0
End If


Case ID_INFO


Case ID_WHISPFROM
AddC vbYellow, "<From: " & username & "> ", RGB(179, 179, 179), message

Case ID_FLAGS


Case ID_WHISPTO
AddC vbYellow, "<To: " & username & "> ", RGB(179, 179, 179), message

Case ID_ERROR


Case ID_BROADCAST


Case ID_TALK
AddC vbYellow, "<" & username & "> ", vbWhite, message
If Form1.rtb = "OuTLawZ" And LCase(Messege) = "test" Then
Send "Look He said test!"
End If

Case ID_EMOTE
AddC vbYellow, "<" & username & " " & message & ">"

Case ID_CHAN
Form1.List1.Clear
AddC vbGreen, "Joined Channel: " & message

Case ID_JOIN
AddC vbRed, username, vbGreen, " has joined the channel"
Form1.List1.AddItem username & " [" & Ping & "] - " & message, 0


Case ID_LEAVE
AddC vbBlue, username, vbGreen, " has left the channel"
Form1.List1.RemoveItem SendMessage(Form1.List1.hwnd, LB_FINDSTRING, 0, username & " [" & Ping & "] - " & message)

End Select
Exit Sub

End Sub

[/CODE]
__________________________________________________


Where it sais:
Case ID_TALK
AddC vbYellow, "<" & username & "> ", vbWhite, message
If Form1.rtb = "OuTLawZ" And LCase(Messege) = "test" Then
Send "Look He said test!"
End If

I was told that is the command. the box wher eyou see teh ppl chatting in the channel is called RTB and where you type what you wanna say is named Text1
I cant get this code to work. This was posted on another forum i tryed. they didnt realy help me out at all.

Help ?

L8terZ

June 27, 2003, 2:10 AM
UserLoser
You should learn VisualBasic before attempting to do such things as a binary bot.
June 27, 2003, 3:23 AM
MiCrOz
You have if the RTB = "yourname"

The RTB will not have your username, it will have username, message, and anything else your having displayed in it. My sugjestion is,

If Username = "yourname" AND LCase(Message) = "test" Then
Send "Look! he said test!"
EndIf

If this doesnt work, please tell whats not working and I'll try and help.


P.S. UserLoser: if your not gonna help him with his question, then dont post. Many people (well, me at least) started out trying to make bots as a way to help learn VB, through looking at tutorials, guides, and yes asking for help.
June 27, 2003, 3:50 AM
OuTLawZGoSu
YES!! FINALY TI WORKS! Thx alot MiCrOz.


L8terZ
June 27, 2003, 12:55 PM

Search