egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Looping of script

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
phreako
Voice


Joined: 20 Jul 2005
Posts: 8

PostPosted: Mon Aug 01, 2005 7:14 pm    Post subject: Looping of script Reply with quote

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
View user's profile Send private message
dwickie
Halfop


Joined: 21 Aug 2004
Posts: 76
Location: /pub/beer

PostPosted: Mon Aug 01, 2005 7:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
phreako
Voice


Joined: 20 Jul 2005
Posts: 8

PostPosted: Mon Aug 01, 2005 7:58 pm    Post subject: Re: Looping of script Reply with quote

Ok thanks a lot!
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber