Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Eibro on March 04, 2003, 12:41 PM

Title: Re: Join home channel after login.
Post by: Eibro on March 04, 2003, 12:41 PM
QuoteHello ok i'v made a chat bot any everything but now after it logins to Battle.net it gose to "Public chat-1" what can i add to make it join my channel eg. "inheaven"
i want it to join "inheaven" as soon as it logins to bnet
You can't. The most you can hope for is joining a public channel on the chat protocal. Send "/join channelname" after you connect.
Title: Re: Join home channel after login.
Post by: ILurker on March 04, 2003, 01:27 PM
............Just make it so when your logged in, it automatically sends "/join " & homechannel
not too hard
Its impossible to dodge joining public chats on startup
Title: Re: Join home channel after login.
Post by: ILurker on March 04, 2003, 01:27 PM
well not really impossible but probably hard to do
Title: Re: Join home channel after login.
Post by: Spht on March 04, 2003, 01:29 PM
For chat protocol, after you receive 2010 NAME from Battle.net, you could then send "/join <Home_Channel>."

For example, in Visual Basic, SOCKET.SendData "/join Clan [vL]" & vbCrLf. SOCKET being your Winsock control name, and vbCrLf being a substitute for the Enter key in the Telnet interface.
Title: Re: Join home channel after login.
Post by: Grok on March 04, 2003, 01:49 PM
Quote[snip]
'Call Appropriate Event based on ID
    Select Case Val(strArgs(1))
        Case 1001: Event_User strArgs(3), strArgs(4), strArgs(5)
        Case 1002: Event_Join strArgs(3), strArgs(4), strArgs(5)
        Case 1003: Event_Leave strArgs(3), strArgs(4)
        Case 1004: Event_RecvWhisper strArgs(3), strArgs(4), strData2
        Case 1005: Event_Talk strArgs(3), strArgs(4), strData2
    End Select
End Sub
[snip]

ACCCK!  That's not how events are supposed to be written!!

You should declare events from a class module as public, e.g...

---  ClassBot  class code
Public Event OnTalk(Name As String, Flags As String, Chat As String)

Somewhere in the class you fire an event like this:

RaiseEvent OnTalk(name, flags, chat)

Now, to use the class, in your form or wherever, call it like this:

Private WithEvents CBot As ClassBot

..by doing that, and choosing CBot from the ojbect dropdown, you'll see the OnTalk event in the procedure dropdown.  Click it .. You'll see this code:

Private Sub CBot_OnTalk(Name As String, Flags As String, Chat As String)

End Sub

Sorry for the seguey, but intervention was required!
Title: Re: Join home channel after login.
Post by: haZe on March 04, 2003, 02:40 PM
VaporBot, very nice chat bot, sort of outdated though, so your probably not going to go that far with it :-/
Title: Re: Join home channel after login.
Post by: Noodlez on March 04, 2003, 07:51 PM
proper events are just leeter  :P

(i think?)