
-----------------------------------
Mr. T
Sun Jan 30, 2005 3:52 pm

Delays
-----------------------------------
How do you cancel a delay?

-----------------------------------
Neo
Sun Jan 30, 2005 3:59 pm


-----------------------------------
What do you mean cancel? :? 
If you mean take out the delay while the program is running then you could put the delay inside an if statement.

-----------------------------------
Mr. T
Sun Jan 30, 2005 4:08 pm


-----------------------------------
ya sorry, can u give me an example of using an if statement to stop a delay?

-----------------------------------
basketball4ever
Sun Jan 30, 2005 4:16 pm


-----------------------------------
ya sorry, can u give me an example of using an if statement to stop a delay?

hmm... why would you want a delay to stop.  You can set the delay right... so why would you want it to stop while the program in running... can you give like a piece of code so i can see what you're trying to do

-----------------------------------
person
Sun Jan 30, 2005 4:25 pm


-----------------------------------
u can probably do:

if (something) then
x := 0
end if
delay (x)

-----------------------------------
Mr. T
Sun Jan 30, 2005 4:38 pm


-----------------------------------
ya sorry, can u give me an example of using an if statement to stop a delay?

can you give like a piece of code so i can see what you're trying to do



delay (10)
cls
delay (0)


-----------------------------------
basketball4ever
Sun Jan 30, 2005 4:45 pm


-----------------------------------
k ...
so
% all your code before that
var num:int
get num
if num >10 then
delay(10)
%you don't need an else delay (0) cos... thats like  :? :P
end if

that should work fine.

-----------------------------------
Cervantes
Sun Jan 30, 2005 4:51 pm


-----------------------------------
Is this inside a loop?  If so, chances are you should only have one delay.

-----------------------------------
[Gandalf]
Mon Jan 31, 2005 5:33 pm


-----------------------------------
How about this question:
How would you let the user input something while a delay is running?

-----------------------------------
Cervantes
Mon Jan 31, 2005 5:50 pm


-----------------------------------
You don't.  A delay is like getch: it halts the program until it's done.  So, while the delay is on, the program is halted.  Thus, you can't be running an Input.KeyDown line while the delay is on.

-----------------------------------
1337_brad
Mon Jan 31, 2005 6:31 pm

But...
-----------------------------------
But a get statement would do the trick... it would delay until the user inputs a value.. or if you need the delay set to a specific time you could have the get statement and then the delay like so:
 
var theget : string


put "enter something here"
get theget
Time.Delay(10)


-----------------------------------
ssr
Mon Jan 31, 2005 8:37 pm


-----------------------------------
How about just hasch
however, I got a question
ok how would u like enter a cheat while the program is running
like you can make teh program run
but if u enter something, it wont show, but it will print do the cheat after the code is fully entered

-----------------------------------
1337_brad
Mon Jan 31, 2005 9:23 pm

You would have to...
-----------------------------------
Do it with processes... and then fork them, so that the game, and the getcheat command can run at the same time...

-----------------------------------
ssr
Mon Jan 31, 2005 9:31 pm


-----------------------------------

Do it with processes... and then fork them, so that the game, and the getcheat command can run at the same time...
oh ya Thanx man, 1337_brad
helped out a lot

-----------------------------------
basketball4ever
Mon Jan 31, 2005 10:41 pm


-----------------------------------

Do it with processes... and then fork them, so that the game, and the getcheat command can run at the same time...
oh ya Thanx man, 1337_brad
helped out a lot

do note that processes will cause alot of trouble.... you might wanna stay away from em... if i were you, i would just use a cheat menu...

-----------------------------------
Bacchus
Mon Jan 31, 2005 11:10 pm


-----------------------------------
you could try something like this:
proc d(time:int)
    var t:int:=Time.Elapsed
    loop
        exit when Time.Elapsed-t >= time
        %stick whatever else you want in here
    end loop
end d dunno about that might work, who knows :P

-----------------------------------
[Gandalf]
Tue Feb 01, 2005 12:19 pm


-----------------------------------
I don't know if you already know this, but you would also need something like this so that what the user types doesn't show up on the screen.

setscreen("nocursor,noecho")

-----------------------------------
Bacchus
Tue Feb 01, 2005 3:54 pm


-----------------------------------
you only need noecho if your using getch so that it wont show then
