Yo i need help on how to Start command for my bot
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]
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?
VB
helpful help
I haven't written it yet
(I figure those are the answers)
(http://cold-chaos.net/stealth/google.gif)
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?
Quote from: Shout on June 13, 2005, 10:09 PM
What I think is going on is he wants a one-line segment of code that magically connects to battle.net.
ws.Connect "USEast.battle.net", 6112
ws.Send Chr(&H3) & chr(&H4) & "anonymous" & vbcrlf & vbcrlf
Wow... 2 lines?
~-~(HDX)~-~
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 from: HdxBmx27 on June 13, 2005, 10:21 PM
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)~-~
It's actually a
statement delimiter, so it's still just 1 line.
Command isn't connection. He is asking how to write a command.
Oh, I misread. I read it as "i need a start command for my bot".
I think that the original post is ambiguous and indecipherable enough to be either one.
Yuh i meant write a command
That is still pretty vague.
Here is a psudocode example of accepting a command from a user on battle.net:
string command = p0x0E.text
string user = p0x0E.name
if (name == users[any])
if (userspriv[usernum] >= getcmdreq(command))
sendchat(getcmd(command))
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)~-~
...what? 0x0E is SID_CHATEVENT ..?
I really have no idea what you just said Hdx..
Quote[C>0x0E] SID_CHATCOMMAND
[S>0x0F] SID_CHATEVENT
0x0E is C->S only, 0x0F is S->C only.
As for what I said this might be better:
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
:/
Anyways... Like I said, when you recive a whisper of chat text. Call a seprate sub to handleel the diffrent commands.
~-~(HDX)~-~
Quote from: HdxBmx27 on June 14, 2005, 07:53 PM
Public Sub OMGOMGOMGPARSE0x0F(strData as string)
WTF?
Some random sub to Parse incoming 0x0F.
Sorta like mine:
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
...
~-~(HDX)~-~
Haha, totally misread what you said. Must be having an off day.
Quote from: HdxBmx27 on June 13, 2005, 10:12 PM
Quote from: Shout on June 13, 2005, 10:09 PM
What I think is going on is he wants a one-line segment of code that magically connects to battle.net.
ws.Connect "USEast.battle.net", 6112
ws.Send Chr(&H3) & chr(&H4) & "anonymous" & vbcrlf & vbcrlf
Wow... 2 lines?
~-~(HDX)~-~
My bot already connnects to bnet..
Im trying to add commands to it
*pokes the last few posts of his*
It's not hard, the hard part is figure out what commands to add. :/
~~(HDX)~-~
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.
Quote from: Lordrune on June 14, 2005, 09:11 PM
Quote from: HdxBmx27 on June 13, 2005, 10:12 PM
Quote from: Shout on June 13, 2005, 10:09 PM
What I think is going on is he wants a one-line segment of code that magically connects to battle.net.
ws.Connect "USEast.battle.net", 6112
ws.Send Chr(&H3) & chr(&H4) & "anonymous" & vbcrlf & vbcrlf
Wow... 2 lines?
~-~(HDX)~-~
My bot already connnects to bnet..
Im trying to add commands to it
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...
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)
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.
ok..
well uh lets see here still doin the same shyt
Stuff = Split(message & Space(&H1337), " ")
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)~-~
He also didn't declare "Command".
We also need an exact error message, conditions for reproducing the error, and when it occurs (compile-time or run-time).
Quote from: Lordrune on June 14, 2005, 09:48 PM
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)
Use the <code> </code> tags.
[ ]**