Valhalla Legends Forums Archive | Battle.net Bot Development | Commands

AuthorMessageTime
Lordrune
Yo i need help on how to Start command for my bot
June 13, 2005, 8:30 PM
Myndfyr
Congratulations!  You've just been awarded the "Most Vague Post of the Year" award!

[edit]warz: To clarify, at least my post *hinted* at what the guy needed to do to get help.[/edit]
June 13, 2005, 10:06 PM
Quarantine
What language are you programming in?
What kind of help do you need?
Do you have any code that you need help with in specific?
June 13, 2005, 11:15 PM
CrAz3D
VB
helpful help
I haven't written it yet


(I figure those are the answers)
June 14, 2005, 1:21 AM
shout
[img]http://cold-chaos.net/stealth/google.gif[/img]

What I think is going on is he wants a one-line segment of code that magically connects to battle.net.

By the way, who says 'yo' anymore?
June 14, 2005, 3:09 AM
HdxBmx27
[quote author=Shout link=topic=11819.msg115670#msg115670 date=1118718580]
What I think is going on is he wants a one-line segment of code that magically connects to battle.net.
[/quote]
[code]ws.Connect "USEast.battle.net", 6112
ws.Send Chr(&H3) & chr(&H4) & "anonymous" & vbcrlf & vbcrlf[/code]
Wow... 2 lines?
~-~(HDX)~-~
June 14, 2005, 3:12 AM
HdxBmx27
That dosent work, RTE: 400067, or w/e
Also thats 2 lines, : is a line delemanator.
Also the 2nd line needs ot be in the Connect sub, so tecnically, it's 6 lines of code.
~-~(HDX)~-~
June 14, 2005, 3:21 AM
Myndfyr
[quote author=HdxBmx27 link=topic=11819.msg115675#msg115675 date=1118719306]
That dosent work, RTE: 400067, or w/e
Also thats 2 lines, : is a line delemanator.
Also the 2nd line needs ot be in the Connect sub, so tecnically, it's 6 lines of code.
~-~(HDX)~-~
[/quote]

It's actually a statement delimiter, so it's still just 1 line.
June 14, 2005, 3:34 AM
CrAz3D
Command isn't connection.  He is asking how to write a command.
June 14, 2005, 4:26 PM
shout
Oh, I misread. I read it as "i need a start command for my bot".
June 14, 2005, 4:59 PM
Myndfyr
I think that the original post is ambiguous and indecipherable enough to be either one.
June 14, 2005, 5:01 PM
Lordrune
Yuh i meant write a command
June 14, 2005, 6:25 PM
shout
That is still pretty vague.

Here is a psudocode example of accepting a command from a user on battle.net:
[code]
string command = p0x0E.text
string user = p0x0E.name

if (name == users[any])
if (userspriv[usernum] >= getcmdreq(command))
sendchat(getcmd(command))
[/code]
June 14, 2005, 6:32 PM
HdxBmx27
0x0F not 0x0E
Also Lordrune, You hgave to tell us what you want the dang cvommand to do. If your jsut thinking generics... upon reciving 0x0F with a event ID of either Whisper or emote. Casll a sub that check s if the text from 0x0F is a command (.say, .quit, .imagayfag, .blablabla). If so make the bot do the desirted effect of the command.
~-~(HDX)~-~
June 14, 2005, 6:59 PM
Quarantine
...what? 0x0E is SID_CHATEVENT ..?

I really have no idea what you just said Hdx..
June 15, 2005, 12:39 AM
HdxBmx27
[quote] [C>0x0E]    SID_CHATCOMMAND
[S>0x0F] SID_CHATEVENT[/quote]
0x0E is C->S only, 0x0F is S->C only.

As for what I said this might be better:
[code]Public Sub OMGOMGOMGPARSE0x0F(strData as string)
  Dim ID as long, UN as string, MSG as string
  ID = GetDWORD(Mid(strData, 5, 4))
  strData = Mid(strData, 25)
  UN = Left(strdata, Instr(StrData, Chr(&H0)) - 1)
  StrData = Mid(StrData, Len(UN) + 2)
  MSG = Left(strdata, Instr(StrData, Chr(&H0)) - 1)
 
  If ID = &H5 or ID = &H4 then
          Call OMGHandelCommands(UN, MSG)
  End If
End Sub

Public Sub OMGHandelCommands(UN as string, MSG as string)
    If Left(MSG, 5) = ".say " then AddQ UN & "says: " & Mid(MSG, 6)
End Sub[/code]

:/
Anyways... Like I said, when you recive a whisper of chat text. Call a seprate sub to handleel the diffrent commands.
~-~(HDX)~-~

June 15, 2005, 12:53 AM
Myndfyr
[quote author=HdxBmx27 link=topic=11819.msg115799#msg115799 date=1118796782]
[code]Public Sub OMGOMGOMGPARSE0x0F(strData as string)[/code]
[/quote]

WTF?
June 15, 2005, 12:54 AM
HdxBmx27
Some random sub to Parse incoming 0x0F.

Sorta like mine:
[code]Public Sub Handle0x0F(Index As Integer, EID As Long, Flags As String, Ping As Long, Void As String, _
                    Name As String, Message As String)
    Select Case EID
        Case ID_TALK: Call OnTalk(Index, Name, Flags, Message, Ping)
        Case ID_EMOTE: Call OnEmote(Index, Name, Flags, Message)
        Case ID_CHAN: Call OnChannel(Index, Message)
        Case ID_USER: Call OnUser(Index, Name, Flags, Message, Ping)
        Case ID_JOIN: Call OnJoin(Index, Name, Flags, Message, Ping)
        Case ID_LEAVE: Call OnLeave(Index, Name, Flags)
        Case ID_WHISPTO: Call OnWhisperTo(Index, Name, Flags, Message, Ping)
        Case ID_WHISPFROM: Call OnWhisperFrom(Index, Name, Flags, Message)
        Case ID_INFO: Call OnInfo(Index, Message)
        Case ID_FLAGS: Call OnFlags(Index, Name, Flags, Message, Ping)
        Case ID_BROADCAST: Call OnInfo(Index, Message)
        Case ID_ERROR: Call OnError(Index, Message)
        Case Else: Call OnUnknown(Index, Message)
    End Select
End Sub[/code]
...
~-~(HDX)~-~
June 15, 2005, 1:00 AM
Quarantine
Haha, totally misread what you said. Must be having an off day.
June 15, 2005, 1:29 AM
Lordrune
[quote author=HdxBmx27 link=topic=11819.msg115671#msg115671 date=1118718757]
[quote author=Shout link=topic=11819.msg115670#msg115670 date=1118718580]
What I think is going on is he wants a one-line segment of code that magically connects to battle.net.
[/quote]
[code]ws.Connect "USEast.battle.net", 6112
ws.Send Chr(&H3) & chr(&H4) & "anonymous" & vbcrlf & vbcrlf[/code]
Wow... 2 lines?
~-~(HDX)~-~
[/quote]
My bot already connnects to bnet..
Im trying to add commands to it
June 15, 2005, 2:11 AM
HdxBmx27
*pokes the last few posts of his*
It's not hard, the hard part is figure out what commands to add. :/
~~(HDX)~-~
June 15, 2005, 2:16 AM
Kp
Lordrune is either a troll or supremely inept at communicating his intent.  Assuming you all haven't been feeding a troll for the past couple of days:

Lordrune: specify precisely what you want, or you're not going to get any help.
June 15, 2005, 2:38 AM
R.a.B.B.i.T
[quote author=Lordrune link=topic=11819.msg115813#msg115813 date=1118801475]
[quote author=HdxBmx27 link=topic=11819.msg115671#msg115671 date=1118718757]
[quote author=Shout link=topic=11819.msg115670#msg115670 date=1118718580]
What I think is going on is he wants a one-line segment of code that magically connects to battle.net.
[/quote]
[code]ws.Connect "USEast.battle.net", 6112
ws.Send Chr(&H3) & chr(&H4) & "anonymous" & vbcrlf & vbcrlf[/code]
Wow... 2 lines?
~-~(HDX)~-~
[/quote]
My bot already connnects to bnet..
Im trying to add commands to it
[/quote]It connects but you can't write a simple command parser?  Tsk.  Tsk.  Sounds like someone isn't doing all the work they say they are...
June 15, 2005, 2:38 AM
Lordrune
Iight wuts wrong wit this code cause i keep gettin an error

Public Function StartCommands(Username As String, message As String)
Dim Stuff() As String
Stuff = Split(message, " ")
Command = Stuff(0)
Select Case LCase(Command)
Case ".say"
frmMain.wsBNET.SendData Stuff(2)
End Select
End Function

the error is Command = Stuff(0)
June 15, 2005, 2:48 AM
Myndfyr
If there is no message, and therefore no item at index 0 of your array, you'll generate an Index-out-of-Bounds error.

In the future, post the error message you receive and the conditions in which it is received.
June 15, 2005, 2:52 AM
Lordrune
ok..
June 15, 2005, 3:15 AM
Lordrune
well uh lets see here still doin the same shyt
June 15, 2005, 3:16 AM
HdxBmx27
[code]
Stuff = Split(message & Space(&H1337), " ")[/code]
Should fix your peoblem.

If your next post dosent have more info, I willpersonally do anything to get a mod to trash this.

What we need: (so it's perfectly clear)
The contents of Each vareable, at EVERY stage. And a properly formatted snippit of code incased in the [ code] tags.
~-~(HDX)~-~
June 15, 2005, 4:04 AM
KkBlazekK
He also didn't declare "Command".
June 15, 2005, 4:32 AM
Myndfyr
We also need an exact error message, conditions for reproducing the error, and when it occurs (compile-time or run-time).
June 15, 2005, 4:42 AM
Explicit[nK]
[quote author=Lordrune link=topic=11819.msg115822#msg115822 date=1118803688]
Iight wuts wrong wit this code cause i keep gettin an error

Public Function StartCommands(Username As String, message As String)
Dim Stuff() As String
Stuff = Split(message, " ")
Command = Stuff(0)
Select Case LCase(Command)
Case ".say"
frmMain.wsBNET.SendData Stuff(2)
End Select
End Function

the error is Command = Stuff(0)
[/quote]

Use the <code> </code> tags.
June 20, 2005, 1:32 AM
KkBlazekK
[ ]**
June 20, 2005, 1:36 AM

Search