Oom Jurie the Eggdrop Bot
Why?
- Wanted to work on some WUG related feedback in the IRC channels. Things like signal quality for a Nick.
- Wanted a way to log all conversations on the IRC channels.
- Eggdrop is the BOT of choice in the WUG, so had to make it work.
- The only way to get to know IRC, is to automate IRC.
How?
Now the thing starts, but what now?
Ok, I found many guides to connect, get the bot to say things, but nothing simple to get me started on the TCL, so here is my help on this.
Figure out the location of the scripts, and add the following script file as greeting.tcl:
set flood-join 0:0set onjoinchan "#general"putlog "Greeting loaded....."bind join - * greetingproc greeting {nick uhost hand channel args} {global onjoinchan greet howtellif {(([lsearch -exact [string tolower $onjoinchan] [string tolower $channel]] != -1) || ($onjoinchan == "*"))} {putserv "notice $channel :Hi $nick , welcome to $channel."}}
Then edit your eggdrop.conf file and add to the end:
source scripts/greeting.tcl
and restart the bot.
It should now talk to you when you join the #general channel.
The second part was to get eggdrop to run a PHP file and pass the output, this I got working using the TCL exec command:
set res [exec /usr/bin/php greeting.php]for { set i 0 } { $i < [llength $res] } { incr i } {putserv "PRIVMSG $nick :[lindex $res $i]"}
This is very short and to the point. There are many resources, so please use Google for more help.
Where?