diff options
author | Stefan Ritter <xeno@thehappy.de> | 2011-08-16 10:51:41 +0200 |
---|---|---|
committer | Stefan Ritter <xeno@thehappy.de> | 2011-08-16 10:51:41 +0200 |
commit | ba46c304bdffdce0b6019a47f6759ce6abbeef90 (patch) | |
tree | 40a5b204637cb65c5bb91bd4f26a248ea498e019 /wiki.tcl |
Initial commit
Diffstat (limited to 'wiki.tcl')
-rw-r--r-- | wiki.tcl | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/wiki.tcl b/wiki.tcl new file mode 100644 index 0000000..deb98da --- /dev/null +++ b/wiki.tcl @@ -0,0 +1,50 @@ +# lastseen by xeno + +bind pub - !wiki wiki +bind pub - !ewiki ewiki +#bind pub - !say say +bind pub - !google say + +proc say {nick host hand chan arg} { +# putserv "PRIVMSG $chan :$arg"; +# putserv "PRIVMSG $chan :das hier ist [string trimleft $chan #]"; +} + +proc wiki {nick host hand chan arg} { + global do_wiki + if {[info exists do_wiki($nick:$chan)]} { + putserv "NOTICE $nick :no flooding!" + return 0; + } + set do_wiki($nick:$chan) 1 + timer 1 "unset do_wiki($nick:$chan)" + set arg [string trim $arg] +if {$arg == ""} { + return 0 +} + + set output [split "[exec perl /home/eggdrop/eggdrop/scripts/wiki.pl \"$arg\" de]" "\n"] + foreach out $output { + putserv "PRIVMSG $chan :$out"; + } +} + +proc ewiki {nick host hand chan arg} { + global do_wiki + if {[info exists do_wiki($nick:$chan)]} { + return 0; + } + set do_wiki($nick:$chan) 1 + timer 1 "unset do_wiki($nick:$chan)" + set arg [string trim $arg] +if {$arg == ""} { + return 0 +} + + set output [split "[exec perl /home/eggdrop/eggdrop/scripts/wiki.pl $arg en]" "\n"] + foreach out $output { + putserv "PRIVMSG $chan :$out"; + } +} + +putlog "wiki by lookshe loaded" |