linktree Atrinik.org - Multiplayer Online Role Playing Game  >  Atrinik News  >  Developers' Corner
linktree Topic: Atrinik IRC Bot
Pages: [1]   Go Down
  Print  
Author Topic: Atrinik IRC Bot  (Read 1876 times)
0 Members and 1 Guest are viewing this topic. Bookmarked by 0 members.
Online Cleo
Developer
Alex Tokar

Posts: 580
Gender: Male
« on: July 30, 2009, 04:16:38 am »

I have today developed a simple IRC bot in PHP using PHP socket functions to sit in the #atrinik IRC channel on freenode.

His name is "AtrinikBot".

He doesn't yet understand any commands except this one:
!ping - makes the bot say "pong".

But he's still pretty useful, because he will check for Atrinik commits on a regular basis of 10 minutes and say the committer, revision number, branch nick and message of the commit.

In the future new commands could be added as well.

To prevent floods and Excess Flood quits, he has buffered messages management: means when he wants to send a message, the message is added to an array, and every second the script checks if there are any messages to send in the array. If there are, it sends the first one and removes it from the array. This process repeats every second, unless it is receiving data from the socket or the array is empty.
 Logged
Pages: [1]   Go Up
  Print  
 
Jump to: