EnergyMech
Forum | Features | Download | Patches | Help | #emech | Links | About | Contact |
Versions | News Archive | Installing | Linking | Configuration | Commands | FAQ |


IRC Bot Uptimes

URL: Uptime.eggheads.org

typedef struct
{
  int            regnr;
  int            pid;
  int            type;
  unsigned long  cookie;
  unsigned long  uptime;
  unsigned long  ontime;
  unsigned long  now;
  unsigned long  sysup;
  char           string[...];
} PackUp;
  • regnr
  • Unused in the current implementation, should be set to zero (0).
     
  • pid
  • The process ID of the bot. On a POSIX system it would be set to the value of getpid();
     
  • type
  • The type number of your bot, this would be the number assigned and recognized by the server to be your kind of bot, not something you can set at will. To get your own type number for your bot, contact proton or guppy.
     
  • cookie
  • At startup the cookie is set to a random number, for each each packet sent, the cookie is modified; cookie = ((cookie + 1) * 18457).
     
  • uptime
  • At start set to number of seconds since epoch time. On POSIX, uptime = time(), set once and then staying the same.
     
  • ontime
  • Whenever your bot is connected to a new server, reset the ontime to number of seconds since epoch time; on POSIX: ontime = time().
     
  • now
  • The current time, set on each packet sent; on POSIX: now = time().
     
  • sysup
  • On UNIX systems it is possible and easy to get the system uptime by getting the time from the /proc directory.
     
  • string[...]
  • Set the string to the format "nick server version". Since the type number specifies your bot, there is no need to send the bot type along with the packet, instead of "EnergyMech 11.22.33" it will only need to send "11.22.33", the server will know the "EnergyMech" part, or whatever your bot type is named. This string consists of nick, a single space, server name, a single space, version number string, a terminating char \0 (octet 0). If you do not wish to send any of these strings, you may send "unknown" as the string for the specified entry. For a complete unknown it would therefor be "unknown unknown unknown\0".

 
Copyright © 2000-2005 Proton,  All rights reserved.  Last edited December 21st, 2004.