Valhalla Legends Forums Archive | Battle.net Bot Development | I'm asking for the code of a simple chat bot ...

AuthorMessageTime
GPX
Hi :D
First of all, I would like to say that i'm really impressed of u guys, dealing with bots sure looks like fun , and I would like to get into it myself.
Now, my knowledge of sockets in C++ is quite basic, and I've never dealt (deal in the past ^^) with sockets using php ...
and yet, i would like to get the source code of a very simple chat bot, that connects to b.net with a user and a pass , enters a channel and write the following msg in the channel: "Hello MISTERRRRRRRRRRRRRRRRRRRRRS" :)
I would like to get that code in c++, and php, ofcourse any help would be greatly apriciated :>
thanks ahead, Yoni from Israel.
November 25, 2003, 8:15 PM
Crypticflare
http://www.pscode.com
November 25, 2003, 8:25 PM
St0rm.iD
Google for greetbot. That's exactly what you want.
November 25, 2003, 8:31 PM
ObsidianWolf
uhm ok, like Binary Bot Simple or Chat Bot Simple?

November 25, 2003, 8:35 PM
iago
Sounds like Chat Bot Simple.

I assume you want C++, but I'm not sure what GreetBot is in. I think GreetBot is VB, isn't it?

If you want java, http://www.valhallalegends.com/iago/JavaBot-gui.rar

I don't know of any opensource in C++, though..
November 25, 2003, 9:18 PM
ObsidianWolf
heres an idea of what to do

Connect to bnet,
send ascii 003
send ascii 004
send username
send carriage return
send password
send carriage return

that should get you connected.

Also want to have something to handle incoming data, once again absolutly clueless as how to do this in c++.



in vb would be like this
[code]
Private Sub Socket_Connect()
Socket.SendData chr(3) & chr(4) & username & vbcrlf & password & vbcrlf
End Sub

Private Sub Socket_DataArrival(ByVal bytesTotal As Long)

Dim StrData as String
Socket.Getdata strData, vbstring, bytestotal
text1.text=text1.text & vbcrlf & strdata
End Sub


[/code]

Thats untested, but i think it should work in vb, been a long time though.


