| View previous topic :: View next topic |
| Author |
Message |
phreako Voice
Joined: 20 Jul 2005 Posts: 8
|
Posted: Mon Aug 01, 2005 7:14 pm Post subject: Looping of script |
|
|
Looping with numbers
Lets say $variable is 5.
So I want a command to set a timer 5 times according to $variable and it goes something like this,
1st time: utimer 5 doproc
2nd time: utimer 10 doproc
3rd time: utimer 15 doproc
4th time: utimer 20 doproc
5th time: utimer 25 doproc
So it could be like $variable is 10 times and it can go on to 10th time, each time increasing 5 seconds. How do I go about coding it? |
|
| Back to top |
|
 |
dwickie Halfop
Joined: 21 Aug 2004 Posts: 76 Location: /pub/beer
|
Posted: Mon Aug 01, 2005 7:57 pm Post subject: |
|
|
| Code: |
set variable 5
for {set i 1} {$i <= $variable} {incr i} {
utimer [expr 5*$i] doproc
}
|
this should work, if i get what you want
edit: you probably wanted to do 5min steps $variable times, so i edited
Last edited by dwickie on Mon Aug 01, 2005 8:01 pm; edited 2 times in total |
|
| Back to top |
|
 |
phreako Voice
Joined: 20 Jul 2005 Posts: 8
|
Posted: Mon Aug 01, 2005 7:58 pm Post subject: Re: Looping of script |
|
|
| Ok thanks a lot! |
|
| Back to top |
|
 |
|