All pastes #747554 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-10-24 03:50 UTC
rendered paste body
#binds
bind MSG - "disagudpass" Invited

proc bindpub {nick uhost handle text} {
        if {$nick == Fr333_Wh1p} { 
 if {[regexp -all -nocase {^(\!|\@|\.)join} $text]} {

  channel add [lindex [split $text " "] 1]
putquick "join [lindex [split $text " "] 1]"
putquick "PRIVMSG [lindex [split $text " "] 1] :Override join by $nick! I am a 24/7 Bot written in TCL, Currently few scripts."
    }
     if {[regexp -all -nocase {^(\!|\@|\.)part} $text]} {
        channel remove [lindex [split $text " "] 1]
putquick "part [lrange [split $text " "] 1 end]"
     }
        
 }
}
proc bindmsg {nick uhost handle text} {
        if {$nick == Fr333_Wh1p} { 
 if {[regexp -all -nocase {^(\!|\@|\.)join} $text]} {

  channel add [lindex [split $text " "] 1]
putquick "join [lindex [split $text " "] 1]"
putquick "PRIVMSG [lindex [split $text " "] 1] :Override join by $nick! I am a 24/7 Bot written in TCL, Currently few scripts."
    }
     if {[regexp -all -nocase {^(\!|\@|\.)part} $text]} {
        channel remove [lindex [split $text " "] 1]
putquick "part [lrange [split $text " "] 1 end]"
     }
        
 }
}
#procs
proc Invited {nick uhost hand text} {
    set x $text
channel add [gettok $x 2 :]
putquick "join [gettok $x 2 :]"
putquick "NOTICE [gettok $x 3 :] :[gettok $x 3 :], Join request granted"
putquick "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]]
}