• Welcome to Valhalla Legends Archive.
 

Add "join home" in VB Code

Started by Christ, June 04, 2003, 01:20 AM

Previous topic - Next topic

Christ

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

Tuberload

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
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

Analog-X

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.

Skywing

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.

Tuberload

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?"
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown

Analog-X

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?

Kp

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