shutting down macro with keydown

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Nagarules
Junior Coder
Posts: 24
Joined: Tue Nov 21, 2006 9:33 pm

shutting down macro with keydown

Post by Nagarules » Wed Nov 22, 2006 6:16 pm

Whats the command to shutdown the macro?

I wanna do

OnEvent>Key.........,shutdown

srt>shutdown
[shutdown program command]
end>shutdown


i cant find the command.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Nov 22, 2006 6:25 pm

If by "Shutdown macro" you mean you just want the macro to end, then just do:

Code: Select all

OnEvent>KEY_DOWN,VK115,0,Shutdown

SRT>Shutdown
  Goto>end_macro
END>Shutdown

//Right at VERY end of macro put:
Label>end_macro
So all it does is jump right to the end of the macro.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Nagarules
Junior Coder
Posts: 24
Joined: Tue Nov 21, 2006 9:33 pm

:/

Post by Nagarules » Wed Nov 22, 2006 6:43 pm

im having problems with my script... it doesnt always read the keydown :/

SRT>shutdown
Press Shift
Press Esc
End>shutdown

i do this btw :O.

and it doesnt always read my keydown :/ only someitmes... in my previous thread someone said i need to make it look for a keydown or something?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Nov 22, 2006 6:48 pm

It will depend what your script is doing. Depending on how much work it is doing, any waits, any tight loops etc, will effect how quickly it is able to respond to a keystroke.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Nagarules
Junior Coder
Posts: 24
Joined: Tue Nov 21, 2006 9:33 pm

tt

Post by Nagarules » Wed Nov 22, 2006 9:45 pm

If by tight loops you mean ones with little "wait's" in between action then no.. it isnt a tight loop.

the "main loop" i want it to work with is this:

Label>start
Wait>3
MouseMove>393,167
Wait>1
LClick
WaitPixelColor>0x0F89B5,601,11,15
If>{%WPC_RESULT%=False}
MouseMove>486,453
Wait>1
LClick
Goto>start
EndIf


thats the most important part... i dont understand why it doesnt always work :/

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Nov 22, 2006 9:58 pm

The keystroke can't be processed during the Wait statements or WaitPixelColor - which could take any amount of time to complete.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Nagarules
Junior Coder
Posts: 24
Joined: Tue Nov 21, 2006 9:33 pm

:/

Post by Nagarules » Wed Nov 22, 2006 10:10 pm

:/ so what can i do :(?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Nov 22, 2006 10:11 pm

To stop the macro? Press SHIFT-ESC. Or configure a different key sequence in tools/options.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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