The IRC bot is included with Synchronet BBS, at exec/ircbot.js
. Additional IRC bot modules are available in exec/ircbots/
.
The IRC bot configuration file is ircbot.ini.
[server_ServerName] addresses=add.ress.one, add.ress.two nick=BotNickname services_password=? channels=#channelone, #channeltwo port=6667
Notes:
Modules
There are a number of modules available for the IRC bot, but they are not all enabled (or listed) in ctrl/ircbot.ini
by default.
[module_ModuleName] channels=#channelone <key>,!#channeltwo dir=/sbbs/exec/ircbots/mybot/ lib=mylib.js global=true
Looking at the exec/ircbots
directory, you may see more modules that are installed but bot configured. As of the time of this writing, the following are available:
;[module_Trivia] ;dir=/sbbs/exec/ircbots/trivia/ [module_Admin] global=true dir=/sbbs/exec/ircbots/admin/ [module_Antispam] global=true channels = #channelname dir=/sbbs/exec/ircbots/antispam/ [module_Decider] global=true dir=/sbbs/exec/ircbots/decider/ [module_Dice] global=true dir=/sbbs/exec/ircbots/dice/ [module_Dis] dir=/sbbs/exec/ircbots/dis/ ;[module_Google] ;global=true ;dir=/sbbs/exec/ircbots/google/ [module_Ham] dir=/sbbs/exec/ircbots/ham/ [module_Humanity] dir=/sbbs/exec/ircbots/humanity/ [module_Info] global=true dir=/sbbs/exec/ircbots/info/ lib=http.js [module_Poker] dir=/sbbs/exec/ircbots/poker/ lib=cardlib.js [module_Presence] dir=/sbbs/exec/ircbots/presence/ [module_Weather] global=true dir=/sbbs/exec/ircbots/weather/ lib=http.js [module_WhereIs] global=true dir=/sbbs/exec/ircbots/whereis/ lib=http.js [module_RPG] channels = #channelname dir=/sbbs/exec/ircbots/rpgbot/
Notes
Running the IRC Bot
The IRC bot can be executed via jsexec, jsexec ircbot.js
, and an alternate configuration file may be specified like so: jsexec ircbot.js -f /some/other/ircbot.ini
.
You can also run the IRC bot via your services thread by adding an entry to services.ini:
[IRCBot] Port=6668 Options=STATIC|LOOP Command=ircbot.js
Note that the Port value must be supplied, but is irrelevant; the bot does not listen for connections. Just pick an unused port.
You can add -f /some/other/ircbot.ini
to the Command line to specify an alternate configuration file.
Without IDENT the help looks like;
Usage: HELP <module> <command> | HELP <command> [main] help,?,ident,quote [admin] whois,eval,lastspoke [antispam] [decider] should [dice] roll,dice [dis] quote,dis [ham] specs,z,geo,vhf,hf,country,callsign,contests,bands [humanity] humanity,submit,humanity!,pick,humanity?,score [info] def,syn,info,wtf [poker] deal,go,fold,check,bet,call,raise,status,list,show,hole,invite,balance [presence] nodelist [weather] weather,forecast [whereis] whereis [rpg] create,classes,races,zones,login,logout,help editor commands: set, link, unlink, move, mobs, items, exits, title, desc, goto, look battle commands: flee, kill item commands: drop, get, put, unlock, lock, open, close, remove, wear, equip, wield rpg commands: score, status, move, equipment, inventory, look for detailed command info, type 'rpg help <command>' for help creating a characer, type 'rpg help create' for help with the editor, type 'rpg help editor'
With IDENT it looks like;
Usage: HELP <module> <command> | HELP <command> [main] reload,load,join,part,die,restart,help,?,ident,addquote,quote,greet,save,prefix,nick,module,modules,abort,ignore [admin] whois,addmask,delmask,adduser,change,resetpass,pass,seval,eval,groups,subs,subgroups,read,finger,udpfinger,exec,say,lastspoke,force,debug,objkeys,tail,pipe [antispam] [decider] should [dice] roll,dice [dis] quote,dis [ham] specs,z,geo,vhf,hf,country,callsign,contests,bands [humanity] humanity,submit,humanity!,pick,humanity?,score [info] def,syn,info,wtf [poker] deal,go,fold,check,bet,call,raise,status,list,show,hole,invite,balance,buyin [presence] nodelist [weather] weather,forecast [whereis] whereis [rpg] create,classes,races,zones,login,edit,logout,save,help,restore editor commands: set, link, unlink, move, mobs, items, exits, title, desc, goto, look battle commands: flee, kill item commands: drop, get, put, unlock, lock, open, close, remove, wear, equip, wield rpg commands: score, status, move, equipment, inventory, look for detailed command info, type 'rpg help <command>' for help creating a characer, type 'rpg help create' for help with the editor, type 'rpg help editor'
The main module functions are contained in the /exec/load/ircbot_commands.js
file. All other modules are free standing and have separate files in their respective directories under /exec/ircbots/
. The help associated with the various modules/commands is not complete. if you choose to add/update look for the lines;
Bot_Commands["RELOAD"].usage = get_cmd_prefix() + "RELOAD"; Bot_Commands["RELOAD"].help = "Reloads the internal bot command and function structure. No arguments.";
This is an example from the command RELOAD. The usage line dictates the syntax required to execute the command. The help line contains a text description of the command's function.
Module Main
Note: The RELOAD command throws an error in it's default config. This should result in reloading ircbot.ini as well as all the modules, but fails with the following error;
TypeError: redeclaration of const MODULE_NAME file: /sbbs/exec/ircbots/presence/presence.js line: 27
You may comment out this section in the /exec/load/ircbot_commands.js
file to avoid, but then you don't RELOAD modules, just the bot.
Bot_Commands["RELOAD"].command = function (target,onick,ouh,srv,lvl,cmd) { srv.o(target,"Reloading the bot configuration...","NOTICE"); load("load/ircbot_commands.js"); load("load/ircbot_functions.js"); for(var m in Modules) { /* Don't reload libraries?? for(var l in Modules[m].load) { if(Modules[m].load[l]) load(Modules[m],Modules[m].load[l]); } */ } srv.o(target,"Reloaded.","NOTICE"); return; }
I'll start creating separate pages for the other modules as I work though them.