Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (Grant), 999 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
SECONDS in counter [SOLVED] #339765
08/29/10 07:54
08/29/10 07:54
Joined: May 2009
Posts: 5,365
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,365
Caucasus
I have simple countdown script like this:
Code:
var counter = 100;

function countdown()
{
	while(1)
	{
		counter -= 0.5 * time_step;
		counter = clamp(counter,0,100);
		wait(1);
	}
}


But how can I decrease counter var each second?

Last edited by 3run; 08/29/10 09:08.

Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: SECONDS in counter [Re: 3run] #339767
08/29/10 08:03
08/29/10 08:03
Joined: Sep 2009
Posts: 496
P
Progger Offline
Senior Member
Progger  Offline
Senior Member
P

Joined: Sep 2009
Posts: 496
It should work like this
var counter = 100;

function countdown()
{
while(1)
{
counter = clamp(counter,0,100);
counter -= 1;

wait(-1);
}
}
WFG Progger

Last edited by Progger; 08/29/10 08:04.

asking is the best Way to get help laugh laugh laugh

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1