• Welcome to Valhalla Legends Archive.
 

Commands

Started by Lordrune, June 13, 2005, 03:30 PM

Previous topic - Next topic

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)~-~


Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

MyndFyre

#16
Quote from: HdxBmx27 on June 14, 2005, 07:53 PM
Public Sub OMGOMGOMGPARSE0x0F(strData as string)

WTF?
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Hdx

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)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Warrior

Haha, totally misread what you said. Must be having an off day.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

Lordrune

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

Hdx

*pokes the last few posts of his*
It's not hard, the hard part is figure out what commands to add. :/
~~(HDX)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

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.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

R.a.B.B.i.T

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

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)

MyndFyre

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.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Lordrune


Lordrune

well uh lets see here still doin the same shyt

Hdx


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)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Blaze

He also didn't declare "Command".
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

MyndFyre

We also need an exact error message, conditions for reproducing the error, and when it occurs (compile-time or run-time).
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

|