Kraviks Posted September 1, 2014 Share Posted September 1, 2014 ok, I got this so far. However, I need to know how to stop a macro in the middle of everything. How do I add breaks after each MouseUp so if I release the hotkey, it will not continue to play out the script. expandcollapse popup#include <GUIConstantsEx.au3> #include <Misc.au3> $hGUI = GUICreate("Testing", 300, 160) $idCheckbox1 = GUICtrlCreateRadio("Hold Down Right Mouse", 10, 10, 125, 25) $idCheckbox2 = GUICtrlCreateRadio("Hold Down Left Mouse", 10, 30, 125, 25) $idClose = GUICtrlCreateButton("Close", 210, 130, 85, 25) GUISetState() While 1 _Run() Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idClose ExitLoop EndSwitch WEnd Func _Run() If _IsPressed("5A") Then If _IsChecked($idCheckbox1) Then Do MouseDown("Right") Sleep(500) MouseUp("Right") Sleep(500) MouseDown("Right") Sleep(500) MouseUp("Right") Sleep(500) MouseDown("Right") Sleep(500) MouseUp("Right") Sleep(500) MouseDown("Right") Sleep(500) MouseUp("Right") Sleep(500) Until not _IsPressed("5A") EndIf If _IsChecked($idCheckbox2) Then Do MouseDown("Left") Sleep(500) MouseUp("Left") Sleep(500) Until not _IsPressed("5A") EndIf EndIf EndFunc Func _IsChecked($idControlID) Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED EndFunc ;==>_IsChecked Link to comment Share on other sites More sharing options...
computergroove Posted September 1, 2014 Share Posted September 1, 2014 (edited) HotKeySet("{PAUSE}", "TogglePause") Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',350,0) WEnd ToolTip("") EndFunc Insert: send("{PAUSE}") where you want the script to stop. Press the paused key to continue. Your code looks a little bit messy. If I understood what you were trying to do I could better tell you what to do. If you want the script to pause after a mouseup event then I would use msgbox. Edited September 1, 2014 by computergroove Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 1, 2014 Moderators Share Posted September 1, 2014 Kraviks,I do not appreciate you opening a new thread when I have just locked your previous one on the same subject. And as for sending me a PM explaining that "it was only for learning" - how many times have I heard that one. Consider yourself lucky that I am not sanctioning you - but do NOT open a third thread on this matter. M23 Draygoes 1 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