mIRC Home    About    Download    Register    News    Help

Print Thread
add a delay to rejoin on connect #221609 25/05/10 04:15 PM
Joined: May 2004
Posts: 11
D
Dreadnought Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: May 2004
Posts: 11
add a customizable delay (possibly random as well) to the rejoin channels on connect setting, to allow activation of various automated things (nickserv identification, mainly), and to prevent flooding for multiple, very large, channels

Re: add a delay to rejoin on connect [Re: Dreadnought] #221610 25/05/10 04:41 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Timers are a bad way to handle nickserv auth because you never really know the correct delay. You're better off writing a script for that and joining when you receive the event; that's much more efficient and responsive.

However, delayed join can be useful for people on large amounts of large channels, as this tends to flood them off. In that case, however, you can always use /timer in an ON CONNECT or perform tab (just not in favorites), so it's not really necessary.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: add a delay to rejoin on connect [Re: Dreadnought] #221749 28/05/10 06:42 PM
Joined: Sep 2003
Posts: 30
O
Ook Offline
Ameglian cow
Offline
Ameglian cow
O
Joined: Sep 2003
Posts: 30
use /autojoin -dN for a delay or /autojoin -s to skip joining until a nickserv auth is complete then /autojoin -n to join all channels.

Re: add a delay to rejoin on connect [Re: Dreadnought] #222402 19/06/10 12:59 AM
Joined: Dec 2002
Posts: 339
D
Doomstars Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Dec 2002
Posts: 339
Are we talking about delaying the join command by a given number of seconds? Or are we talking about a slight delay before joining each individual channel?

Re: add a delay to rejoin on connect [Re: Dreadnought] #222439 19/06/10 07:26 PM
Joined: Apr 2010
Posts: 923
F
FroggieDaFrog Offline
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 923
/delayjoin <start-delay> <join-delay> #chan1 [pass][,#chan2 [pass],...]
<start-delay> is the number of seconds to wait before joining channels
<join-delay> is the number of seconds to wait between channel joins

Code:
alias delayjoin {
  if ($1 !isnum || $2 !isnum || (!$3) { echo /delayjoin: invalid parameters }
  else {
    var %delay = $1
    var %x = 1
    while (%x <= $numtok($3,44)) {
      .timer 1 %delay join $!eval( $gettok($3,%x,44) ,0)
      inc %delay $2
      inc %x
    }
  }
}

changed .timer $+ $ticks to .timer
added $!eval( and ,0)

Last edited by FroggieDaFrog; 19/06/10 09:56 PM.

I am SReject
My Stuff
Re: add a delay to rejoin on connect [Re: FroggieDaFrog] #222444 19/06/10 08:08 PM
Joined: Jul 2006
Posts: 3,568
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,568
You should not using $ticks as a timer name, two iterations of the loop could be done without $ticks changing.
Each timer executes one command here, you don't need to name them


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: add a delay to rejoin on connect [Re: FroggieDaFrog] #222448 19/06/10 09:17 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Also note that mIRC will evaluate the command part of a timer.

Example:
/join #$me
vs
/timer 1 1 join #$me

Because #$somehting makes up a valid channel name you have to prevent this evaluation. If you don't, everything from nuisance to exploit is possible... smirk You might use a $safe() alias to prevent that evaluation.

Some time ago, I fiddled with a related request - maybe some parts are of use here as well, like the method to store the name of the channel-to-join not in the timer's command part but in its name.

Re: add a delay to rejoin on connect [Re: Horstl] #222452 19/06/10 10:10 PM
Joined: Apr 2010
Posts: 923
F
FroggieDaFrog Offline
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 923
Originally Posted By: Wims
You should not using $ticks as a timer name, two iterations of the loop could be done without $ticks changing.
Each timer executes one command here, you don't need to name them

Fixed that smile Not sure why i would use ticks when mIRC will auto-name the timers if no name is specified :\
Originally Posted By: Horstl
Also note that mIRC will evaluate the command part of a timer.

Fixed that smile Was 1/2 asleep when i decided to write it.


I am SReject
My Stuff
Re: add a delay to rejoin on connect [Re: Dreadnought] #222737 01/07/10 06:19 PM
Joined: Jul 2006
Posts: 248
B
bwuser Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Jul 2006
Posts: 248
I'm using this to have ability to skip auto[re]joining (put into Perform, All networks)

Code:
/if ($input(Autojoin channels?, k15vy, $$network) == $no) /autojoin -s | /else /autojoin -n