mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 44
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 44
1. How can I make current script to halt for specific time and then starts again. Some king of "wait" operator.
2. Why the next timer doesn't work ?
Code:
 
set %i 0
timer 10 10 {
 echo -a %i
 inc %i
}  

and all that this echoes is:
0
0
0
etc, etc...

10x


Regards, ThE_mASk.
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Code:
alias myAlias {
  /echo -a Hello
  /wait 5 myalias
}

alias wait {
  .timer 1 $$1 $+(/,$2-)
}


Should work >:D

EDIT: There is a COM object someone made that i believe uses java and takes advantage of the sleep function. Im not sure if its in the forums, but you can check. The only problem with the above statement, is you have to do things in blocks. smirk


-KingTomato
Joined: Jan 2003
Posts: 148
K
Vogon poet
Offline
Vogon poet
K
Joined: Jan 2003
Posts: 148
syntax: timer <how many times an event is gonna happen> <Wait for this amont of seconds> commands

Code:
  
var %i = 0
var %times 10
while (%i &lt; %times) {
.timer 10 10 echo -a %i
 inc %i 
}

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Just as a heads up, the above block of code will happen 100 times. >:\ a loop of ten, with each timer executing 10 times..


-KingTomato
Joined: Jan 2003
Posts: 44
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 44
I think you didn't understood my question...
For example:
I have an dialog with 10 radio buttons, which are unchecked. I want to make a loop which will check them one by one with for example 2 sec. dely between every one until all are checked. And this is why I need this kind of wait operator.
Ex.:
Check Radio no.1
wait 2 sec.
Check Radio no.2
wait 2 sec.
etc. etc.


Regards, ThE_mASk.
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Well what they are telling you is mIRC doesn't have a way to do that so they gave you some work arounds to do it.

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Code:
[color:green]; do not touch[/color]
var %t = 1, %d = 0
[color:green]; modify these[/color]
%delay = [color:blue]2[/color], %radios = [color:Red]id1,id2,id3,id4,etc[/color]
while ($gettok(%radios, %t, 44) != $null) {
  .timer 1 %d /did -c $dname $ifmatch
  /inc %t
  /inc %d %delay
}


EDIT: made the while "!= $null" so for whatever reason if they use id 0 as an id, it will work.


-KingTomato
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
0 is reserved (remember on *:dialog:blah:init:0: ?), you can't use it for a control's ID.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Jan 2003
Posts: 148
K
Vogon poet
Offline
Vogon poet
K
Joined: Jan 2003
Posts: 148
Quote:

Just as a heads up, the above block of code will happen 100 times. >:\ a loop of ten, with each timer executing 10 times..


Yes! Of course... :tongue: My bad! Just wasn`t thinking clearly... hehe... Thanks for the correction! smile

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Thanks for the correction qwerty, I usually use init:*:, so 0 is not touched in most cases. >:D


-KingTomato

Link Copied to Clipboard