|
Joined: Dec 2002
Posts: 483
Pan-dimensional mouse
|
OP
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483 |
Help me with this script. It shold not voice it self, and X! How to make this work? (eg: If X, myself and a other dude don't have voice, then just voice the dude. Since X and me allready have op, we don't need voice.. alias check-no-voice {
; name of the channel
/set -u0 %chan #mychan
;we are on the channel, and have the power
if ($me ison %chan) && (($me isop %chan) || ($me ishop %chan)) {
; users without a voice exist
if ($nick(%chan, 0, a, v) > 0) {
; voice the users
/set -u0 %a 1
while (%a <= $nick(%chan, 0, a, v)) {
/set -u0 %nicks $addtok(%nicks, $nick(%chan, %a, a, v), 32)
; group voice statements
if ($numtok(%nicks, 32) == $modespl) || (%a == $nick(%chan, 0, a, v)) {
/mode %chan + [ $+ [ $str(v, $modespl) ] ] %nicks
/unset %nicks
}
/inc -u0 %a
}
}
}
} Do you understand me?
|
|
|
|
Joined: Dec 2002
Posts: 699
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 699 |
Use /check-no-voice #channel alias check-no-voice {
if $me isop $$1 {
var %i = 1,%a
while $nick($1,%i,r) {
%a = %a $ifmatch
if $modespl == $numtok(%a,32) {
mode $1 + $+ $str(v,$modespl) %a
var %a
}
inc %i
}
if %a { mode $1 + $+ $str(v,$numtok(%a,32)) %a }
}
}
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
alias check-no-voice {
; name of the channel
/set -u0 %chan #mychan
;we are on the channel, and have the power
if ($me ison %chan) && (($me isop %chan) || ($me ishop %chan)) {
; users without a voice and op exist
if ($nick(%chan, 0, a, vo) > 0) {
; voice the users with no op
/set -u0 %a 1
while (%a <= $nick(%chan, 0, a, vo)) {
/set -u0 %nicks $addtok(%nicks, $nick(%chan, %a, a, vo), 32)
; group voice statements
if ($numtok(%nicks, 32) == $modespl) || (%a == $nick(%chan, 0, a, vo)) {
/mode %chan + [ $+ [ $str(v, $modespl) ] ] %nicks
/unset %nicks
}
/inc -u0 %a
}
}
}
}
Not to get off topic, but does anyone have a problem with pasting code from the code /code tab and pasting in mirc? It seems my carrage returns don't carry over. Never really bothered me b4, 'til i tryed to help with a 50 line script..
-KingTomato
|
|
|
|
Joined: Dec 2002
Posts: 699
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 699 |
1. Untidy. 2. Slower. 3. - The "if $me ison %chan" check is redundant, if you are op|hop on a channel you are definitely on it. - The script is for undernet, so the ishop check is meaningless. - "if ($nick(%chan, 0, a, vo) > 0)" is pointless. "while $nick($1,%i,r)" includes that.
|
|
|
|
Joined: Dec 2002
Posts: 483
Pan-dimensional mouse
|
OP
Pan-dimensional mouse
Joined: Dec 2002
Posts: 483 |
yezz, pasting into mirc is a problem.. so i past it into wordpad and then into the mirc.. that works nice!
|
|
|
|
|