Post by mats on Apr 22, 2021 6:53:11 GMT
Good day
I'm trying to create a macro that runs as a loop infinitely (from LOOP_START to line 15) but during the night and at least once every day it should go to line STANG_FONSTER and then go back to LOOP_START and so on.
My problem is to get the "if hour equals to xx then to go line yy" working. I tried using the current hour as a string value and if this equals to 03 then go to STANG_FONSTER but this doesn't work for me. There is probably some better idea to have an "if then action" to run once a day at a certain time.
Current macro:
* | LOOP_START
1 | RUN ACTION | WAIT SECONDS | 5
2 | IF NOT | WINDOW TITLE | Daglig styrning | EXIST | MESSAGE PROMPT | Fönstret "Daglig styrning" hittas inte. | AND | 3 | RUN ACTION | STOP
3 | IF | WINDOW TITLE | Daglig styrning | EXIST | SELECT WINDOW BY NAME | Daglig styrning
4 | RUN ACTION | DEFINE STRING VARIABLE | %STRING%::%TIME_H%
5 | IF | STRING VARIABLE | %STRING% | IS | 03 | GOTO MACRO LINE | STANG_FONSTER
6 | 500 | 883 | 1251 | Keypress escape
7 | RUN ACTION | WAIT SECONDS | 1
8 | 20 | 172 | 7797 | Left Click Down
9 | 20 | 172 | 16 | Left Click Release
10 | RUN ACTION | WAIT SECONDS | 1
11 | 20 | 128 | 4594 | Left Click Down
12 | 20 | 128 | 47 | Left Click Release
13 | 1919 | 0 | 10 | Mouse movement
14 | RUN ACTION | WAIT SECONDS | 300
15 | RUN ACTION | GOTO MACRO LINE | LOOP_START
* | STANG_FONSTER
16 | 500 | 883 | 1251 | Keypress escape
17 | RUN ACTION | WAIT SECONDS | 2
18 | 1909 | 20 | 3422 | Left Click Down
19 | 1909 | 20 | 140 | Left Click Release
20 | RUN ACTION | WAIT SECONDS | 2
21 | 103 | 69 | 9297 | Left Click Down
22 | 103 | 69 | 140 | Left Click Release
23 | RUN ACTION | WAIT SECONDS | 2
24 | 84 | 154 | 7281 | Left Click Down
25 | 84 | 154 | 78 | Left Click Release
26 | RUN ACTION | WAIT SECONDS | 2
27 | 20 | 131 | 9531 | Left Click Down
28 | 20 | 131 | 47 | Left Click Release
29 | RUN ACTION | GOTO MACRO LINE | LOOP_START
Would appreciate some guidance here!
Thanks, Mats
I'm trying to create a macro that runs as a loop infinitely (from LOOP_START to line 15) but during the night and at least once every day it should go to line STANG_FONSTER and then go back to LOOP_START and so on.
My problem is to get the "if hour equals to xx then to go line yy" working. I tried using the current hour as a string value and if this equals to 03 then go to STANG_FONSTER but this doesn't work for me. There is probably some better idea to have an "if then action" to run once a day at a certain time.
Current macro:
* | LOOP_START
1 | RUN ACTION | WAIT SECONDS | 5
2 | IF NOT | WINDOW TITLE | Daglig styrning | EXIST | MESSAGE PROMPT | Fönstret "Daglig styrning" hittas inte. | AND | 3 | RUN ACTION | STOP
3 | IF | WINDOW TITLE | Daglig styrning | EXIST | SELECT WINDOW BY NAME | Daglig styrning
4 | RUN ACTION | DEFINE STRING VARIABLE | %STRING%::%TIME_H%
5 | IF | STRING VARIABLE | %STRING% | IS | 03 | GOTO MACRO LINE | STANG_FONSTER
6 | 500 | 883 | 1251 | Keypress escape
7 | RUN ACTION | WAIT SECONDS | 1
8 | 20 | 172 | 7797 | Left Click Down
9 | 20 | 172 | 16 | Left Click Release
10 | RUN ACTION | WAIT SECONDS | 1
11 | 20 | 128 | 4594 | Left Click Down
12 | 20 | 128 | 47 | Left Click Release
13 | 1919 | 0 | 10 | Mouse movement
14 | RUN ACTION | WAIT SECONDS | 300
15 | RUN ACTION | GOTO MACRO LINE | LOOP_START
* | STANG_FONSTER
16 | 500 | 883 | 1251 | Keypress escape
17 | RUN ACTION | WAIT SECONDS | 2
18 | 1909 | 20 | 3422 | Left Click Down
19 | 1909 | 20 | 140 | Left Click Release
20 | RUN ACTION | WAIT SECONDS | 2
21 | 103 | 69 | 9297 | Left Click Down
22 | 103 | 69 | 140 | Left Click Release
23 | RUN ACTION | WAIT SECONDS | 2
24 | 84 | 154 | 7281 | Left Click Down
25 | 84 | 154 | 78 | Left Click Release
26 | RUN ACTION | WAIT SECONDS | 2
27 | 20 | 131 | 9531 | Left Click Down
28 | 20 | 131 | 47 | Left Click Release
29 | RUN ACTION | GOTO MACRO LINE | LOOP_START
Would appreciate some guidance here!
Thanks, Mats