From ba46c304bdffdce0b6019a47f6759ce6abbeef90 Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Tue, 16 Aug 2011 10:51:41 +0200 Subject: Initial commit --- pong.tcl | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 pong.tcl (limited to 'pong.tcl') diff --git a/pong.tcl b/pong.tcl new file mode 100644 index 0000000..73eee2f --- /dev/null +++ b/pong.tcl @@ -0,0 +1,34 @@ +# description: little funny ping-pong script, everyone knows this joke from irc, bot can kick you or just answer you + +# Author: Tomekk +# e-mail: tomekk/@/oswiecim/./eu/./org +# home page: http://tomekk.oswiecim.eu.org/ +# +# Version 0.1 +# +# This file is Copyrighted under the GNU Public License. +# http://www.gnu.org/copyleft/gpl.html + +bind pub - !ping ping_fct + +# 0 - answer 'pong', 1 - kick with 'pong' ;-) +set fun "0" + +proc ping_fct { nick uhost hand chan arg } { + global fun + + set txt [split $arg] + + set pongle [join [lrange $txt 0 end]] + + if {$pongle == ""} { + + if {$fun == "0"} { + putquick "PRIVMSG $chan :ping? pong!" + } { + putkick $chan Pong! + } + } +} + +putlog "tkpingpong.tcl ver 0.1 by Tomekk loaded" -- cgit v1.2.3