i search an rehash script

These are old archives. They are kept for historic purposes only.
Post Reply
X-Trancer
Posts: 34
Joined: Mon Mar 08, 2004 5:24 am

i search an rehash script

Post by X-Trancer »

i search a rehash script for rehashin all server on 1 command

/rehashall
aquanight
Official supporter
Posts: 862
Joined: Tue Mar 09, 2004 10:47 pm
Location: Boise, ID

Post by aquanight »

Code: Select all

alias rehashall {
  if (!(o isin $usermode)) {
    echo -stc info * Rehashing all servers usually requires Global Operator priviliges.
    return
  }
  echo -stc info * Rehashing all servers...
  .enable #rehashall
  .links
}
#rehashall off
raw 364:*:{
  echo -stc info * Trying Rehash on $2 $+ ...
  rehash $2
}
raw 365:*:{
  echo -stc info * End /REHASHALL
  disable #rehashall
}
#rehashall end
(Just because I feel like explaining it...)
The alias bit defines /rehashall which first checks if you're at least a global operator (you have umode +o). If not, it prints an error and quits, since only global operators can remote rehash. If you are a global operator, it starts the process by enabling the two raw events below and doing /links. Raw 364 is RPL_LINKS which is the numeric that transports the replies in a LINKS list. When a links reply is received, a rehash is issued for that server. Raw 365 is RPL_ENDOFLINKS which indicates the end. The script outputs a message indicating such, and disables the raw events to prevent them from triggering when you aren't rehashing everything.
jewles
Posts: 263
Joined: Thu Mar 11, 2004 7:41 pm
Location: Herndon, VA

rehashall

Post by jewles »

cool, I was actually looking for something like this... but I don't know enought about coding to do anything with the code... provided in the last post... If anyone would like to assist me... I'd be most gracious :)...
lord2800
Posts: 22
Joined: Sun Mar 07, 2004 3:49 am
Location: root: /dev/null

Post by lord2800 »

I wouldn't have been able to come up with something that complex. I probably would've hardcoded the whole thing. My hat's off to you.
X-Trancer
Posts: 34
Joined: Mon Mar 08, 2004 5:24 am

Post by X-Trancer »

cool thank you verry match
aquanight
Official supporter
Posts: 862
Joined: Tue Mar 09, 2004 10:47 pm
Location: Boise, ID

Re: rehashall

Post by aquanight »

jewles wrote:cool, I was actually looking for something like this... but I don't know enought about coding to do anything with the code... provided in the last post... If anyone would like to assist me... I'd be most gracious :)...
All you do is copy-paste this into the Remote tab in the mIRC Script Editor. Then type /rehashall in any window belonging to a server on which you are a Global Operator and press Enter to watch every server get rehashed.

IIRC, you'll only see rehash replies from the local server. Remote rehashes don't send status messages (like "Configuration loaded without problems, etc).
X-Trancer
Posts: 34
Joined: Mon Mar 08, 2004 5:24 am

Post by X-Trancer »

Code: Select all

IIRC, you'll only see rehash replies from the local server. Remote rehashes don't send status messages (like "Configuration loaded without problems, etc).[list]

This is normal ev have Agrywolf a module to remote rehash[/list]
Post Reply