Timer

Post here if you need help using Actiona
Post Reply
Gollbert
Posts: 7
Joined: 07 May 2012, 16:56

Timer

Post by Gollbert »

Hello,

I want to make a variable A to count seconds.
Is there a way to do that?

Thanks in advance
User avatar
Jmgr
Admin
Posts: 1651
Joined: 07 Dec 2005, 15:45
Contact:

Re: Timer

Post by Jmgr »

Hi,

There are multiple ways to do that, the easyest would probably be to create the integer variable A with a Variable action, then use a Loop action and a Pause action to use the current value of A each second. A variable action could then be used to decrement (A = A - 1) the A variable.

It depends on what you are going to do with it.
"My software never has bugs. It just develops random features."
Gollbert
Posts: 7
Joined: 07 May 2012, 16:56

Re: Timer

Post by Gollbert »

I wan to make this action:

1.VarTimeStart = Time(now)
2.VarA = 60sec
3.VarB = 120sec
4.VarTime = Time(now)
5.if VarTime = VarTimeStart + VarA run procedure A else go to next line
6.IF VarTime = VarTimeStart + VarB run procedure B else go to next line
7.do some action
8.do some action
9.VarTime - Time(now)
10.go to line 5

procedure A
do some action
VarA = VarA + 60sec (To have another 60sec)
end procedure A

procedure B
do some action
VarB = VarB + 120sec (To have another 120sec)


What i am trying to do is :

1.Do som action.
2.If 60sec passed do procedure A
3.If 120sec passed do procedure B
4.Continue from 1
User avatar
Jmgr
Admin
Posts: 1651
Joined: 07 Dec 2005, 15:45
Contact:

Re: Timer

Post by Jmgr »

There is no Time Comparison action for now (it is planned), so you will have to use some lines of Javascript code for that.
You could use a Code action for that.

So your action 1. could be a Code action containing

Code: Select all

var start = new Date().getTime();
This gives the current timestamp in milliseconds.

To jump to the procedure you will have to use the label or line number of a procedure call, there is currently no way to call a procedure from code...

Code: Select all

Script.nextLine = 42

Code: Select all

Script.nextLine = "myLabel"
"My software never has bugs. It just develops random features."
Post Reply