Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Christ on June 04, 2003, 01:20 AM

Title: Add "join home" in VB Code
Post by: Christ on June 04, 2003, 01:20 AM
Sup, i'm working on a chatbot plan, nothing fancy, i got everything setup BUT the home channel, how would i go about setting the home channel, in this..here's a sample of the code.

Private Sub Form_Load()
   Shell "C:\windows\explorer.exe " & App.Path
   Dim s As String     'S is a junk variable, it's used over and over
   s = ReadINI("Setup", "Username", "config.ini") 'Read the INI file for the desired info
   If s <> "" Then gUsername = s Else GoTo LoadError 'If the config is blank then msgbox the error
   s = ReadINI("Setup", "Password", "config.ini")
   If s <> "" Then gPassword = s Else GoTo LoadError
   s = ReadINI("Setup", "Server", "config.ini")
   If s <> "" Then gServer = s Else GoTo LoadError
   
Would i just copy that and just replace with home AND how would it be told to join home..any help guys :)
Title: Re:Add "join home" in VB Code
Post by: Tuberload on June 04, 2003, 01:33 PM
Just load the home channel into a variable just like you do with all the other settings.  Then, this is an example using the chat gateway, when you recieve the packet informing you of the channel you are in compare it to your home channel and if they are different send "/join " + home_channel
Title: Re:Add "join home" in VB Code
Post by: Analog-X on June 04, 2003, 02:38 PM
Quote
Then, this is an example using the chat gateway, when you recieve the packet informing you of the channel you are in compare it to your home channel and if they are different send "/join " + home_channel

why compare? If you send /join and the channel is the same as the channel you are in you will get no response.
Title: Re:Add "join home" in VB Code
Post by: Skywing on June 04, 2003, 05:41 PM
Quote from: Analog-X on June 04, 2003, 02:38 PM
Quote
Then, this is an example using the chat gateway, when you recieve the packet informing you of the channel you are in compare it to your home channel and if they are different send "/join " + home_channel

why compare? If you send /join and the channel is the same as the channel you are in you will get no response.
It's somewhat of an optimizion to save the queue from getting as cluttered with things you don't really need to send.
Title: Re:Add "join home" in VB Code
Post by: Tuberload on June 04, 2003, 06:55 PM
Quote from: Analog-X on June 04, 2003, 02:38 PM
Quote
Then, this is an example using the chat gateway, when you recieve the packet informing you of the channel you are in compare it to your home channel and if they are different send "/join " + home_channel

why compare? If you send /join and the channel is the same as the channel you are in you will get no response.

Like Skywing stated it is an optimization.  There are many like it that you could take into consideration if you are a bot developer. Ask yourself the question, "Why do something if it isn't needed?"
Title: Re:Add "join home" in VB Code
Post by: Analog-X on June 05, 2003, 01:00 PM
if you did
pbuffer.InsertDWORD &H2
pbuffer.InsertNTString Channel
pbuffer.sendPacket &HC


Then would the server still take this as a message or could you do it as much and as fast as you want without fear of flooding off?
Title: Analog: as far as I know
Post by: Kp on June 05, 2003, 01:58 PM
Quote from: Analog-X on June 05, 2003, 01:00 PM
if you did
pbuffer.InsertDWORD &H2
pbuffer.InsertNTString Channel
pbuffer.sendPacket &HC


Then would the server still take this as a message or could you do it as much and as fast as you want without fear of flooding off?
I don't believe bnbinary is counted toward your flood-off limit.  However, you ought to test to be sure.