Hop/part all channels v1.0

By Lindrian on Jul 03, 2007

All information about the script can be found below in the edit box.

Regards,

Lindrian.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Multi network mass hop/part script. v1.0                                                   ;
; By Lindrian (Firas.dib@gmail.com) (/server -m irc.deltaanime.net -j #l2forever,#Lindrian)  ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Info:                                                                                      ;
; This script will hop/part all channels on all networks. Depending on what youve input.     ;
; It IS multinetwork functional                                                              ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Disclaimer:                                                                                ;
; Lindrian's "Mass hop/part" snippet (/hopall) copyright 2007                                ;
; Lindrian, all rights are reserved by the author                                            ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; How to load and unload                                                                     ;
; Load:                                                                                      ;                                            
; If you place the snippet in a seperated file, type:                                        ;
; /load -rs [path\to]\file.mrc                                                               ;
; Where path\to is optional, incase you are using another folder then mirc default one.      ;
; I used: /load -rs snippets\hopall.mrc                                                      ;
;                                                                                            ;           
; Unload:                                                                                    ;                                              
; Type: /unload -rs file.mrc                                                                 ;
; The commands will work in any window theyre typed in.                                      ;
;                                                                                            ;
; Or if you want to load it into remotes directly.                                           ;
; Press alt + r and paste your code in a NEW .mrc file. Press ok and its done.               ;
; To remove, just open the editor (alt + r) again and delete the snippet.                    ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Usage:                                                                                     ;
; /hopall [-p|-h] $2-                                                                        ;
; The -h switch means HOP (rejoin) and -p part. (leave)                                      ;
; the $2- is if you want to supply a reason                                                  ;
; Example:                                                                                   ;
; /hopall -p Parting all channels! Back in 10 minutes!                                       ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; If you by any chance type to command wrong,                                                ;
; It will give you an error message, supplying how to use the command corretly.              ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

alias hopall {
  if (!$regex($1,/^[\-]?[ph]$/)) { echo -a * /hopall: insufficient parameters | echo -a Use the following syntax: /hopall [-p $chr(124) -h] <reason> (Optional) | return }
  if ($regex($1,/^[\-]?[ph]$/)) { 
    ; These two if's above are to make sure you input the command correctly.
    var %x = 1, %y
    while ($scon(%x)) {
      scon %x
      ; This is where all the networks you are currently on gets checked.
      var %z = 1, %i = $comchan($me,0)
      while (%z <= %i) {
        ; Here, I loop through all your channels on network %x
        ; Im using $comchan($me,%z) because $chan(%z) would return active and inactive channels.
        ; Which means, it would return the channel, even if you are disconnected on the network.
        ; $comchan() does not do that, and i can exclude the "ison" check.
        var %reason = $iif($1 == -p,Parting all channels.,Rejoining all channels), %r = $comchan($me,%z)
        $+(.timer,.,rejoin,.,%r,.,%z) 1 %z $iif($1 == -p,part,hop -c) %r $iif($2-,$2-,%reason)
        ; Above, the variables to shorten the code down are set, and a timer is set for the specefic channel,
        ; to delay and avoid lagging you out too much
        %y = %y %r
        ; This is where all channels are stored, to later calculate respective item from.
        inc %z
      } 
      inc %x
    }
  }
  if ($numtok(%y,32) != 0) { 
    echo -a The script will now $iif($1 == -p,part,rejoin) all your channels. Please give it time to process all your channels on all networks.
    echo -a $numtok(%y,32) channel(s) will be affected. The script will be fully processed in $numtok(%y,32) second(s). 
  }
  ; Here is the main echoing of the script done, supplying sufficient information etc.
  else { 
    echo -a You are currently on 0 channels on all your networks. Nothing will be done! 
  }
}

; Here's the code for the users who wish to get rid of the commented text!

alias hopall {
  if (!$regex($1,/^[\-]?[ph]$/)) { echo -a * /hopall: insufficient parameters | echo -a Use the following syntax: /hopall [-p $chr(124) -h] <reason> (Optional) | return }
  if ($regex($1,/^[\-]?[ph]$/)) { 
    var %x = 1, %y
    while ($scon(%x)) {
      scon %x
      var %z = 1, %i = $comchan($me,0)
      while (%z <= %i) {
        var %reason = $iif($1 == -p,Parting all channels.,Rejoining all channels), %r = $comchan($me,%z)
        $+(.timer,.,rejoin,.,%r,.,%z) 1 %z $iif($1 == -p,part,hop -c) %r $iif($2-,$2-,%reason)
        %y = %y %r
        inc %z
      } 
      inc %x
    }
  }
  if ($numtok(%y,32) != 0) { 
    echo -a The script will now $iif($1 == -p,part,rejoin) all your channels. Please give it time to process all your channels on all networks.
    echo -a $numtok(%y,32) channel(s) will be affected. The script will be fully processed in $numtok(%y,32) second(s). 
  }
  else { 
    echo -a You are currently on 0 channels on all your networks. Nothing will be done! 
  }
}

; eof

Comments

Sign in to comment.
disabledacc   -  Dec 27, 2009
 Respond  
Get_A_Fix   -  Jul 06, 2009

Travis, that may be fine for some, but what about users on a psybnc? :)

 Respond  
TravisT   -  Jun 27, 2009

You may be interested in the /scid -a command...

/scid -a /partall

 Respond  
Get_A_Fix   -  Jun 27, 2009

ikthezeus wrote:

I take it this was built for mIRC ver 6.3 or below?
As I have tried it with 6.31 and I get the following output...
The script will now rejoin all your channels. Please give it time to process all your channels on all networks.
3 channel(s) will be affected. The script will be fully processed in 3 second(s).
23:35:28 Error: Invalid window!
23:35:29 Error: Invalid window!
23:35:30 Error: Invalid window!

Any ideas?

Yes, upgrade your mIRC :)
I tested this on mIRC 6.35 with /hopall -h Rejoining
I was on 6 networks, 34 channels.
It worked fine :)

Thankyou Lindrian

 Respond  
Ikthezeus   -  Apr 16, 2008

Lol....yeah I got that...
I guess I should have said....
Any ideas to get it to work with 6.31? :)

 Respond  
EL   -  Apr 15, 2008

er fuck damn BBcode crap [/quote]**

 Respond  
EL   -  Apr 15, 2008

[quote]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Disclaimer: ;
; Lindrian\'s \"Mass hop/part\" snippet (/hopall) copyright 2007 ;
; Lindrian, all rights are reserved by the author ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Yeah OK...
 Respond  
Ikthezeus   -  Apr 15, 2008

I take it this was built for mIRC ver 6.3 or below?
As I have tried it with 6.31 and I get the following output...
The script will now rejoin all your channels. Please give it time to process all your channels on all networks.
3 channel(s) will be affected. The script will be fully processed in 3 second(s).
23:35:28 Error: Invalid window!
23:35:29 Error: Invalid window!
23:35:30 Error: Invalid window!

Any ideas?
Ik.

 Respond  
xdesoto   -  Jul 07, 2007

heh you really don\'t like people taking credit for your work do you
that\'s a lot of \"introduction\"

 Respond  
Lindrian   -  Jul 07, 2007

hehe thanks lol

 Respond  
xdesoto   -  Jul 07, 2007

Sorry Lindrian
been away college shit
anyways I find this if anything fun to use
nice job

 Respond  
Lindrian   -  Jul 04, 2007

Oh my, not a single reply :<

 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.