November 25, 2003, 9:45 PM
iago
I'm pretty sure he wants to know how to use a socket in C++, actually. I actually wrote a class some time ago, it's on the general programming forum. You could probably search for "Socket" posted by "iago" and find it.
November 25, 2003, 9:48 PM
Kp
[quote author=iago link=board=17;threadid=3842;start=0#msg31394 date=1069795128]
I assume you want C++, but I'm not sure what GreetBot is in. I think GreetBot is VB, isn't it?[/quote]

Not originally. The original greetbot from Blizzard was written in C++.
November 25, 2003, 11:02 PM
Skywing
Several months ago, I put a mirror of GreetBot up on my site due to Blizzard removing it from their FTP.
November 25, 2003, 11:16 PM
GPX
[quote author=Skywing link=board=17;threadid=3842;start=0#msg31432 date=1069802216]
Several months ago, I put a mirror of GreetBot up on my site due to Blizzard removing it from their FTP.
[/quote]
Thanks ! that's actually extactly what I wanted, but why doesn't it work ? :(
I've changed the login info :
TheBot.SetLogonInfo("Guest", "Guest", "battle.net");
to
MajotBoing(my user in wc3 tft europe), my password for majorboing, and europe.battle.net.
then i compile it (using vc++6) and nothing happens O.O just a black screen, why is that ? =o
thx :>
November 26, 2003, 6:45 AM
iago
You can't log onto warcraft 3 namespace in CHAT, only original namespace (@useast, @uswest, etc.)
November 26, 2003, 7:01 AM
GPX
excuse me ? =o
I'm not very good with english i guess, i didn't understand u....
can u plz tell me what to write in the parameters of this func :
TheBot.SetLogonInfo("Guest", "Guest", "battle.net");

Thanks :-*
November 26, 2003, 8:17 AM
Crypticflare
TheBot.SetLogonInfo("username", "password", "useast.battle.net");

You can change useast.battle.net to any server you play on..

useast.battle.net
uswest.battle.net
europe.battle.net
asia.battle.net
November 26, 2003, 10:35 AM
Skywing
[quote author=GPX link=board=17;threadid=3842;start=0#msg31596 date=1069829142]
[quote author=Skywing link=board=17;threadid=3842;start=0#msg31432 date=1069802216]
Several months ago, I put a mirror of GreetBot up on my site due to Blizzard removing it from their FTP.
[/quote]
Thanks ! that's actually extactly what I wanted, but why doesn't it work ? :(
I've changed the login info :
TheBot.SetLogonInfo("Guest", "Guest", "battle.net");
to
MajotBoing(my user in wc3 tft europe), my password for majorboing, and europe.battle.net.
then i compile it (using vc++6) and nothing happens O.O just a black screen, why is that ? =o
thx :>
[/quote]
The "Guest" account was disabled a long time ago. The only non-passworded account now is "Anonymous" (but beware that unlike Guest, it does not prompt for a password, so your password field will be the first text message the bot sends!). You will probably be wanting to use it with something like a Starcraft account.
November 26, 2003, 2:22 PM
Stealth
GPX: If you're not going to use Anonymous, create an account using Starcraft or Diablo II, then use that to log on.
November 26, 2003, 2:42 PM
Kp
[quote author=Stealth link=board=17;threadid=3842;start=0#msg31638 date=1069857722]
GPX: If you're not going to use Anonymous, create an account using Starcraft or Diablo II, then use that to log on.
[/quote]

Or Warcraft II, or any other client that isn't Warcraft III/TFT. :)
November 26, 2003, 3:31 PM
ObsidianWolf
Although you can learn a great deal using anonymous, anonymous is good for checking stats and posting to webpage.
November 26, 2003, 3:33 PM
Kp
[quote author=ObsidianWolf link=board=17;threadid=3842;start=15#msg31645 date=1069860819]
Although you can learn a great deal using anonymous, anonymous is good for checking stats and posting to webpage.
[/quote]

Yes, but greetbot really isn't designed to be logged on as anonymous, and would likely get confused if you tried.

Also, iirc, the default greetbot never prints anything to its console. You could of course add print statements in the appropriate places if you're curious what it is seeing.
November 26, 2003, 3:38 PM
GPX
Lollllllll ;D
u'r saying anything but warcraft III tft would work ? :P but that's the only game i got ;)
hmmmmmm......
can some1 open an account for me or gimme his old account for this bot on one of these games ? :D:D:DD:D
November 26, 2003, 3:52 PM
ObsidianWolf
pm what you want your name and account to be or contact me on bnet, and ill do it for you.
November 26, 2003, 4:00 PM
GPX
Thanks all, thanks somethingsomethingWolf, for opening an account for me ;)
Now i still have a question :S
i tried to enter a channel, using
Send("/channel Frozen Throne isr-1\r\n");
and it replies "Restricted channel" and doesn't enter :( it only enters public chat 1 or 2 etc .
why is that ? =o
November 26, 2003, 6:07 PM
ObsidianWolf
I have no knowledge on that code, but it sounds like you are trying to connect like a Chat Client instead of Binary. If that is so, then thats why. Chat Clients can only open Public Chat, Open Tech Support and something else.
November 26, 2003, 6:29 PM
iago
It's because it's a restricted client, and thus it can only join public channels. Public Chat * will work (like, Public Chat goon or Public Chat Johhny or whatever)
November 26, 2003, 6:41 PM
Skywing
Specifically, a non-administrative chat client can only join Open Tech Support, Blizzard Tech Support, and Public Chat <any-postfix>. Anonymous chat clients cannot join any channels or send whispers.
November 26, 2003, 6:56 PM
Kp
[quote author=GPX link=board=17;threadid=3842;start=15#msg31653 date=1069861973]
Lollllllll ;D
u'r saying anything but warcraft III tft would work ? :P but that's the only game i got ;)
hmmmmmm......
can some1 open an account for me or gimme his old account for this bot on one of these games ? :D:D:DD:D
[/quote]

Ugh. For the future, try to actually use some spelling and grammar. "u'r" is not proper...

Also, regarding "only got war3", I feel sorry for you. There are so many better games. :)
November 26, 2003, 10:27 PM
St0rm.iD
Get a copy of SC for ten bucks :)
November 26, 2003, 10:31 PM
dRAgoN
[quote author=St0rm.iD link=board=17;threadid=3842;start=15#msg31768 date=1069885904]
Get a copy of SC for ten bucks :)
[/quote]

Or download Starcraft Shareware from blizzards webpage.
November 27, 2003, 12:07 AM

Search