How cam make an action when the macro finish?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
luca1974wow
Newbie
Posts: 15
Joined: Sat Dec 12, 2009 11:20 pm

How cam make an action when the macro finish?

Post by luca1974wow » Tue May 10, 2011 2:32 pm

OnEvent>Key_Down,VK119,0,MainMacro
SRT>MainMacro

send>XXX


END>MainMacro
Label>IdleLoop
Wait>0.01
Goto>IdleLoop


Whit this macro when i press F8 the computer send XXX
i need when i stop press F8 the computer move the mouse at

MouseMove>220,30

Can anyone help me please?

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue May 10, 2011 3:22 pm

Set a variable "flag" to tell the script when you've stopped pressing the key.

Code: Select all

OnEvent>Key_Down,VK119,0,MainMacro
Let>F8Flag=0
SRT>MainMacro
  send>XXX
  Let>F8Flag=1
END>MainMacro
Label>IdleLoop
  Wait>0.01
  If>F8Flag>0
    Add>F8Flag,1
    If>F8Flag>10
      Let>F8Flag=0
      MouseMove>220,30
    EndIf
  EndIf
Goto>IdleLoop

luca1974wow
Newbie
Posts: 15
Joined: Sat Dec 12, 2009 11:20 pm

Post by luca1974wow » Tue May 10, 2011 4:30 pm

Thanks

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts