Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
timer with a condition
#1
Brick 
Hi, I need help. I want to run a macro with a timer and a condition a condition that after x minutes it will stop and open a function/macro then after the function/macro runs it will return to the first macro. vice versa

-main macro
int t1 = GetTickCount
int t2 = 28*60
rep
,
,if(GetTickCount-t1>=t2) ret
,key z
,key 7
,key 2
,key 3
,key 9
,wait 0.5
,key z
,key 5
,key 4
,key 7
,key 8
,wait 0.5
,key 3
,key 6
,key 4
,key z
,key 2
,wait 0.5
,key 9
,key z
,key 4
,key 7
,key 5
,key 0
,if(GetTickCount-t1==t2)break
,wait 0 H mac("Function1")


-Function/macro

'"o"            ;; "o"
    wait 1.0
lef 685 344 w1 1 ;; ''
    wait 1.0
dou 673 319 w1 1 ;; ''
    wait 2.0
    lef 684 416 w1 1 ;; ''
    wait 10.0
'"o"            ;; "o"
    wait 3.0
lef 672 343 w1 1 ;; ''
mou 672 343 w1 1
MouseWheel -9
    wait 1.0
MouseWheel -9
    wait 1.5
dou 674 444 w1 1 ;; ''
    wait 2.5
lef 674 419 w1 1 ;; ''
    wait 6.0
mou 617 399 w1 1
MouseWheel -1
mou 618 399 w1 1
MouseWheel -1
mou 618 400 w1 1
MouseWheel -26
'"m"            ;; "m"
    wait 3.0
lef 589 329 w1 1 ;; ''
    wait 1.0
    dou 575 588 w1 1 ;; ''
lef+ 576 588 w1 1 ;; ''
mou ":A@"
lef- 577 588 w1 1
lef+ 580 587 w1 1 ;; ''
mou ":A@B@"
    wait 1.0
lef- 583 587 w1 1
lef+ 590 586 w1 1 ;; ''
mou ":A@B@A@A@A@A@A@A@"
lef- 599 586 w1 1
lef+ 604 586 w1 1 ;; ''
mou ":A@BAA@A@A@B@"
lef- 612 587 w1 1
lef+ 644 587 w1 1 ;; '
dou 644 588 w1 1
mou ":A@B@A@"
lef- 648 588 w1 1
    wait 1.0
dou 660 588 w1 1 ;; ''
mou ":a@b@b@b@a@b@"
lef- 650 588 w1 1
lef+ 650 588 w1 1 ;; ''
mou ":a@"
lef- 649 588 w1 1
lef+ 646 588 w1 1 ;; ''
mou "AngryaBaBa"
lef- 650 585 w1 1
lef 654 583 w1 1 ;; ''
dou 575 588 w1 1 ;; ''
lef+ 576 588 w1 1 ;; ''
mou ":A@"
lef- 577 588 w1 1
lef+ 580 587 w1 1 ;; ''
mou ":A@B@"
lef- 583 587 w1 1
lef+ 590 586 w1 1 ;; ''
mou ":A@B@A@A@A@A@A@A@"
lef- 599 586 w1 1
    wait 1.0
lef+ 604 586 w1 1 ;; ''
mou ":A@BAA@A@A@B@"
lef- 612 587 w1 1
lef+ 644 587 w1 1 ;; '
dou 644 588 w1 1
mou ":A@B@A@"
    key 1
lef- 648 588 w1 1
dou 660 588 w1 1 ;; ''
mou ":a@b@b@b@a@b@"
lef- 650 588 w1 1
lef+ 650 588 w1 1 ;; ''
mou ":a@"
lef- 649 588 w1 1
    wait 1.0
lef+ 646 588 w1 1 ;; ''
mou "AngryaBaBa"
lef- 650 585 w1 1
lef 654 583 w1 1 ;; ''
    wait 0.8
    key 1
    wait 0.8
    key 1
    wait 0.8
    key 1
    wait 0 H mac("Macro1")
#endregion
#2
helpame
#3
Hi
Ashrock 
Welcome to the forum!
In order for us to help you  please correct your post so we can see your code correctly.
 In QM, to copy all or selected text, use menu Edit -> Other Formats -> Copy for QM Forum. It copies correct and colored code to the clipboard. Then simply paste in the forum. Don't use the Code button.

read more here


Forum Jump:


Users browsing this thread: 1 Guest(s)