greetz i was wondering how to this small tcl could be changed to have it only trigger if certain vhost ( channel.bot ) uses it in instead of (if {![isop $nick $chan]} return ) with pubic cmd and as well as in pm msg of the eggdrop
if {[llength $text] != 3} {
puthelp "NOTICE $nick :usage: !sh nick!user@host duration :reason"
} else {
set reason [lassign $text user duration]
if {![scan $duration {%d} d]} {
# set a defaul duration cos what the user gave is not a valid number
set duration "10"
}
}
cos reason will be just one word, for example if you do !kl nick some reason here the actual reason set by the scan will actually be some, and not some reason here as expected.
bind pub * !kill oper:kill
proc oper:kill {nick uhost hand chan text} {
if {![string match -nocase "channel.bot" [lindex [split $uhost @] 1]]} return
if {[llength $text] != 2} {
puthelp "NOTICE $nick :usage: !kill <nick> <reason>"
} else {
set reason [lassign $text user]
}
if {[isbotnick $user]} {
# do whatever you wish
return
}
if {[isop $user $chan]} {
puthelp "NOTICE $nick :$user Is Also Helper, You Cannot Use This Command On Them"
return
}
putserv "KILL $user $reason"
}
bind pub * !shun oper:shun
proc oper:shun {nick uhost hand chan text} {
if {![string match -nocase "channel.bot" [lindex [split $uhost @] 1]]} return
if {[llength $text] != 3} {
puthelp "NOTICE $nick :usage: !shun nick!user@host duration reason"
} else {
set reason [lassign $text user duration]
if {![scan $duration {%d} d]} {
# set a defaul duration cos what the user gave is not a valid number
set duration "10"
}
}
if {[isbotnick $user]} {
# do whatever you wish
return
}
if {[isop $user $chan]} {
puthelp "NOTICE $nick :$user Is Also Helper, You Cannot Use This Command On Them"
return
}
putserv "SHUN $user $duration :$reason"
}
For the Shun command, you would want to either declare the duration in the command, or set a default duration (like you did). If you set it hardcoded, this would make the command; !shun nick!*identd@*.host.or.IP <reasons for shun here>
If you want to allow the duration to be in the command, you'd also have to change the reason to match the argument value. !shun nick!*identd@*.host.or.IP <duration> <reasons for shun> - this would make it:
set duration [lindex $text 1]
set reason [join [lrange [split $text] 2 end]]
I don't see how or where you declared $user - do you mean to use $nick ?
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.