set text1 "text number 1"
set text2 "text number 2"
set reason "you are out"
bind pub - !power pub:power
proc pub:power {nick uhost handle chan text} {
global botnick
global text1
global text2
global reason
if {([matchattr $nick o|o $chan])} {
puthelp "PRIVMSG $nick: $text1"
puthelp "PRIVMSG $nick: $text2"
} else putkick $chan $nick $reason
}
why when someone that have the flag +o when put the trigger he doesn't give the text!!? The ideia of this tcl is that, someone that have the flag, when trig the !power it will be sent to him a text, if this person don't have the falag should be kick.
Thanks guys
set text1 "text number 1"
set text2 "text number 2"
set reason "you are out"
bind pub - !power pub:power
proc pub:power {nick uhost handle chan text} {
global botnick
global text1
global text2
global reason
if {([matchattr $nick o|o $chan])} {
puthelp "PRIVMSG $nick: $text1"
puthelp "PRIVMSG $nick: $text2"
} else putkick $chan $nick $reason
}
why when someone that have the flag +o when put the trigger he doesn't give the text!!? The ideia of this tcl is that, someone that have the flag, when trig the !power it will be sent to him a text, if this person don't have the falag should be kick.
Thanks guys
"matchattr" matches flags against a 'handle' not a 'nick'...
Thus, you should be using $handle not $nick.
set text1 "text number 1"
set text2 "text number 2"
set reason "you are out"
bind pub - !power pub:power
proc pub:power {nick uhost handle chan text} {
global botnick text1 text2 reason
if {[matchattr $nick o|o $chan]} {
puthelp "PRIVMSG $nick: $text1"
puthelp "PRIVMSG $nick: $text2"
return 0
} else {
putkick $chan $nick $reason
return 0
}
}
}
This looks about right, you can check matchattr against a nickname. Generally, 'nick' is usually the person who triggered command. This is untested, but looks about right.
Use the nick2hand to get the hand from a nick and then use matchattr, but in your case use matchattr on handle, if it's known by the bot will be his user if is not will be * as in everyone aka. no access
Once the game is over, the king and the pawn go back in the same box.