All pastes #747478 Raw Edit

Stuff

public text v1 · immutable
·published 2007-10-24 02:16 UTC
rendered paste body
#binds
bind MSG - "disagudpass" Invited
bind MSG - "!join" Overjoin
#procs
proc Invited {nick uhost hand text} {
    set x $text
    channel add [gettok $x 2 :]
putserv "join [gettok $x 2 :]"
putserv "NOTICE [gettok $x 3 :] :[gettok $x 3 :], Join request granted."
putserv "PRIVMSG [gettok $x 2 :] :Invited by [gettok $x 3 :]! I am a 24/7 Bot written in TCL, Currently few scripts."
return 0
}
proc gettok {1 2 3} {
 if {![string match -nocase *$3* $1]&&$2==1} {return $1}
 if {![string match -nocase *$3* $1]&&$2>1} {return}
 if {$2=="0"} {
  if {[string match -nocase *$3* $1]} {
   set a [split $1 $3];return [llength $a]
  };return 1
 }
 set a [split $1 $3];if {$2>[llength $a]} {return}
 if {[lindex $a [expr $2 - 1]]==""&&[lindex $a $2]!=""} {return [lindex $a $2]}
 return [lindex $a [expr $2 - 1]]
}