A set of alias commands that are for channel use.
Mass Voice/Op
Mass Invite
;Mass Voice/Op
;Scriptor : Anthrophobic
;Purpose : Mass Voice/Op users in a channel.
;Network : irc.conflictirc.net
;Channels : #BNC
;Email : anthrophobic@conflictirc.org
alias mass {
if ($me isop $chan) {
if ($1 isin +vvoice) { set %prefix $+(+,$str(v,$modespl)) | goto start }
if ($1 isin -vdevoice) { set %prefix $+(-,$str(v,$modespl)) }
if ($1 isin +oop) { set %prefix $+(+,$str(o,$modespl)) | goto start }
if ($1 isin -odeop) { set %prefix $+(-,$str(o,$modespl)) }
:start
set %massing $nick($chan,0)
while (%massing) {
if ($nick($chan,%massing) != $me) { set %mass1 %mass1 $nick($chan,%massing) }
if ($gettok(%mass1,0,32) = $modespl) { mode $chan %prefix %mass1 | unset %mass1 }
dec %massing
}
mode $chan %prefix %mass1 | unset %mass1
}
else { echo -a *** Error you're not an op on $chan *** }
}
;Mass Invite
;Scriptor : Anthrophobic
;Purpose : Send every user in a channel a invite to a different room.
;Network : irc.conflictirc.net
;Channels : #BNC
;Email : anthrophobic@conflictirc.org
alias massinvite {
if ( !$1 ) {
echo -a * /massinvite: insufficient parameters
halt
}
if ( !$2 ) {
echo -a * /massinvite: insufficient parameters
halt
}
set %nicks 1
while ( %nicks <= $nick($1,0) ) {
invite $nick($1,%nicks) $2
inc %nicks
}
unset %nicks
halt
}
Termz: I still don't care enough about you. Sorry. I would also know if you were idling there... Sorry to disappoint.
Anthrophobic: I could see only one reason why a mass invite would be acceptable is if you were to transfer your users from one channel to another in case you don't +lL 1 #channel2 or in case they don't rejoin on kick so they won't go to the linked channel.
Well something needs to replace the while loop because it sucks ;/ I use goto instead when I have to loop more than 100 times but it sucks too. Since $* will only work in a limited number of situations it won't be able to replace it, but I would love to see it enhanced.
A while loop that freezes your computer is stupid ;/
@FordLawnmower: I'm sure they will at some point due to the usage of it and I'm sure if it was then it would be seen in a lot more scripts than before because it could replace a while loop in a lot of different things if you didn't want to loop something.
If anyone does use it though & Khaled doesn't place it in then the script can have a message stating its of no use from this version and above.
Ah, yes... Of course. I've gotten confused with all these 1's and 2's so if ($2) would be right.
But I used the $chr(3),12, because most people don't understand you have to place the color code in there but thats interesting that its /echo color ... Funny how long I've scripted and didn't even notice that.
While loop is easier and takes fewer bytes and the end result
would be looping no matter the method.
if ($1 && $2) could be if $2
echo -a $+($chr(3),12, /massinvite: insufficient parameters)
could be
echo 12 -a /massinvite: insufficient parameters
alias massinvite { if $2 { var %i 1 | while $nick($1,%i) { echo # invite $v1 $2 | inc %i } } | else { echo 12 -a * /massinvite: insufficient parameters) } }
Honestly, when I look at it, thats a poor way to do it still.
alias massinvite { if ($1 && $2) { var %x $nick($1,0) | while (%x) { invite $nick($1,%x) $2 | dec %x } } | else { echo -a $+($chr(3),12,* /massinvite: insufficient parameters) } }
Thats better.
But then... Why use a while loop?
alias massinvite { if ($1 && $2) { var %1 $1,%2 $2 | tokenize 32 $regsubex($str(~,$nick(%1,0)),/./g,$+($nick(%1,\n),$chr(32))) | invite $* %2 } | else { echo -a $+($chr(3),12,* /massinvite: insufficient parameters) } }
Hello Termz, how is your gline going? Excellent.
Example: /massinvite #Channel1
There is no $2 but there is a $1.
Example: /massinvite
There is no $1 or $2 so !$1 may be used.
Or we could just write it like this...
alias massinvite { if ($1 && $2) { set %nicks 1 | while (%nicks <= $nick($1,0)) { invite $nick($1,%nicks) $2 | inc %nicks } | unset %nicks | halt }
else { echo -a $+($chr(3),12,* /massinvite: insufficient parameters) } }
So much easier, don't you agree?
Oh and yes of course I know what || means. I mean come on... I've been scripting for a lot longer than you, unlike how you've leeched oh-so many scripts from this website then took it as your own.
Ah, aren't you cute tra_orex. Quite cute.
Eliminated set %variables, goto jump, and one mode command line
alias mass {
if ($me isop #) {
var %i 1,%p,%m $modespl,%mass
if ($1 isin +vvoice) { %p = $+(+,$str(v,%m)) }
elseif ($1 isin -vdevoice) { %p = $+(-,$str(v,%m)) }
elseif ($1 isin +oop) { %p = $+(+,$str(o,%m)) }
elseif ($1 isin -odeop) { %p = $+(-,$str(o,%m)) }
while $nick(#,%i) {
if ($v1 != $me) { %mass = %mass $v1 }
if ($gettok(%mass,0,32) = %m) || ($nick(#,0) = %i) {
mode # %p %mass
%mass = ""
}
inc %i
}
}
else { echo -a *** Error you're not an op on $chan *** }
}