Mass Commands

By Anthrophobic on Sep 18, 2009

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
}

Comments

Sign in to comment.
Anthrophobic   -  Sep 24, 2009

@Phoenix- I only made it cause it was easy and fast. I didn't expect it to get this many comments. xD

 Respond  
Phoenix-   -  Sep 23, 2009

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.

 Respond  
Anthrophobic   -  Sep 23, 2009

I just put together scripts that might help someone. I don't recommend that you use a mass invite, lol but if you want, go for it. Good luck with it.. xD Just thought it might help some people out. Thanks for the comments.

 Respond  
Ghost-writer   -  Sep 22, 2009

phoenix is a fart head :| hey phoenix, check out my theme, it makes you look like server poopoo. But in all seriousness, please do check it out, and il be idling in phoenix soon, you wont even know im their :|.

 Respond  
Jethro   -  Sep 21, 2009

This is foolish to start a drama over a script. I'd even feel stupider afterward if I ever got myself involved in such drivel.

 Respond  
napa182   -  Sep 21, 2009

lol @ mass invite's
should just take the mass invite script out of it. if you have to mass invite people to ur room thats just sad.
anyways keep up the scripting....

 Respond  
sunslayer   -  Sep 21, 2009

what happened to the good old days where you could take your E-rage out on your classmates/friends/loved ones and let interwebz be interwebz?

 Respond  
Phoenix-   -  Sep 21, 2009

Please don't rage against me online. And I did notice you were unbanned after I saw you fail spam #SQL. Anyways, I would rather not look you up because I don't care for you.

Please do not spam Anthrophobic's snippet.

 Respond  
Ghost-writer   -  Sep 21, 2009

hey phoenix dush bag, it was a server ban, and im unbanned now if you didnt know, dark-angel, #dark-world. look me up mother pucker.

 Respond  
FordLawnmower   -  Sep 20, 2009

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 ;/

 Respond  
Phoenix-   -  Sep 20, 2009

@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.

 Respond  
FordLawnmower   -  Sep 20, 2009

$* is undocumented Phoenix-. While I Personally love it, it's not suitable for posting because it could be removed from mIRC in any version change.
It would be great if mIRC finally added documentation for that identifier, but at this point I doubt they ever will.

 Respond  
Phoenix-   -  Sep 20, 2009

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.

 Respond  
gooshie   -  Sep 20, 2009

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) } }
 Respond  
Phoenix-   -  Sep 20, 2009

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) } }
 Respond  
EMMURE   -  Sep 20, 2009

GF

 Respond  
Phoenix-   -  Sep 20, 2009

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.

 Respond  
Jethro   -  Sep 19, 2009

The above example is similar to another one gooshie made. All these mass commands are somewhat alike in context.

 Respond  
gooshie   -  Sep 19, 2009

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 *** }
}
 Respond  
tra_orex   -  Sep 19, 2009

@phoenix, look again at the code, it returns an error unless there is no $1 and $2, so if there is no $1, there is no $2 so all u need is !$2....nice try though

 Respond  
Ghost-writer   -  Sep 19, 2009

hey stupid bird dude, learn msl fool, atm i pitty you. do you know what || means? it means or douche bag, so its 2 if statements in 1. and tbh, the scripting world was good before douche bags like you came, do me a favor. //remove $mircdir. Good day fool.

 Respond  
Testor   -  Sep 19, 2009

Obviously i meant you put the rest of the script in after it ._.

 Respond  
Phoenix-   -  Sep 19, 2009

Oh god, a bunch of idiots surround us all.
@Testor: ... What the hell is that? That doesn't even make any invites at all. I can't even explain how much idiotic that appears.

And tra_orex ... There may be a $1 but not a $2 so it would still return an error.

What has the scripting world come to?

 Respond  
tra_orex   -  Sep 19, 2009

also, whats the point of if (!$1)....if there's no $1, there's no $2

 Respond  
Ghost-writer   -  Sep 19, 2009

lol ^

 Respond  
Testor   -  Sep 19, 2009

Wouldnt Alias massinvite { if ((!$1) || (!$2)) { Echo -a * /Massinvite: insufficient parameters | Halt } }
Make it shorter? :p

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.