Juandiaz Posted September 26, 2014 Share Posted September 26, 2014 (edited) Hi. Well, I would like to know how to add the function to Pausing and restarting the following script. I want when I press pause return everything to normal (in this case "a" = "a") and when I restart the script, press 2 keys at once ("a" = "v 7"). How can i do it?... i tried many ways but nothing happened. Thank you. HotKeySet("{a}", "Press_v_and_7") HotKeySet('{ESC}', '_EXIT') Main() Func Main() While 1 Sleep(1000) WEnd EndFunc Func Press_v_and_7() Send("{v down}") Send("{7 down}") Send("{v up}") Send("{7 up}") Main() EndFunc Func _EXIT() $iMsgBoxAnswer = MsgBox(0, "", "Goodbye") Exit EndFunc Edited September 26, 2014 by Juandiaz Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 26, 2014 Moderators Share Posted September 26, 2014 You could do something like this, as an example. But maybe you can explain more about what you're trying to do. I can guarantee there is a better way of doing it than the Sends and then re-calling Main that you're doing... #include <Misc.au3> _pause() Func _pause() Do Sleep(100) Until _IsPressed(01, 'user32.dll') EndFunc "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Juandiaz Posted September 26, 2014 Author Share Posted September 26, 2014 You could do something like this, as an example. But maybe you can explain more about what you're trying to do. I can guarantee there is a better way of doing it than the Sends and then re-calling Main that you're doing... #include <Misc.au3> _pause() Func _pause() Do Sleep(100) Until _IsPressed(01, 'user32.dll') EndFunc I want when I press pause return everything to normal (in this case when i press the key "a", the key "a" write only "a") and when I restart the script, press 2 keys at once (in this case when i press the key "a" , the key "a" write "v7"). Link to comment Share on other sites More sharing options...
Bert Posted September 26, 2014 Share Posted September 26, 2014 ummm... That is not what we asked you. What we want to know is what application you are working with. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Juandiaz Posted September 26, 2014 Author Share Posted September 26, 2014 Is to use it as a "macro" in a game Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 26, 2014 Moderators Share Posted September 26, 2014 Juandiaz,Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. Please read them now (there is also a link at bottom right of each page) - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts