summaryrefslogtreecommitdiffstats
path: root/pong.tcl
blob: 73eee2f28a7b727fc8f423d859fec90922859f73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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"