Code: Select all
bind ctcp * ACTION responses
proc responses {nick host hand chan kw arg} {
if {[string match -nocase "*pokes ${::botnick}*" $arg]} {
putserv "PRIVMSG $chan :Don't ever try to poke me! D:"
}
return
}
bind pubm * * bot_is_doing
proc bot_is_doing {nick host hand chan text} {
if {[regexp -nocase -- ".*doing.*${::botnick}.*" [join [lrange [split $text] 0 end]]] || [regexp -nocase -- ".*${::botnick}.*doing.*" [join [lrange [split $text] 0 end]]]} {
putserv "PRIVMSG $chan :It's am, I am sleeping, please don't disturb me."
} elseif {[regexp -nocase -- ".*owner.*${::botnick}.*" [join [lrange [split $text] 0 end]]] || [regexp -nocase -- ".*:${::botnick}.*owner.*" [join [lrange [split $text] 0 end]]]
} {
set nicks [chanlist $chan]
putserv "PRIVMSG $chan :\001Action points to [lindex $nicks [rand [llength $nicks]]]\001"
}
}
Code: Select all
set PokeText {
"\001ACTION poke $nick back"
"\001ACTION punch $nick *bletaakkss*"
"Dont try to poke $botnick"
"i'll ask $dest user to poke you back"
}
Code: Select all
set PokeText [string map [list "\$nick" "$nick" "\$dest" "$dest" "\$botnick" "$::botnick"] $PokeText]
Code: Select all
set PokeText [string map [list "\$nick" "$nick" "\$dest" "$dest" "\$botnick" "$::botnick"] $PokeText]
Code: Select all
set PokeText [string map "\$nick {$nick} \$dest {$dest} \$botnick {$::botnick}" $PokeText]
Code: Select all
join [lrange [split $text] 0 end]
hi game_over, i try using it but still not workgame_over wrote:tryCode: Select all
set PokeText [string map "\$nick {$nick} \$dest {$dest} \$botnick {$::botnick}" $PokeText]
Code: Select all
set PokeText [list \
"\001ACTION pokes %nick% back\001" \
"\001ACTION punches %nick%\001" \
"Don't try to poke %botnick%"]
bind ctcp - ACTION pokeme
proc pokeme {nick host hand dest key text} {
if {[string match -nocase "*poke? ${::botnick}*" $text]} {
set response [lindex $::PokeText [rand [llength $::PokeText]]]
puthelp "PRIVMSG $chan :[string map [list "%nick%" $nick "%botnick%" $::botnick] $response]"
}
}