Global Channel Hop /GHopall

By Damsulegna on Apr 18, 2007

This snippet will part and rejoin all channels on ALL servers, option to specify a part message (Cycling All Channels if not specified).
To add this: Open mIRC editor (ALT + O)
Click FILE > NEW
Paste Code into new file. Click OK.

Usage:
/GHopall
or
/GHopall Message

NOTE: amended as per comments (Thanks guys / gals)

alias ghopall {
  var %y = 1
  while (%y <= $scid(0)) {
    scon %y
    var %totalchans = $chan(0)
    while (%totalchans) && ($scon(%y).status == connected) {
      hop -c $chan(%totalchans) $iif($1-,$1-,Cycling All Channels)
      dec %totalchans
    }
    inc %y 
  }
}

Comments

Sign in to comment.
RusselB   -  Dec 31, 2009

I suspect, though am not positive, that the Invalid window error is being generated due to the cross usage of $scid and $scon.

Thus said, and my apologies to the owner of this script, those looking for an alternative might want to consider [url=http://www.hawkee.com/snippet/5366/]this[/url

 Respond  
disabledacc   -  Dec 27, 2009
 Respond  
Dragon1-9-8-4   -  Nov 20, 2008

it doesnt work dude i kept getting this message --->error:invalid window

 Respond  
xredxthornsx   -  Oct 11, 2007

To add this: Open mIRC editor (ALT + O)
Click FILE > NEW
Paste Code into new file. Click OK.

replace with

To add this: Open mIRC script editor (ALT + R)
Click FILE > NEW
Paste Code into new file. Click OK.

 Respond  
Damsulegna   -  Apr 22, 2007

Appreciate the comments, amended accordingly

while (%totalchans) && ($scon(%y).status == connected) {

note: It never occurred to me to check connection status.... narrow vision lol.

 Respond  
xDaeMoN   -  Apr 21, 2007

A simple fix for what Russelb said would be checking the status of the connection using \"$scon(N).status\", then if the status is disconnected increment the variable to go to the next connection.

 Respond  
RusselB   -  Apr 21, 2007

Recommendation: Change from a while loop going through the SCID\'s, to using /scon -at1

If you connect to Network 1, Network 2, Network 3, Network 4
then disconnect from Network 2
the CID value for Network 2 is still recognized in $scid(0)
so you would try to do a /scon to a connection ID that isn\'t connected.

 Respond  
Damsulegna   -  Apr 19, 2007

Glad someone found it useful. Have so many snippets i use never really occurred to share them.

 Respond  
peterpowell   -  Apr 18, 2007

thanks Damsulegna,

/me adds this to his bot :D

 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.