mIRC Home    About    Download    Register    News    Help

Print Thread
#158739 08/09/06 11:41 PM
Joined: Sep 2006
Posts: 4
S
snjall Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Sep 2006
Posts: 4
I was wondering if anyone could tell me how to make a script that would make many timers at the same time or making it alot faster typing in tons of timers. smile
Fx.
/timer 1 1000 /msg "someone" 10
/timer 1 2000 /msg "someone" 11
/timer 1 3000 /msg "someone" 12
/timer 1 4000 /msg "someone" 13
/timer 1 5000 /msg "someone" 14
and so on.

Joined: Sep 2003
Posts: 261
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2003
Posts: 261
I dunno exactly what your talking about so I'm just going to post this:
Code:
alias timercrazy {
  var %numoftimers = 10
  var %i = 1
  while (%i <= %numoftimers) {
    .timercrazy $+ %i 1 1 msg someone  this is timer %i
    inc %i
  }
}

which returns:
this is timer 1
this is timer 10
this is timer 2
this is timer 3
this is timer 4
this is timer 5
this is timer 6
this is timer 7
this is timer 8
this is timer 9

if you wanted it to trigger each one at a random interval like say anywhere between 1 and 60 seconds:
Code:
alias timercrazy {
  var %numoftimers = 10
  var %i = 1
  while (%i <= %numoftimers) {
    .timercrazy $+ %i 1 $rand(1,60) msg someone this is timer %i
    inc %i
  }
}

which will return each one at random times in timers you don't need the front / for commands within the timer
while loops are fun for this stuff smile.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
It's not possible to literally make more than one timer at a time, since it takes time to make each timer. Now, the amount of time that it takes to make each timer is miniscule (I've never actually tried to measure it), so it can seem like there are multiple timers being started at the same time.

Here's a quick code that will make a number of timers, based on an entry by you.

Code:
 menu * {
Make Timers : make.timer $$?="Number of timers to create"
}
alias make.timer {
var %a = 1, %b = $iif($1 isnum,$1,0)
while %a <= %b {
timer 1 $calc(%a * 1000) msg "someone" $calc(%a + 9)
inc %a
}
}
 


Please note that the reference to "someone" would have to be changed to either a nick, nick identifier, variable containing a nick, channel, channel identifier or variable containing a channel for it to work. Using the above code, literally, will create an error, since "someone" is not a valid option for sending a message.

Joined: Sep 2006
Posts: 4
S
snjall Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Sep 2006
Posts: 4
Thanks for the replys, I tried your code RussleB, put it into aliases. Then I put in how many timers I wanted to make and all I got is "* No active timers". Am I doing something wrong? blush

Joined: Feb 2006
Posts: 181
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2006
Posts: 181
Paste the code in the Remotes.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Crinul got the problem that you're having with the code I gave you in one.

Joined: Sep 2006
Posts: 4
S
snjall Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Sep 2006
Posts: 4
When I paste all the code in remote nothing happens when I write /make timers, I dont even get the window that asks for the input up. I guess I'm doing some silly mistake again confused.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Step by step:
1) Ensure that the code is in it's own remote
2) Right click in a window
3) Select Make Timers
4) Pop-up box should come up requesting number of timers to be made
5) Enter a number in numeric format (eg: 5 not five)

The reason it wasn't working for you, is that the alias is called make.timer not make.

Last edited by RusselB; 10/09/06 06:31 AM.
Joined: Sep 2006
Posts: 4
S
snjall Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Sep 2006
Posts: 4
Thanks alot, got everything working now laugh. Now there is just one more question I got, is there any way for me to let the output be #10,#11,#12 etc. instead of 10,11,12?

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
change the spot where the number is output from
%variable to $+($chr(35),%variable)

I don't know exactly what changes you've made, and this forum won't let me backtrack to previous posts while replying, so that's just a general idea.


Link Copied to Clipboard