Valhalla Legends Archive

Programming => General Programming => Topic started by: Krush[LM] on January 13, 2005, 07:38 PM

Title: IRC Bot / Script
Post by: Krush[LM] on January 13, 2005, 07:38 PM
I don't know where exactly to post this.  But I'm attempting to either find a irc bot that I can get the code for to look at, or scripts to run through Your-Bot that can help me check in real-time the status of a World of Warcraft server so players can just check with the bot to see if the server is up or down.

Anyone got ideas where to start me out at?
Title: Re: IRC Bot / Script
Post by: hismajesty on January 13, 2005, 07:46 PM
pscode.com for the irc stuff
maybe ping the server? You might have to do it a certain way though, I'm not sure if the WoW servers react to being pinged the same as regular bnet servers.
Title: Re: IRC Bot / Script
Post by: Krush[LM] on January 13, 2005, 07:58 PM
Quote from: hismajesty[yL] on January 13, 2005, 07:46 PM
pscode.com for the irc stuff
maybe ping the server? You might have to do it a certain way though, I'm not sure if the WoW servers react to being pinged the same as regular bnet servers.

That's what I was thinking, but according to Blizzard they don't know of a way to check the server status with a bot.  I emailed them about ping and no response yet.

Where on pscode.com am I supposed to be looking for the mirc stuff?
Title: Re: IRC Bot / Script
Post by: R.a.B.B.i.T on January 13, 2005, 08:50 PM
Search for "mirc" -.-
Title: Re: IRC Bot / Script
Post by: Krush[LM] on January 13, 2005, 08:54 PM
Quote from: R.a.B.B.i.T on January 13, 2005, 08:50 PM
Search for "mirc" -.-

