Ok this is really my first script and I haven't seen one this elaborate on hawkee.
it is an op bot basically.
For IRC services
Updated -- they told me to update my old one :D
alias commands {
;op commands
if ($nick isop $chan || $nick == %nick) {
if ($1 == !topic) { cs topic $chan $2- }
if ($1 == !op) { mode $chan +o $2 }
if ($1 == !hop) { cs halfop $chan $2 }
if ($1 == !voice) { mode $chan +v $2 }
if ($1 == !deop) { mode $chan -o $2 }
if ($1 == !dehop) { cs dehalfop $chan $2 }
if ($1 == !devoice) { mode $chan -v $2 }
if ($1 == !ban) { mode $chan +b $address($2,2) $2 }
if ($1 == !unban) { mode $chan -b $address($2,2) $2 }
}
if ($nick == %nick) {
;owner comamnds
if ($1 == !protect) { cs protect $chan $2 }
if ($1 == !deprotect { cs deprotect $chan $2 }
if ($1 == !own) { mode $chan +q $2 }
if ($1 == !unown) { mode $chan -q $2 }
if {$1 == !aop) { cs aop $chan add $2 }
if {$1 == !sop) { cs sop $chan add $2 }
if ($1 == !desop) { cs sop $chan del $2 }
if ($1 == !deaop) { cs aop $chan del $2 }
if ($1 == !ahop) { cs hop $chan add $2 }
if ($1 == !deahop) { cs hop $chan del $2 }
}
}
on *:load:{ set %nick $?="Enter Nickname" }
on *:TEXT:*:#: {
tokenize 32 $strip($1-)
if ($nick !isop $chan) || $nick != %nick && ($istok($commands,$1-,32) ) {
notice $nick Access denied. Only Ops can use it.
}
elseif ($nick != %nick) && ($istok($commands,$1-,32)) {
notice $nick Access denied. Only my owner can use it.
}
else { commands $1- }
}
I realize I should've put my two cents in. You really don't need to add if $nick isop $chan in every line and one text event per trigger. One is really enough:
on *:TEXT:*:#: {
tokenize 32 $strip($1-)
if ($nick !isop $chan) && ($istok($commands,$1-,32)) {
notice $nick Access denied. Only Ops can use it.
}
if ($1 == !own) { mode $chan +q $2 }
if ($1 == !unown) { mode $chan -q $2 }
if ($1 == !topic) { cs topic $chan $2- }
if ($1 == !op) { mode $chan +o $2 }
.....
so on and so forth...
}
alias -l commands { return !own !unown !topic !op }
if $nick !isop $chan tells mirc if the nick is not an op.