This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

while delay

Old posts that have not been replied to for several years.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

while delay

Post by Ofloo »

how do i make a while delay ? for like lets say 15 sec and then go on to the next one .. ?
XplaiN but think of me as stupid
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Re: while delay

Post by strikelight »

Ofloo wrote:how do i make a while delay ? for like lets say 15 sec and then go on to the next one .. ?
See 'after' and/or 'vwait' in the TCL manpages.

or.. alternatively...

Code: Select all

set a [clock seconds]
while {[expr [clock seconds] - $a] < 15} {
# do nothing ...
}
Haven't tested that, but TCL may complain about an empty loop or something of the such... If it does, add something frivelous inside the loop like a 'set b ""' or something.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

Code: Select all

while {$a <= 100} {
}
ok that is it supposed to do but .. tryed what you discripbed could you apply it to that string cause its not working at all no error ..? oh yes i put something in the while of course ;) so that is not it hehe
XplaiN but think of me as stupid
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

If you are looking to perform a delay, use timers.

Placeing your bot into a while loop will result in timer drift errors, and means you bot will not respond while the loop is in action.

If causing continious loops, then you bot may not have chance to respond at all, and very quickly time out.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Ofloo wrote:

Code: Select all

while {$a <= 100} {
}
ok that is it supposed to do but .. tryed what you discripbed could you apply it to that string cause its not working at all no error ..? oh yes i put something in the while of course ;) so that is not it hehe
"$a <= 100" is not TIME.. and inside i assume you are incrementing a.. It takes TCL (and the processor you are executing the code on) alot less than a second to do a math function.. Thus, you NEED the clock expression given to you before. There is nothing to apply, read what I told you in the previous post.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

ive used timers, after, vwait ..and so on ive tryed on using it ive been trying it for 2 days so :/ i can say this it won't work :p,... ill try the cloak thing now altho it looks funny cause:
set a [clock 10]
while {[expr [clock 10] - $a] < 15} {

...
}
witch means 10 - 10 < 15 so if 0 < 15 witch always is .. just wondering how this could create a delayed loop ? if i understand well

and clock from what i can understand from it is to decrypt or convert if you want unixtime to normal time ??? so euhm .. ?

could you plz apply an working example and xplain what it means in human langue ?
XplaiN but think of me as stupid
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Ofloo wrote:ive used timers, after, vwait ..and so on ive tryed on using it ive been trying it for 2 days so :/ i can say this it won't work :p,... ill try the cloak thing now altho it looks funny cause:
set a [clock 10]
while {[expr [clock 10] - $a] < 15} {

...
}
witch means 10 - 10 < 15 so if 0 < 15 witch always is .. just wondering how this could create a delayed loop ? if i understand well

and clock from what i can understand from it is to decrypt or convert if you want unixtime to normal time ??? so euhm .. ?

could you plz apply an working example and xplain what it means in human langue ?
Why did you change [clock seconds] to [clock 10] ???????????????

I gave it to you verbatim of what you were to type.. all you had to change was the '15' ...
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

ok run that by me again so i can see what you mean cause i figured clock seconds .. set it to a change seconds ..?

would be so great full if it just got to work :/

bind dcc - test test:dcc

Code: Select all

proc test:dcc {hand idx arg} {
set a [clock seconds] 
while {[expr [clock seconds] - $a] < 15} { 
  putlog "testing" 
  }
} 
this doesn't do anything (no delay)
XplaiN but think of me as stupid
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

You need to review how you put your logic down in a script.

Your logflke is being flooded with putlog requests.

The while loop is designed to keep looping until 15 seconds have passed. Thus, the putlog command is called as many times as possible until then.

It is very unwise to use the while loop method anyway.

TImers will work, you are obviously using them wring.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

ppslim wrote:You need to review how you put your logic down in a script.

Your logflke is being flooded with putlog requests.

The while loop is designed to keep looping until 15 seconds have passed. Thus, the putlog command is called as many times as possible until then.

It is very unwise to use the while loop method anyway.

TImers will work, you are obviously using them wring.
Some people for some reason or other, sometimes need/want the bot to be unresponsive for an amount of time, which is what I gathered from the initial request. :-?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

In which case a timed removal fo the ignore *!*@* would sufice.

There are other methods too, including a RAW bind that selects only specific messages through (pings and such), until you wish this block removed.

To make a bot unresposive to users is one thing. To make it unresposive to a server is another.

While a bot can qucikly recorver from this kind of blocking, if a line is received that caused it to block again during that time, the bot could quickly be queuring blocks requests after block requests. THis will lead to a PING timeout, which I am guessing they don't want.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

ppslim wrote:In which case a timed removal fo the ignore *!*@* would sufice.

There are other methods too, including a RAW bind that selects only specific messages through (pings and such), until you wish this block removed.

To make a bot unresposive to users is one thing. To make it unresposive to a server is another.

While a bot can qucikly recorver from this kind of blocking, if a line is received that caused it to block again during that time, the bot could quickly be queuring blocks requests after block requests. THis will lead to a PING timeout, which I am guessing they don't want.
If that was the case (although it is possible it isn't the case, as to every rule there is an exception),
Instead of doing all that, with raw binds doing the filtering etc.. etc..
Inside the while loop they could place a simple PING/PONG to the server every x seconds.

But again, as I must stress, the best method depends on what they are truly trying to achieve.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

The PING/PONG would need to be sent through putdccraw, otherwise it would simply ocupy a space in the queue.

As you last post said.

Can we ask what the nature of requiring this sort of pause is for?
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

Now i am realy lost, about what your going on, but i solved it with after, seems like it worked after all ... altho i tryed it like 1000 times before it only had effect just now go figur, stranges [censored] always happens to me lol oh well it works hehe TnX anyway for the trouble realy appriciate it hehe
XplaiN but think of me as stupid
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

I am still interested in why you wish to use a delay in that way.

Is there any specific reason to prevent your bot from reacting to anything? Including partline connands, pings from the IRC server and Pings from other bots.

You are aware that using after will mean that your bot is usless in a protection roll.
Locked