That gave me alot of useless junk.  I didn't see anything that stuck out as a real use.
Title: Re: IRC Bot / Script
Post by: Stealth on January 13, 2005, 10:11 PM
AIRC (http://sourceforge.net/projects/airc) might be what you're looking for, if you're writing in Visual Basic.
Title: Re: IRC Bot / Script
Post by: Krush[LM] on January 14, 2005, 01:06 AM
Quote from: Stealth on January 13, 2005, 10:11 PM
AIRC (http://sourceforge.net/projects/airc) might be what you're looking for, if you're writing in Visual Basic.

I'm not too familar with vb could you tell me if there is a function in there that is parsing the chat already?
Title: Re: IRC Bot / Script
Post by: Krush[LM] on January 14, 2005, 02:00 AM
I've got some code to handle the pinging of the server.  Is there anyway short of asking Blizzard for me to get the ip of the servers?
Title: Re: IRC Bot / Script
Post by: Kp on January 14, 2005, 10:44 AM
Sure.  Ask WoW's binary. :)  More specifically, monitor the servers it contacts when you get online to play.
Title: Re: IRC Bot / Script
Post by: Krush[LM] on January 14, 2005, 12:56 PM
Quote from: Kp on January 14, 2005, 10:44 AM
Sure.  Ask WoW's binary. :)  More specifically, monitor the servers it contacts when you get online to play.

Ya i got it through netstats.

I only need to add 3 things at the moment:
Another button after DCC (that starts the server pinging).
And 2 options in Perferances, one that lets you type in things to Perform on connect, and another that lets you input the WoW server IP to ping.

If someone that knows vb could help me out that'd be great, i'm mostly a c/c++ guy :(
Title: Re: IRC Bot / Script
Post by: Krush[LM] on January 14, 2005, 07:42 PM
Reply from blizz

Hello,

Our servers do not respond to communications attempts by programs other then our own, pings fail and traceroutes time out.

We are making head way in improving the server status page and how it relays information so that might be an angle to pursue.

Anyone have an idea of how I could check http://www.worldofwarcraft.com/serverstatus/ for a specific servers status through a bot?
Title: Re: IRC Bot / Script
Post by: j0k3r on January 14, 2005, 08:40 PM
Quote from: Krush[LM] on January 14, 2005, 07:42 PM
Anyone have an idea of how I could check http://www.worldofwarcraft.com/serverstatus/ for a specific servers status through a bot?
I've never done this before and have little programming experience, but what the hell. Get the HTML code for the page, parse through it to find which server you want to check (serverStatus1 goes with Agrammar, goes on), and look at the gif image associated with it (the first cell).

<td class = "serverStatus1" align = "center"><img src = "/shared/wow-com/images/icons/serverstatus/uparrow.gif" width = "18" height = "18"></td>
<td class = "serverStatus1" NOWRAP><b class = "smallBold" style = "color: #234303;">Aggramar</b></span></td>
<td class = "serverStatus1" NOWRAP><small style = "color: #234303;">Normal</small></td>
<td class = "serverStatus1" align = "left"><small style = "color: #535600;">Medium</small></td>

Agrammar is serverStatus1, uparrow.gif would be the status (downarrow.gif would be down I presume), and the normal/medium is the other two things.
HTH.
Title: Re: IRC Bot / Script
Post by: hismajesty on January 14, 2005, 08:58 PM
There's a way to get around Blizzard not replying to ping on regular bnet servers, I don't recall how though. I know LoRd did it so maybe he'll see this thread and post. :)
Title: Re: IRC Bot / Script
Post by: Krush[LM] on January 14, 2005, 09:12 PM
Quote from: j0k3r on January 14, 2005, 08:40 PM
Quote from: Krush[LM] on January 14, 2005, 07:42 PM
Anyone have an idea of how I could check http://www.worldofwarcraft.com/serverstatus/ for a specific servers status through a bot?
I've never done this before and have little programming experience, but what the hell. Get the HTML code for the page, parse through it to find which server you want to check (serverStatus1 goes with Agrammar, goes on), and look at the gif image associated with it (the first cell).

<td class = "serverStatus1" align = "center"><img src = "/shared/wow-com/images/icons/serverstatus/uparrow.gif" width = "18" height = "18"></td>
<td class = "serverStatus1" NOWRAP><b class = "smallBold" style = "color: #234303;">Aggramar</b></span></td>
<td class = "serverStatus1" NOWRAP><small style = "color: #234303;">Normal</small></td>
<td class = "serverStatus1" align = "left"><small style = "color: #535600;">Medium</small></td>

Agrammar is serverStatus1, uparrow.gif would be the status (downarrow.gif would be down I presume), and the normal/medium is the other two things.
HTH.

You'd think that at first look but serverStatus1 is just the color of the row in the table it alternates between that and serverStatus2
Title: Re: IRC Bot / Script
Post by: j0k3r on January 14, 2005, 10:57 PM
Ah, well you get the idea I'm sure.
Title: Re: IRC Bot / Script
Post by: Krush[LM] on January 14, 2005, 11:05 PM
Quote from: j0k3r on January 14, 2005, 10:57 PM
Ah, well you get the idea I'm sure.

I'm assuming you want me to parse that webpage and see if the picture is up or down for my server?

I still really don't know how to work through this VB code, if someone has a c/c++ version of a irc thing that would be great.  And I tried eggdrop and i couldn't figure out how to get it to compile.
Title: Re: IRC Bot / Script
Post by: hismajesty on January 15, 2005, 12:21 AM
http://pscode.com/vb/scripts/ShowCode.asp?txtCodeId=7316&lngWId=3

The IRC protocol is essentially text based, as long as you have knowledge of sockets in your chosen language, it shouldn't be hard at all to do it yourself. Here's a link to all the information on the protocol:

http://www.irchelp.org/irchelp/rfc/
Title: Re: IRC Bot / Script
Post by: mynameistmp on January 16, 2005, 10:48 PM
Instead of writing an entire IRC front end you should consider writing a plugin for an existing interface. For example the XChat client. They distribute binaries for Windows or Linux so you're good on either platform. The client's C-Plugin interface is in C which you say you know, and it gives you full control over the client's GUI, any incoming text events, any outgoing text events, context, etc. The API is very transparent and discoverable. With it you can write flexible, functional plugins in about 25-40 lines of C code. Writing an entire irc client will take you a considerable amount of effort and time. Especially one as feature-rich and intensively bugtested as XChat. I think this would more than suffice.

http://www.xchat.org/docs/
Title: Re: IRC Bot / Script
Post by: UserLoser. on January 16, 2005, 11:17 PM
Quote from: hismajesty[yL] on January 14, 2005, 08:58 PM
There's a way to get around Blizzard not replying to ping on regular bnet servers, I don't recall how though. I know LoRd did it so maybe he'll see this thread and post. :)

All you do is make an attempt to connect to one of the servers and calculate the difference of the starting and ending time
Title: Re: IRC Bot / Script
Post by: j0k3r on January 17, 2005, 05:58 AM
Quote from: Krush[LM] on January 14, 2005, 11:05 PM
I'm assuming you want me to parse that webpage and see if the picture is up or down for my server?
I don't want you to, it's a suggestion.
Title: Re: IRC Bot / Script
Post by: Krush[LM] on January 17, 2005, 07:25 PM
Quote from: UserLoser on January 16, 2005, 11:17 PM
Quote from: hismajesty[yL] on January 14, 2005, 08:58 PM
There's a way to get around Blizzard not replying to ping on regular bnet servers, I don't recall how though. I know LoRd did it so maybe he'll see this thread and post. :)

All you do is make an attempt to connect to one of the servers and calculate the difference of the starting and ending time

could you show me a quick code example?
Title: Re: IRC Bot / Script
Post by: Kp on January 17, 2005, 09:14 PM
Quote from: Krush[LM] on January 17, 2005, 07:25 PM
Quote from: UserLoser on January 16, 2005, 11:17 PM
Quote from: hismajesty[yL] on January 14, 2005, 08:58 PMThere's a way to get around Blizzard not replying to ping on regular bnet servers, I don't recall how though. I know LoRd did it so maybe he'll see this thread and post. :)
All you do is make an attempt to connect to one of the servers and calculate the difference of the starting and ending time
could you show me a quick code example?


$now = time();
&connect_to_WoW();
$then = time();
print "Took " . ($then - $now) . " seconds.";
Title: Re: IRC Bot / Script
Post by: Krush[LM] on January 18, 2005, 05:59 AM
So what do i need to connect to the server?

btw: the bot is up and running on irc.us.gamesurge.net in #kiljaeden #kil'jaeden for now and it just parses the webpage blizzard has, but i'd like to have another form of checking