USAGE:
/+-vho #channel Target
Good Luck
;;Simple +-vho for mIRC by Bielie
;;Version 1.0
;;Status: This code "smells" and needs refactoring
alias +v {
if ($2 !ison $1) { echo Target not found | halt }
if ($2 isvoice $1) { echo Target is already a voice | halt }
if ($chanaccess($1,$me) >= 2) { .timer 1 1 mode $1 +v $2 | msg $1 +v $2 | halt }
else { echo No Access | halt }
}
alias -v {
if ($2 !ison $1) { echo Target not found | halt }
if ($2 !isvoice $1) { echo Target is not currently voiced | halt }
if ($chanaccess($1,$me) >= 2) { .timer 1 1 mode $1 -v $2 | msg $1 -v $2 | halt }
else { echo No Access | halt }
}
alias +h {
if ($2 !ison $1) { echo Target not found | halt }
if ($2 ishop $1) { echo Target is already an half-operator | halt }
if ($chanaccess($1,$me) >= 3) { .timer 1 1 mode $1 +h $2 | msg $1 +h $2 | halt }
else { echo No Access | halt }
}
alias -h {
if ($2 !ison $1) { echo Target not found | halt }
if ($2 !ishop $1) { echo Target is not currently an half-operator | halt }
if ($chanaccess($1,$me) >= 3) { .timer 1 1 mode $1 -h $2 | msg $1 -h $2 | halt }
else { echo No Access | halt }
}
alias +o {
if ($2 !ison $1) { echo Target not found | halt }
if ($2 isop $1) { echo Target is already an operator | halt }
if ($chanaccess($1,$me) >= 3) { .timer 1 1 mode $1 +o $2 | msg $1 +o $2 | halt }
else { echo No Access | halt }
}
alias -o {
if ($2 !ison $1) { echo Target not found | halt }
if ($2 !isop $1) { echo Target is not currently an operator | halt }
if ($chanaccess($1,$me) >= 3) { .timer 1 1 mode $1 -o $2 | msg $1 -o $2 | halt }
else { echo No Access | halt }
}
alias chanaccess {
if ($1 ischan) {
if ($2 ison $1) {
var %pre = $remove($nick($1,$2).pnick,$2)
if ($prop == pre) return %pre
if ($prop == p) return $left(%pre,1)
elseif (@ isin %pre) || ($1 isop $2) { return 3 }
elseif (% isin %pre) || ($1 ishop $2) { return 2 }
elseif (+ isin %pre) || ($1 isvo $2) { return 1 }
else { return 0 }
}
}
}
Here's my take (supports both nickmodes and channel modes):
on @*:input:#:{
if ($regex($1,/^[+-][ $nickmode ]/x)) {
if ($2 !ison $chan) { echo 4 User $qt($2) is not currently on the channel. }
else { mode $chan $1- }
}
elseif ($regex($1,/^[+-][ $remove($chanmodes,$chr(44)) ]/x)) { mode $chan $1- }
}
So much code for something simple. This is what I use
on *:INPUT:*: {
if ($regex($mid($1-,1,2),[+-][vhoaq])) {
if ($2 !ison $chan) { echo 4 User is not currently in the channel. | halt }
haltdef
mode $chan $mid($1-,1,1) $+ $remove($mid($1-,2,2),$chr(32)) $2-
}
}
Granted, it is an on input, but it's shorter and does the same thing yours does. Kudos anyways. :) Good work.