Jump to content
  1. Exit

    Exit

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Gianni
      I'm trying to drive a command prompt by sending instructions via a NamedPipe.
      This way you can (should) be able to send commands to the command prompt and at the same time "view" the result in the same window.
      This is not allowed if you run a command prompt with "opt_flag" parameters (redirected streams) because this will disable StdOut on the cmd itself.
      This small (trivial) snippet works for the first command sent to the cmd, but further submissions will fail.
      Maybe the problem is in how I use the run () command to start a new cmd with the StdIn redirect from the NamedPipe. It seems that the generated cmd will close automatically after the first reception of the command via NamedPipe.
      suggestions on how to make it work are welcome
      thanks
      #include <NamedPipes.au3> #include <WinAPI.au3> ; Creates an instance of a named pipe Global $sPipeName = "\\.\pipe\pipename" Global $hPipe = _NamedPipes_CreateNamedPipe($sPipeName, 1, 1) MsgBox(0, "Debug", "Pipe created. Now open a CMD") ; run a cmd with only StdIn redirected (StdIn data incoming from a pipe) Global $hCMD = Run(@ComSpec & " /K cmd < " & $sPipeName & @CRLF, "c:\") ; ok? MsgBox(0, "Debug", "now Send a command to the cmd via a NamedPipe") _StdInPipeWrite("dir" & @CRLF) MsgBox(0, 'Debug', "further commands will fail" & @CRLF & "now send command 'dir c:\windows'") $sMessage = "Dir c:\windows" & @CRLF _StdInPipeWrite($sMessage) MsgBox(0, 'Debug', "send another command (will also fail)" & @CRLF & "now send command 'echo Hello'") _StdInPipeWrite("echo Hello" & @CRLF) MsgBox(0, "Debug", "end of test") ProcessClose($hCMD) Func _StdInPipeWrite($sMessage) ; =============================================================================================================================== ; This function writes a message to the pipe ; =============================================================================================================================== Local $iWritten, $iBuffer, $pBuffer, $tBuffer $iBuffer = StringLen($sMessage) + 1 $tBuffer = DllStructCreate("char Text[" & $iBuffer & "]") $pBuffer = DllStructGetPtr($tBuffer) DllStructSetData($tBuffer, "Text", $sMessage) If Not _WinAPI_WriteFile( _ $hPipe, _ ; ...... Handle to the file to be written $pBuffer, _ ; .... Pointer to the buffer containing the data to be written $iBuffer, _ ; .... Number of bytes to be written to the file $iWritten, _ ; ... The number of bytes written 0 _ ; ............ [optional] A $tagOVERLAPPED structure or a pointer to it ) Then ConsoleWrite("WriteMsg: _WinAPI_WriteFile failed" & @CRLF & _WinAPI_GetLastErrorMessage()) Else ConsoleWrite("WriteMsg: write OK" & @CRLF & _WinAPI_GetLastErrorMessage() & @CRLF) EndIf EndFunc ;==>_StdInPipeWrite  
    • By HankHell
      I know this is a common thing people seem to ask for on the forums. And I was bored so I made this for those that wish to make their own macros on the fly.
      #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: HankHell Script Function: Macro Maker 1.10 #ce ---------------------------------------------------------------------------- #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <AutoItConstants.au3> #include <Misc.au3> #include <GUIListBox.au3> #include <GuiComboBox.au3> Global $Form1 Global $CoordFinderButton1 Global $CoordFinderButton2 Global $CoordFinderButton3 Global $CoordFinderButton4 Global $Create Global $State = 1 Global $FindCoords = 0 Global $SwapState = 0 ;--------------------- Global $GetStartStop Global $GetStartStopNew = "{F1}" ;F1 to toggle the macro on/off Global $GUIOpen Global $GUIOpenNew = "{HOME}" ;HOME opens the GUI back up Global $GetEnd Global $End_Program_New = "{END}" ;END (near Home, PageUp) to close the program ;--------------------- Global $LeftClickA = "" Global $LeftClickB = "" Global $LeftClickC = "" Global $LeftClickD = "" Global $RightClickA = "" Global $RightClickB = "" Global $RightClickC = "" Global $RightClickD = "" ;--------------------- Global $PressKeyA = "" Global $PressKeyB = "" Global $PressKeyC = "" Global $PressKeyD = "" ;--------------------- Global $KeysToSendA = "" Global $KeysToSendB = "" Global $KeysToSendC = "" Global $KeysToSendD = "" Global $SendKeysToSendA = "" Global $SendKeysToSendB = "" Global $SendKeysToSendC = "" Global $SendKeysToSendD = "" ;--------------------- Global $SleepTimeA = "" Global $SleepTimeB = "" Global $SleepTimeC = "" Global $SleepTimeD = "" Global $SleepySleepTimeA = 0 Global $SleepySleepTimeB = 0 Global $SleepySleepTimeC = 0 Global $SleepySleepTimeD = 0 ;--------------------- Global $LogKeysToSendA Global $LogKeysToSendB Global $LogKeysToSendC Global $LogKeysToSendD ;--------------------- Global $LogSleepTimeA Global $LogSleepTimeB Global $LogSleepTimeC Global $LogSleepTimeD ;--------------------- Global $LeftClickCheckA Global $LeftClickCheckB Global $LeftClickCheckC Global $LeftClickCheckD Global $RightClickCheckA Global $RightClickCheckB Global $RightClickCheckC Global $RightClickCheckD ;--------------------- Global $Hotkeys = 0 Global $ToggleButton Global $GUIButton Global $GetEndButton Global $LogGetStartStop Global $LogGUIOpen Global $LogGetEnd ;--------------------- Global $X_Y_Send1 = "" Global $X_Y_Send2 = "" Global $X_Y_Send3 = "" Global $X_Y_Send4 = "" Global $L1X = "" Global $L1Y = "" Global $L2X = "" Global $L2Y = "" Global $L3X = "" Global $L3Y = "" Global $L4X = "" Global $L4Y = "" Global $L1_X = "" Global $L1_Y = "" Global $L2_X = "" Global $L2_Y = "" Global $L3_X = "" Global $L3_Y = "" Global $L4_X = "" Global $L4_Y = "" Global $LogL1X = "" Global $LogL1Y = "" Global $LogL2X = "" Global $LogL2Y = "" Global $LogL3X = "" Global $LogL3Y = "" Global $LogL4X = "" Global $LogL4Y = "" ;--------------------- Global $Replace1 Global $Replace2 Global $Replace3 Global $Replace4 Global $Replace5 Global $Replace6 Global $Replace7 Global $Replace8 Global $Replace9 Global $Replace10 Global $With1 Global $With2 Global $With3 Global $With4 Global $With5 Global $With6 Global $With7 Global $With8 Global $With9 Global $With10 Global $GetWith1 Global $GetWith2 Global $GetWith3 Global $GetWith4 Global $GetWith5 Global $GetWith6 Global $GetWith7 Global $GetWith8 Global $GetWith9 Global $GetWith10 Global $LogReplace1 Global $LogReplace2 Global $LogReplace3 Global $LogReplace4 Global $LogReplace5 Global $LogReplace6 Global $LogReplace7 Global $LogReplace8 Global $LogReplace9 Global $LogReplace10 Global $LogWith1 Global $LogWith2 Global $LogWith3 Global $LogWith4 Global $LogWith5 Global $LogWith6 Global $LogWith7 Global $LogWith8 Global $LogWith9 Global $LogWith10 Global $ReplaceWithCLEAR1 Global $ReplaceWithCLEAR2 Global $ReplaceWithCLEAR3 Global $ReplaceWithCLEAR4 Global $ReplaceWithCLEAR5 Global $ReplaceWithCLEAR6 Global $ReplaceWithCLEAR7 Global $ReplaceWithCLEAR8 Global $ReplaceWithCLEAR9 Global $ReplaceWithCLEAR10 Global $GetReplace1 Global $GetReplace2 Global $GetReplace3 Global $GetReplace4 Global $GetReplace5 Global $GetReplace6 Global $GetReplace7 Global $GetReplace8 Global $GetReplace9 Global $GetReplace10 ;--------------------- Global $KeyToClick1 Global $KeyToClick2 Global $KeyToClick3 Global $Combo1 Global $Combo2 Global $Combo3 Global $ComboBoxLeftClick1 Global $ComboBoxLeftClick2 Global $ComboBoxLeftClick3 Global $ComboBoxLeftClick4 Global $ComboBoxLeftClick5 Global $ComboBoxRightClick1 Global $ComboBoxRightClick2 Global $ComboBoxRightClick3 Global $ComboBoxClick1 Global $ComboBoxClick2 Global $ComboBoxClick3 Global $ComboBoxClick4 Global $ComboBoxClick5 Global $LogKeyToClick1 Global $LogKeyToClick2 Global $LogKeyToClick3 Global $LogCombo1 Global $LogCombo2 Global $LogCombo3 Global $KeyClick1 Global $KeyClick2 Global $KeyClick3 Global $ComboBoxMiddleButton1 Global $ComboBoxMiddleButton2 Global $ComboBoxMiddleButton3 ;--------------------- Global $DisableKeys1 Global $DisableKeys2 Global $DisableKeys3 Global $DisableKeys4 Global $DisableKeys5 Global $DisableKeys6 Global $DisableKeys7 Global $DisableKeys8 Global $DisableKeys9 Global $DisableKeys10 Global $LogDisableKeys1 Global $LogDisableKeys2 Global $LogDisableKeys3 Global $LogDisableKeys4 Global $LogDisableKeys5 Global $LogDisableKeys6 Global $LogDisableKeys7 Global $LogDisableKeys8 Global $LogDisableKeys9 Global $LogDisableKeys10 Global $KeysDisable1 Global $KeysDisable2 Global $KeysDisable3 Global $KeysDisable4 Global $KeysDisable5 Global $KeysDisable6 Global $KeysDisable7 Global $KeysDisable8 Global $KeysDisable9 Global $KeysDisable10 ;--------------------- Global $ButtonSwap ;--------------------- Global $HelpTab1 MacroMakerGUI() Func MacroMakerGUI();------------------------------------------------------------------------------- MACRO MAKER MAIN GUI $Form1 = GUICreate("MacroMaker", 410, 688, 198, 124) GUICtrlCreateInput("", -1, -1, 1, 1) ;-------------------------------------------------------- Change Hotkeys GUICtrlCreateGroup("Change_Hotkeys", 0, 5, 185, 97) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateLabel("Start/Stop", 8, 25, 68, 17) $GetStartStop = GUICtrlCreateInput("", 80, 25, 95, 21) GUICtrlSetData($GetStartStop, "{F1}") $Change_Hotkeys_Help = GUICtrlCreateButton("?", 95, 5, 11, 15) GUICtrlCreateLabel("Open GUI", 8, 46, 68, 17) $GUIOpen = GUICtrlCreateInput("", 80, 46, 95, 21) GUICtrlSetData($GUIOpen, "{HOME}") GUICtrlCreateLabel("End Program", 8, 67, 68, 17) $GetEnd = GUICtrlCreateInput("", 80, 67, 95, 21) GUICtrlSetData($GetEnd, "{END}") ;-------------------------------------------------------- Change Hotkeys {END} ;-------------------------------------------------------- Create Macro GUICtrlCreateGroup("Create_Macro", 0, 105, 185, 580) GUICtrlCreateGroup("", -99, -90, 1, 1) $Create_Macro_Help = GUICtrlCreateButton("?", 80, 105, 11, 15) GUICtrlCreateLabel("X=", 5, 128, 17, 17) $L1X = GUICtrlCreateInput("", 23, 128, 40, 21) GUICtrlCreateLabel("Y=", 69, 128, 17, 17) $L1Y = GUICtrlCreateInput("", 87, 128, 40, 21) $LeftClickA = GUICtrlCreateCheckbox("Leftclick", 5, 152, 73, 17) $RightClickA = GUICtrlCreateCheckbox("Rightclick", 5, 176, 73, 17) GUICtrlCreateLabel("Keys", 5, 200, 30, 17) $KeysToSendA = GUICtrlCreateInput("", 35, 200, 100, 21) GUICtrlCreateLabel("Delay", 5, 221, 30, 17) $SleepTimeA = GUICtrlCreateInput("", 35, 221, 65, 21) GUICtrlCreateLabel("ms", 105, 221, 17, 17) $CoordFinderButton1 = GUICtrlCreateButton("Get" & @CRLF & "Coords", 141, 111, 45, 30, $BS_MULTILINE) GUICtrlCreateLabel("X=", 5, 255, 17, 17) GUICtrlCreateLabel("Y=", 69, 255, 17, 17) $L2X = GUICtrlCreateInput("", 23, 255, 40, 21) $L2Y = GUICtrlCreateInput("", 87, 255, 40, 21) $LeftClickB = GUICtrlCreateCheckbox("Leftclick", 5, 280, 73, 17) $RightClickB = GUICtrlCreateCheckbox("Rightclick", 5, 304, 73, 17) GUICtrlCreateLabel("Keys", 5, 328, 30, 17) $KeysToSendB = GUICtrlCreateInput("", 35, 328, 100, 21) GUICtrlCreateLabel("Delay", 5, 349, 30, 17) $SleepTimeB = GUICtrlCreateInput("", 35, 349, 65, 21) GUICtrlCreateLabel("ms", 105, 349, 17, 17) $CoordFinderButton2 = GUICtrlCreateButton("Get" & @CRLF & "Coords", 141, 237, 45, 30, $BS_MULTILINE) GUICtrlCreateLabel("X=", 5, 382, 17, 17) GUICtrlCreateLabel("Y=", 69, 382, 17, 17) $L3X = GUICtrlCreateInput("", 23, 382, 40, 21) $L3Y = GUICtrlCreateInput("", 87, 382, 40, 21) $LeftClickC = GUICtrlCreateCheckbox("Leftclick", 5, 408, 73, 17) $RightClickC = GUICtrlCreateCheckbox("Rightclick", 5, 432, 73, 17) GUICtrlCreateLabel("Keys", 5, 455, 30, 17) $KeysToSendC = GUICtrlCreateInput("", 35, 455, 100, 21) GUICtrlCreateLabel("Delay", 5, 476, 30, 17) $SleepTimeC = GUICtrlCreateInput("", 35, 476, 65, 21) GUICtrlCreateLabel("ms", 105, 476, 17, 17) $CoordFinderButton3 = GUICtrlCreateButton("Get" & @CRLF & "Coords", 141, 364, 45, 30, $BS_MULTILINE) GUICtrlCreateLabel("X=", 5, 509, 17, 17) GUICtrlCreateLabel("Y=", 69, 509, 17, 17) $L4X = GUICtrlCreateInput("", 23, 509, 40, 21) $L4Y = GUICtrlCreateInput("", 87, 509, 40, 21) $LeftClickD = GUICtrlCreateCheckbox("Leftclick", 5, 537, 73, 17) $RightClickD = GUICtrlCreateCheckbox("Rightclick", 5, 561, 73, 17) GUICtrlCreateLabel("Keys", 5, 585, 30, 17) $KeysToSendD = GUICtrlCreateInput("", 35, 585, 100, 21) GUICtrlCreateLabel("Delay", 5, 606, 30, 17) $SleepTimeD = GUICtrlCreateInput("", 35, 606, 65, 21) GUICtrlCreateLabel("ms", 105, 606, 17, 17) $CoordFinderButton4 = GUICtrlCreateButton("Get" & @CRLF & "Coords", 141, 490, 45, 30, $BS_MULTILINE) $Create = GUICtrlCreateButton("Create", 48, 650, 75, 25) $CreateMacroCLEARALL = GUICtrlCreateButton("Clear" & @CRLF & "All", 138, 650, 30, 25, $BS_MULTILINE) ;-------------------------------------------------------- Create Macro {END} ;-------------------------------------------------------- Reassign Keys GUICtrlCreateGroup("Reassign_Keys", 200, 392, 220, 293) GUICtrlCreateGroup("", -99, -99, 1, 1) $Reassign_Keys_Help = GUICtrlCreateButton("?", 287, 392, 11, 15) GUICtrlCreateLabel("Replace", 216, 417, 44, 17) $Replace1 = GUICtrlCreateInput("", 264, 417, 42, 21) GUICtrlCreateLabel("with", 312, 417, 23, 17) $With1 = GUICtrlCreateInput("", 338, 417, 42, 21) $ReplaceWithCLEAR1 = GUICtrlCreateButton("-", 385, 417, 15, 15) GUICtrlCreateLabel("Replace", 216, 438, 44, 17) $Replace2 = GUICtrlCreateInput("", 264, 438, 42, 21) GUICtrlCreateLabel("with", 312, 438, 23, 17) $With2 = GUICtrlCreateInput("", 338, 438, 42, 21) $ReplaceWithCLEAR2 = GUICtrlCreateButton("-", 385, 438, 15, 15) GUICtrlCreateLabel("Replace", 216, 459, 44, 17) $Replace3 = GUICtrlCreateInput("", 264, 459, 42, 21) GUICtrlCreateLabel("with", 312, 459, 23, 17) $With3 = GUICtrlCreateInput("", 338, 459, 42, 21) $ReplaceWithCLEAR3 = GUICtrlCreateButton("-", 385, 459, 15, 15) GUICtrlCreateLabel("Replace", 216, 480, 44, 17) $Replace4 = GUICtrlCreateInput("", 264, 480, 42, 21) GUICtrlCreateLabel("with", 312, 480, 23, 17) $With4 = GUICtrlCreateInput("", 338, 480, 42, 21) $ReplaceWithCLEAR4 = GUICtrlCreateButton("-", 385, 480, 15, 15) GUICtrlCreateLabel("Replace", 216, 501, 44, 17) $Replace5 = GUICtrlCreateInput("", 264, 501, 42, 21) GUICtrlCreateLabel("with", 312, 501, 23, 17) $With5 = GUICtrlCreateInput("", 338, 501, 42, 21) $ReplaceWithCLEAR5 = GUICtrlCreateButton("-", 385, 501, 15, 15) GUICtrlCreateLabel("Replace", 216, 522, 44, 17) $Replace6 = GUICtrlCreateInput("", 264, 522, 42, 21) GUICtrlCreateLabel("with", 312, 522, 23, 17) $With6 = GUICtrlCreateInput("", 338, 522, 42, 21) $ReplaceWithCLEAR6 = GUICtrlCreateButton("-", 385, 522, 15, 15) GUICtrlCreateLabel("Replace", 216, 543, 44, 17) $Replace7 = GUICtrlCreateInput("", 264, 543, 42, 21) GUICtrlCreateLabel("with", 312, 543, 23, 17) $With7 = GUICtrlCreateInput("", 338, 543, 42, 21) $ReplaceWithCLEAR7 = GUICtrlCreateButton("-", 385, 543, 15, 15) GUICtrlCreateLabel("Replace", 216, 564, 44, 17) $Replace8 = GUICtrlCreateInput("", 264, 564, 42, 21) GUICtrlCreateLabel("with", 312, 564, 23, 17) $With8 = GUICtrlCreateInput("", 338, 564, 42, 21) $ReplaceWithCLEAR8 = GUICtrlCreateButton("-", 385, 564, 15, 15) GUICtrlCreateLabel("Replace", 216, 585, 44, 17) $Replace9 = GUICtrlCreateInput("", 264, 585, 42, 21) GUICtrlCreateLabel("with", 312, 585, 23, 17) $With9 = GUICtrlCreateInput("", 338, 585, 42, 21) $ReplaceWithCLEAR9 = GUICtrlCreateButton("-", 385, 585, 15, 15) GUICtrlCreateLabel("Replace", 216, 606, 44, 17) $Replace10 = GUICtrlCreateInput("", 264, 606, 42, 21) GUICtrlCreateLabel("with", 312, 606, 23, 17) $With10 = GUICtrlCreateInput("", 338, 606, 42, 21) $ReplaceWithCLEAR10 = GUICtrlCreateButton("-", 385, 606, 15, 15) $ReplaceWithCLEARALL = GUICtrlCreateButton("Clear All", 350, 645, 50, 15) $HideMainGUI1 = GUICtrlCreateButton("Hide GUI", 350, 660, 50, 15) $ReplaceKeys = GUICtrlCreateButton("Replace Keys", 260, 650, 75, 25) ;-------------------------------------------------------- Reassign Keys {END} ;-------------------------------------------------------- Key Into Click GUICtrlCreateGroup("Key_Into_Click", 200, 245, 217, 143) GUICtrlCreateGroup("", -99, -99, 1, 1) $Key_Into_Click_Help = GUICtrlCreateButton("?", 285, 245, 11, 15) GUICtrlCreateLabel("Turn", 207, 268, 29, 17) $KeyToClick1 = GUICtrlCreateInput("", 236, 268, 42, 21) GUICtrlCreateLabel("into", 284, 268, 21, 17) $Combo1 = GUICtrlCreateCombo("", 305, 268, 76, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData($Combo1, "Left Click|Right Click|Middle Button", "") $KeyComboCLEAR1 = GUICtrlCreateButton("-", 385, 268, 15, 15) GUICtrlCreateLabel("Turn", 207, 289, 29, 17) $KeyToClick2 = GUICtrlCreateInput("", 236, 289, 42, 21) GUICtrlCreateLabel("into", 284, 289, 21, 17) $Combo2 = GUICtrlCreateCombo("", 305, 289, 76, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData($Combo2, "Left Click|Right Click|Middle Button", "") $KeyComboCLEAR2 = GUICtrlCreateButton("-", 385, 289, 15, 15) GUICtrlCreateLabel("Turn", 207, 310, 29, 17) $KeyToClick3 = GUICtrlCreateInput("", 236, 310, 42, 21) GUICtrlCreateLabel("into", 284, 310, 21, 17) $Combo3 = GUICtrlCreateCombo("", 305, 310, 76, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData($Combo3, "Left Click|Right Click|Middle Button", "") $KeyComboCLEAR3 = GUICtrlCreateButton("-", 385, 310, 15, 15) $ReplaceKeys2 = GUICtrlCreateButton("Replace Keys", 260, 347, 75, 25) $KeyClickCLEARALL = GUICtrlCreateButton("Clear All", 350, 342, 50, 15) $HideMainGUI2 = GUICtrlCreateButton("Hide GUI", 350, 357, 50, 15) ;-------------------------------------------------------- Key Into Click {END} ;-------------------------------------------------------- Disable Keys GUICtrlCreateGroup("Disable_Keys", 200, 62, 217, 180) GUICtrlCreateGroup("", -99, -99, 1, 1) $Disable_Keys_Help = GUICtrlCreateButton("?", 285, 62, 11, 15) $DisableKeys1 = GUICtrlCreateInput("", 236, 84, 42, 21) $DisableKeysCLEAR1 = GUICtrlCreateButton("-", 282, 84, 15, 15) $DisableKeys2 = GUICtrlCreateInput("", 330, 84, 42, 21) $DisableKeysCLEAR2 = GUICtrlCreateButton("-", 376, 84, 15, 15) $DisableKeys3 = GUICtrlCreateInput("", 236, 105, 42, 21) $DisableKeysCLEAR3 = GUICtrlCreateButton("-", 282, 105, 15, 15) $DisableKeys4 = GUICtrlCreateInput("", 330, 105, 42, 21) $DisableKeysCLEAR4 = GUICtrlCreateButton("-", 376, 105, 15, 15) $DisableKeys5 = GUICtrlCreateInput("", 236, 126, 42, 21) $DisableKeysCLEAR5 = GUICtrlCreateButton("-", 282, 126, 15, 15) $DisableKeys6 = GUICtrlCreateInput("", 330, 126, 42, 21) $DisableKeysCLEAR6 = GUICtrlCreateButton("-", 376, 126, 15, 15) $DisableKeys7 = GUICtrlCreateInput("", 236, 147, 42, 21) $DisableKeysCLEAR7 = GUICtrlCreateButton("-", 282, 147, 15, 15) $DisableKeys8 = GUICtrlCreateInput("", 330, 147, 42, 21) $DisableKeysCLEAR8 = GUICtrlCreateButton("-", 376, 147, 15, 15) $DisableKeys9 = GUICtrlCreateInput("", 236, 168, 42, 21) $DisableKeysCLEAR9 = GUICtrlCreateButton("-", 282, 168, 15, 15) $DisableKeys10 = GUICtrlCreateInput("", 330, 168, 42, 21) $DisableKeysCLEAR10 = GUICtrlCreateButton("-", 376, 168, 15, 15) $DisableKeys = GUICtrlCreateButton("Disable Keys", 260, 205, 75, 25) $DisableKeysCLEARALL = GUICtrlCreateButton("Clear All", 350, 200, 50, 15) $HideMainGUI3 = GUICtrlCreateButton("Hide GUI", 350, 215, 50, 15) ;-------------------------------------------------------- Disable Keys {END} ;-------------------------------------------------------- Swap Mouse Button GUICtrlCreateGroup("Swap_Mouse_Buttons", 200, 5, 217, 55) GUICtrlCreateGroup("", -99, -99, 1, 1) $ButtonSwap = GUICtrlCreateCheckbox("Swap Left and Right Buttons", 220, 25, 152, 21) ;-------------------------------------------------------- Swap Mouse Button {END} LogKeys() GUISetState(@SW_SHOW, $Form1) While $State = 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE End() Case $GetStartStop $GetStartStopNew = ControlGetText("", "", $GetStartStop) $LogGetStartStop = ControlGetText("", "", $GetStartStop);LOG $ToggleButton = 1 Case $GUIOpen $GUIOpenNew = ControlGetText("", "", $GUIOpen) $LogGUIOpen = ControlGetText("", "", $GUIOpen);LOG $GUIButton = 1 Case $GetEnd $End_Program_New = ControlGetText("", "", $GetEnd) $LogGetEnd = ControlGetText("", "", $GetEnd);LOG $GetEndButton = 1 ;----------------------------------------------------------- Case $Change_Hotkeys_Help HelpTabs1() Case $Create_Macro_Help HelpTabs2() Case $Reassign_Keys_Help HelpTabs3() Case $Key_Into_Click_Help HelpTabs4() Case $Disable_Keys_Help HelpTabs5() ;----------------------------------------------------------- Case $L1X $X_Y_Send1 = 1 $L1_X = ControlGetText("", "", $L1X) $LogL1X = ControlGetText("", "", $L1X);LOG Case $L1Y $X_Y_Send1 = 1 $L1_Y = ControlGetText("", "", $L1Y) $LogL1Y = ControlGetText("", "", $L1Y);LOG Case $L2X $X_Y_Send2 = 1 $L2_X = ControlGetText("", "", $L2X) $LogL2X = ControlGetText("", "", $L2X);LOG Case $L2Y $X_Y_Send2 = 1 $L2_Y = ControlGetText("", "", $L2Y) $LogL2Y = ControlGetText("", "", $L2Y);LOG Case $L3X $X_Y_Send3 = 1 $L3_X = ControlGetText("", "", $L3X) $LogL3X = ControlGetText("", "", $L3X);LOG Case $L3Y $X_Y_Send3 = 1 $L3_Y = ControlGetText("", "", $L3Y) $LogL3Y = ControlGetText("", "", $L3Y);LOG Case $L4X $X_Y_Send4 = 1 $L4_X = ControlGetText("", "", $L4X) $LogL4X = ControlGetText("", "", $L4X);LOG Case $L4Y $X_Y_Send4 = 1 $L4_Y = ControlGetText("", "", $L4Y) $LogL4Y = ControlGetText("", "", $L4Y);LOG ;----------------------------------------------------------- Case $LeftClickA If GUICtrlRead($LeftClickA) = $GUI_CHECKED Then $LeftClickCheckA = 1 EndIf If GUICtrlRead($LeftClickA) = $GUI_UNCHECKED Then $LeftClickCheckA = 0 EndIf Case $LeftClickB If GUICtrlRead($LeftClickB) = $GUI_CHECKED Then $LeftClickCheckB = 1 EndIf If GUICtrlRead($LeftClickB) = $GUI_UNCHECKED Then $LeftClickCheckB = 0 EndIf Case $LeftClickC If GUICtrlRead($LeftClickC) = $GUI_CHECKED Then $LeftClickCheckC = 1 EndIf If GUICtrlRead($LeftClickC) = $GUI_UNCHECKED Then $LeftClickCheckC = 0 EndIf Case $LeftClickD If GUICtrlRead($LeftClickD) = $GUI_CHECKED Then $LeftClickCheckD = 1 EndIf If GUICtrlRead($LeftClickD) = $GUI_UNCHECKED Then $LeftClickCheckD = 0 EndIf ;----------------------------------------------------------- Case $RightClickA If GUICtrlRead($RightClickA) = $GUI_CHECKED Then $RightClickCheckA = 1 EndIf If GUICtrlRead($RightClickA) = $GUI_UNCHECKED Then $RightClickCheckA = 0 EndIf Case $RightClickB If GUICtrlRead($RightClickB) = $GUI_CHECKED Then $RightClickCheckB = 1 EndIf If GUICtrlRead($RightClickB) = $GUI_UNCHECKED Then $RightClickCheckB = 0 EndIf Case $RightClickC If GUICtrlRead($RightClickC) = $GUI_CHECKED Then $RightClickCheckC = 1 EndIf If GUICtrlRead($RightClickC) = $GUI_UNCHECKED Then $RightClickCheckC = 0 EndIf Case $RightClickD If GUICtrlRead($RightClickD) = $GUI_CHECKED Then $RightClickCheckD = 1 EndIf If GUICtrlRead($RightClickD) = $GUI_UNCHECKED Then $RightClickCheckD = 0 EndIf ;----------------------------------------------------------- Case $KeysToSendA $PressKeyA = 1 $SendKeysToSendA = ControlGetText("", "", $KeysToSendA) $LogKeysToSendA = ControlGetText("", "", $KeysToSendA);LOG Case $KeysToSendB $PressKeyB = 1 $SendKeysToSendB = ControlGetText("", "", $KeysToSendB) $LogKeysToSendB = ControlGetText("", "", $KeysToSendB);LOG Case $KeysToSendC $PressKeyC = 1 $SendKeysToSendC = ControlGetText("", "", $KeysToSendC) $LogKeysToSendC = ControlGetText("", "", $KeysToSendC);LOG Case $KeysToSendD $PressKeyD = 1 $SendKeysToSendD = ControlGetText("", "", $KeysToSendD) $LogKeysToSendD = ControlGetText("", "", $KeysToSendD);LOG ;----------------------------------------------------------- Case $SleepTimeA $SleepySleepTimeA = ControlGetText("", "", $SleepTimeA) $LogSleepTimeA = ControlGetText("", "", $SleepTimeA);LOG Case $SleepTimeB $SleepySleepTimeB = ControlGetText("", "", $SleepTimeB) $LogSleepTimeB = ControlGetText("", "", $SleepTimeB);LOG Case $SleepTimeC $SleepySleepTimeC = ControlGetText("", "", $SleepTimeC) $LogSleepTimeC = ControlGetText("", "", $SleepTimeC);LOG Case $SleepTimeD $SleepySleepTimeD = ControlGetText("", "", $SleepTimeD) $LogSleepTimeD = ControlGetText("", "", $SleepTimeD);LOG ;----------------------------------------------------------- Case $CoordFinderButton1 $X_Y_Send1 = 1 $FindCoords = 1 CoordFinder() Case $CoordFinderButton2 $X_Y_Send2 = 1 $FindCoords = 2 CoordFinder() Case $CoordFinderButton3 $X_Y_Send3 = 1 $FindCoords = 3 CoordFinder() Case $CoordFinderButton4 $X_Y_Send4 = 1 $FindCoords = 4 CoordFinder() Case $Create Sleep(100) GUISetState(@SW_HIDE, $Form1) Macro() Case $CreateMacroCLEARALL ClearAllMacroKeys() ;----------------------------------------------------------- Case $ReplaceWithCLEAR1 ClearKeys1() Case $ReplaceWithCLEAR2 ClearKeys2() Case $ReplaceWithCLEAR3 ClearKeys3() Case $ReplaceWithCLEAR4 ClearKeys4() Case $ReplaceWithCLEAR5 ClearKeys5() Case $ReplaceWithCLEAR6 ClearKeys6() Case $ReplaceWithCLEAR7 ClearKeys7() Case $ReplaceWithCLEAR8 ClearKeys8() Case $ReplaceWithCLEAR9 ClearKeys9() Case $ReplaceWithCLEAR10 ClearKeys10() Case $ReplaceWithCLEARALL ClearKeysALL() ;----------------------------------------------------------- Case $KeyComboCLEAR1 KeyClickCLEAR1() Case $KeyComboCLEAR2 KeyClickCLEAR2() Case $KeyComboCLEAR3 KeyClickCLEAR3() Case $KeyClickCLEARALL KeyClickCLEARALL() ;----------------------------------------------------------- Case $DisableKeysCLEAR1 DisableKeysCLEAR1() Case $DisableKeysCLEAR2 DisableKeysCLEAR2() Case $DisableKeysCLEAR3 DisableKeysCLEAR3() Case $DisableKeysCLEAR4 DisableKeysCLEAR4() Case $DisableKeysCLEAR5 DisableKeysCLEAR5() Case $DisableKeysCLEAR6 DisableKeysCLEAR6() Case $DisableKeysCLEAR7 DisableKeysCLEAR7() Case $DisableKeysCLEAR8 DisableKeysCLEAR8() Case $DisableKeysCLEAR9 DisableKeysCLEAR9() Case $DisableKeysCLEAR10 DisableKeysCLEAR10() Case $DisableKeysCLEARALL DisableKeysCLEARALL() ;----------------------------------------------------------- Case $ReplaceKeys ReplaceKeys() ReassignKeysNotification() Case $ReplaceKeys2 KeyIntoClick() ReassignKeysNotification() Case $DisableKeys DisableKeys() DisableKeysNotification() Case $HideMainGUI1 HideMacroMakerGUI() Case $HideMainGUI2 HideMacroMakerGUI() Case $HideMainGUI3 HideMacroMakerGUI() Case $ButtonSwap MouseClickSwap() If GUICtrlRead($ButtonSwap) = $GUI_CHECKED Then $SwapState = 1 EndIf If GUICtrlRead($ButtonSwap) = $GUI_UNCHECKED Then $SwapState = 0 EndIf MouseClickSwap() EndSwitch WEnd EndFunc ;------------------------------------------------------------------------------- MACRO MAKER MAIN GUI {END} Func Macro();------------------------------------------------------------------------------- CREATE MACRO $Hotkeys = 1 Hotkeys() Global $ToggleState Global $Toggle = True If $Toggle = False Then $ToggleState = True Else $ToggleState = False EndIf EndFunc Func Toggle() $ToggleState = NOT $ToggleState While $ToggleState If $LogL1X = "" Then $X_Y_Send1 = 0 EndIf If $LogL1Y = "" Then $X_Y_Send1 = 0 EndIf If $X_Y_Send1 = 1 Then MouseMove($L1_X, $L1_Y, 10) EndIf If $LeftClickCheckA = 1 Then MouseClick($MOUSE_CLICK_PRIMARY) EndIf If $RightClickCheckA = 1 Then MouseClick($MOUSE_CLICK_SECONDARY) EndIf If $PressKeyA = 1 Then Send($SendKeysToSendA) EndIf Sleep($SleepySleepTimeA) ;------------------------------ If $LogL2X = "" Then $X_Y_Send2 = 0 EndIf If $LogL2Y = "" Then $X_Y_Send2 = 0 EndIf If $X_Y_Send2 = 1 Then MouseMove($L2_X, $L2_Y, 10) EndIf If $LeftClickCheckB = 1 Then MouseClick($MOUSE_CLICK_PRIMARY) EndIf If $RightClickCheckB = 1 Then MouseClick($MOUSE_CLICK_SECONDARY) EndIf If $PressKeyB = 1 Then Send($SendKeysToSendB) EndIf Sleep($SleepySleepTimeB) ;------------------------------ If $LogL3X = "" Then $X_Y_Send3 = 0 EndIf If $LogL3Y = "" Then $X_Y_Send3 = 0 EndIf If $X_Y_Send3 = 1 Then MouseMove($L3_X, $L3_Y, 10) EndIf If $LeftClickCheckC = 1 Then MouseClick($MOUSE_CLICK_PRIMARY) EndIf If $RightClickCheckC = 1 Then MouseClick($MOUSE_CLICK_SECONDARY) EndIf If $PressKeyC = 1 Then Send($SendKeysToSendC) EndIf Sleep($SleepySleepTimeC) ;------------------------------ If $LogL4X = "" Then $X_Y_Send4 = 0 EndIf If $LogL4Y = "" Then $X_Y_Send4 = 0 EndIf If $X_Y_Send4 = 1 Then MouseMove($L4_X, $L4_Y, 10) EndIf If $LeftClickCheckD = 1 Then MouseClick($MOUSE_CLICK_PRIMARY) EndIf If $RightClickCheckD = 1 Then MouseClick($MOUSE_CLICK_SECONDARY) EndIf If $PressKeyD = 1 Then Send($SendKeysToSendD) EndIf Sleep($SleepySleepTimeD) ;------------------------------ If Not $ToggleState Then Sleep(100) EndIf WEnd EndFunc Func ClearAllMacroKeys() $SleepySleepTimeA = 0 $SendKeysToSendA = "" $PressKeyA = "" $LogL1X = "" $LogL1Y = "" $LeftClickCheckA = 0 $RightClickCheckA = 0 $LogKeysToSendA = "" $LogSleepTimeA = "" GUICtrlSetData($L1X, "") GUICtrlSetData($L1Y, "") GUICtrlSetState($LeftClickA, $GUI_UNCHECKED) GUICtrlSetState($RightClickA, $GUI_UNCHECKED) GUICtrlSetData($KeysToSendA, "") GUICtrlSetData($SleepTimeA, "") ;-------------------------------- $SleepySleepTimeB = 0 $SendKeysToSendB = "" $PressKeyB = "" $LogL2X = "" $LogL2Y = "" $LeftClickCheckB = 0 $RightClickCheckB = 0 $LogKeysToSendB = "" $LogSleepTimeB = "" GUICtrlSetData($L2X, "") GUICtrlSetData($L2Y, "") GUICtrlSetState($LeftClickB, $GUI_UNCHECKED) GUICtrlSetState($RightClickB, $GUI_UNCHECKED) GUICtrlSetData($KeysToSendB, "") GUICtrlSetData($SleepTimeB, "") ;-------------------------------- $SleepySleepTimeC = 0 $SendKeysToSendC = "" $PressKeyC = "" $LogL3X = "" $LogL3Y = "" $LeftClickCheckC = 0 $RightClickCheckC = 0 $LogKeysToSendC = "" $LogSleepTimeC = "" GUICtrlSetData($L3X, "") GUICtrlSetData($L3Y, "") GUICtrlSetState($LeftClickC, $GUI_UNCHECKED) GUICtrlSetState($RightClickC, $GUI_UNCHECKED) GUICtrlSetData($KeysToSendC, "") GUICtrlSetData($SleepTimeC, "") ;-------------------------------- $SleepySleepTimeD = 0 $SendKeysToSendD = "" $PressKeyD = "" $LogL4X = "" $LogL4Y = "" $LeftClickCheckD = 0 $RightClickCheckD = 0 $LogKeysToSendD = "" $LogSleepTimeD = "" GUICtrlSetData($L4X, "") GUICtrlSetData($L4Y, "") GUICtrlSetState($LeftClickD, $GUI_UNCHECKED) GUICtrlSetState($RightClickD, $GUI_UNCHECKED) GUICtrlSetData($KeysToSendD, "") GUICtrlSetData($SleepTimeD, "") EndFunc Func OpenGUI() $Hotkeys = 0 Hotkeys() MacroMakerGUI() EndFunc ;------------------------------------------------------------------------------- CREATE MACRO {END} Func CoordFinder();------------------------------------------------------------------------------- COORD FINDER HotKeySet($GetStartStopNew, "EndCoordFinder") Global $FindCoordsState $FindCoordsState = 1 While $FindCoordsState = 1 Sleep(50) Get_Mouse_Pos() WEnd EndFunc Func Get_Mouse_Pos() $Mpos = MouseGetPos() $Mpos_x = $Mpos[0] $Mpos_y = $Mpos[1] If $FindCoords = 1 Then GUICtrlSetData($L1X, $Mpos_x) GUICtrlSetData($L1Y, $Mpos_y) $LogL1X = ControlGetText("", "", $L1X);LOG $LogL1Y = ControlGetText("", "", $L1Y);LOG $L1_X = ControlGetText("", "", $L1X) $L1_Y = ControlGetText("", "", $L1Y) EndIf If $FindCoords = 2 Then GUICtrlSetData($L2X, $Mpos_x) GUICtrlSetData($L2Y, $Mpos_y) $LogL2X = ControlGetText("", "", $L2X);LOG $LogL2Y = ControlGetText("", "", $L2Y);LOG $L2_X = ControlGetText("", "", $L2X) $L2_Y = ControlGetText("", "", $L2Y) EndIf If $FindCoords = 3 Then GUICtrlSetData($L3X, $Mpos_x) GUICtrlSetData($L3Y, $Mpos_y) $LogL3X = ControlGetText("", "", $L3X);LOG $LogL3Y = ControlGetText("", "", $L3Y);LOG $L3_X = ControlGetText("", "", $L3X) $L3_Y = ControlGetText("", "", $L3Y) EndIf If $FindCoords = 4 Then GUICtrlSetData($L4X, $Mpos_x) GUICtrlSetData($L4Y, $Mpos_y) $LogL4X = ControlGetText("", "", $L4X);LOG $LogL4Y = ControlGetText("", "", $L4Y);LOG $L4_X = ControlGetText("", "", $L4X) $L4_Y = ControlGetText("", "", $L4Y) EndIf EndFunc Func EndCoordFinder() $FindCoordsState = 0 $FindCoords = 0 Hotkeys() LogKeys() EndFunc ;------------------------------------------------------------------------------- COORD FINDER {END} Func MouseClickSwap();---------------------------------------------------- MOUSE CLICK SWAP DllCall("user32.dll", "int", "SwapMouseButton", "int", $SwapState) EndFunc ;---------------------------------------------------- MOUSE CLICK SWAP {END} Func DisableKeys();------------------------------------------------------------------------------- DISABLE KEYS $KeysDisable1 = ControlGetText("", "", $DisableKeys1) $LogDisableKeys1 = ControlGetText("", "", $DisableKeys1);LOG HotKeySet($KeysDisable1, "BlankKey") $KeysDisable2 = ControlGetText("", "", $DisableKeys2) $LogDisableKeys2 = ControlGetText("", "", $DisableKeys2);LOG HotKeySet($KeysDisable2, "BlankKey") $KeysDisable3 = ControlGetText("", "", $DisableKeys3) $LogDisableKeys3 = ControlGetText("", "", $DisableKeys3);LOG HotKeySet($KeysDisable3, "BlankKey") $KeysDisable4 = ControlGetText("", "", $DisableKeys4) $LogDisableKeys4 = ControlGetText("", "", $DisableKeys4);LOG HotKeySet($KeysDisable4, "BlankKey") $KeysDisable5 = ControlGetText("", "", $DisableKeys5) $LogDisableKeys5 = ControlGetText("", "", $DisableKeys5);LOG HotKeySet($KeysDisable5, "BlankKey") $KeysDisable6 = ControlGetText("", "", $DisableKeys6) $LogDisableKeys6 = ControlGetText("", "", $DisableKeys6);LOG HotKeySet($KeysDisable6, "BlankKey") $KeysDisable7 = ControlGetText("", "", $DisableKeys7) $LogDisableKeys7 = ControlGetText("", "", $DisableKeys7);LOG HotKeySet($KeysDisable7, "BlankKey") $KeysDisable8 = ControlGetText("", "", $DisableKeys8) $LogDisableKeys8 = ControlGetText("", "", $DisableKeys8);LOG HotKeySet($KeysDisable8, "BlankKey") $KeysDisable9 = ControlGetText("", "", $DisableKeys9) $LogDisableKeys9 = ControlGetText("", "", $DisableKeys9);LOG HotKeySet($KeysDisable9, "BlankKey") $KeysDisable10 = ControlGetText("", "", $DisableKeys10) $LogDisableKeys10 = ControlGetText("", "", $DisableKeys10);LOG HotKeySet($KeysDisable10, "BlankKey") EndFunc Func BlankKey() Send("") EndFunc Func DisableKeysCLEAR1() $LogDisableKeys1 = "" GUICtrlSetData($DisableKeys1, "") HotKeySet($KeysDisable1) EndFunc Func DisableKeysCLEAR2() $LogDisableKeys2 = "" GUICtrlSetData($DisableKeys2, "") HotKeySet($KeysDisable2) EndFunc Func DisableKeysCLEAR3() $LogDisableKeys3 = "" GUICtrlSetData($DisableKeys3, "") HotKeySet($KeysDisable3) EndFunc Func DisableKeysCLEAR4() $LogDisableKeys4 = "" GUICtrlSetData($DisableKeys4, "") HotKeySet($KeysDisable4) EndFunc Func DisableKeysCLEAR5() $LogDisableKeys5 = "" GUICtrlSetData($DisableKeys5, "") HotKeySet($KeysDisable5) EndFunc Func DisableKeysCLEAR6() $LogDisableKeys6 = "" GUICtrlSetData($DisableKeys6, "") HotKeySet($KeysDisable6) EndFunc Func DisableKeysCLEAR7() $LogDisableKeys7 = "" GUICtrlSetData($DisableKeys7, "") HotKeySet($KeysDisable7) EndFunc Func DisableKeysCLEAR8() $LogDisableKeys8 = "" GUICtrlSetData($DisableKeys8, "") HotKeySet($KeysDisable8) EndFunc Func DisableKeysCLEAR9() $LogDisableKeys9 = "" GUICtrlSetData($DisableKeys9, "") HotKeySet($KeysDisable9) EndFunc Func DisableKeysCLEAR10() $LogDisableKeys10 = "" GUICtrlSetData($DisableKeys10, "") HotKeySet($KeysDisable10) EndFunc Func DisableKeysCLEARALL() DisableKeysCLEAR1() DisableKeysCLEAR2() DisableKeysCLEAR3() DisableKeysCLEAR4() DisableKeysCLEAR5() DisableKeysCLEAR6() DisableKeysCLEAR7() DisableKeysCLEAR8() DisableKeysCLEAR9() DisableKeysCLEAR10() EndFunc Func DisableKeysNotification() MsgBox($MB_SYSTEMMODAL, "Info", "Keys Disabled") EndFunc ;------------------------------------------------------------------------------- DISABLE KEYS {END} Func KeyIntoClick();------------------------------------------------------------------------------- KEY INTO CLICK $KeyClick1 = ControlGetText("", "", $KeyToClick1) HotKeySet($KeyClick1, "ReplaceKeyClick1") $KeyClick2 = ControlGetText("", "", $KeyToClick2) HotKeySet($KeyClick2, "ReplaceKeyClick2") $KeyClick3 = ControlGetText("", "", $KeyToClick3) HotKeySet($KeyClick3, "ReplaceKeyClick3") $ComboBoxClick1 = ControlGetText("", "", $Combo1) $LogCombo1 = ControlGetText("", "", $Combo1);LOG $LogKeyToClick1 = ControlGetText("", "", $KeyToClick1);LOG If $ComboBoxClick1 = "Left Click" Then $ComboBoxLeftClick1 = 1 Else $ComboBoxLeftClick1 = 0 EndIf If $ComboBoxClick1 = "Right Click" Then $ComboBoxRightClick1 = 1 Else $ComboBoxRightClick1 = 0 EndIf If $ComboBoxClick1 = "Middle Button" Then $ComboBoxMiddleButton1 = 1 Else $ComboBoxMiddleButton1 = 0 EndIf $ComboBoxClick2 = ControlGetText("", "", $Combo2) $LogCombo2 = ControlGetText("", "", $Combo2);LOG $LogKeyToClick2 = ControlGetText("", "", $KeyToClick2);LOG If $ComboBoxClick2 = "Left Click" Then $ComboBoxLeftClick2 = 1 Else $ComboBoxLeftClick2 = 0 EndIf If $ComboBoxClick2 = "Right Click" Then $ComboBoxRightClick2 = 1 Else $ComboBoxRightClick2 = 0 EndIf If $ComboBoxClick2 = "Middle Button" Then $ComboBoxMiddleButton2 = 1 Else $ComboBoxMiddleButton2 = 0 EndIf $ComboBoxClick3 = ControlGetText("", "", $Combo3) $LogCombo3 = ControlGetText("", "", $Combo3);LOG $LogKeyToClick3 = ControlGetText("", "", $KeyToClick3);LOG If $ComboBoxClick3 = "Left Click" Then $ComboBoxLeftClick3 = 1 Else $ComboBoxLeftClick3 = 0 EndIf If $ComboBoxClick5 = "Right Click" Then $ComboBoxRightClick3 = 1 Else $ComboBoxRightClick3 = 0 EndIf If $ComboBoxClick3 = "Middle Button" Then $ComboBoxMiddleButton3 = 1 Else $ComboBoxMiddleButton3 = 0 EndIf EndFunc Func ReplaceKeyClick1() If $ComboBoxLeftClick1 = 1 Then MouseClick($MOUSE_CLICK_PRIMARY) EndIf If $ComboBoxRightClick1 = 1 Then MouseClick($MOUSE_CLICK_SECONDARY) EndIf If $ComboBoxMiddleButton1 = 1 Then MouseClick($MOUSE_CLICK_MIDDLE) EndIf EndFunc Func ReplaceKeyClick2() If $ComboBoxLeftClick2 = 1 Then MouseClick($MOUSE_CLICK_PRIMARY) EndIf If $ComboBoxRightClick2 = 1 Then MouseClick($MOUSE_CLICK_SECONDARY) EndIf If $ComboBoxMiddleButton2 = 1 Then MouseClick($MOUSE_CLICK_MIDDLE) EndIf EndFunc Func ReplaceKeyClick3() If $ComboBoxLeftClick3 = 1 Then MouseClick($MOUSE_CLICK_PRIMARY) EndIf If $ComboBoxRightClick3 = 1 Then MouseClick($MOUSE_CLICK_SECONDARY) EndIf If $ComboBoxMiddleButton3 = 1 Then MouseClick($MOUSE_CLICK_MIDDLE) EndIf EndFunc Func KeyClickCLEAR1() $LogCombo1 = "" $LogKeyToClick1 = "" GUICtrlSetData($Combo1, "") GUICtrlSetData($KeyToClick1, "") GUICtrlSetData($Combo1, "Left Click|Right Click|Middle Button", "") HotKeySet($KeyClick1) EndFunc Func KeyClickCLEAR2() $LogCombo2 = "" $LogKeyToClick2 = "" GUICtrlSetData($Combo2, "") GUICtrlSetData($KeyToClick2, "") GUICtrlSetData($Combo2, "Left Click|Right Click|Middle Button", "") HotKeySet($KeyClick2) EndFunc Func KeyClickCLEAR3() $LogCombo3 = "" $LogKeyToClick3 = "" GUICtrlSetData($Combo3, "") GUICtrlSetData($KeyToClick3, "") GUICtrlSetData($Combo3, "Left Click|Right Click|Middle Button", "") HotKeySet($KeyClick3) EndFunc Func KeyClickCLEARALL() KeyClickCLEAR1() KeyClickCLEAR2() KeyClickCLEAR3() EndFunc ;------------------------------------------------------------------------------- KEY INTO CLICK {END} Func ReplaceKeys();------------------------------------------------------------------------------- REASSIGN KEYS $GetReplace1 = ControlGetText("", "", $Replace1) $LogReplace1 = ControlGetText("", "", $Replace1);LOG $GetWith1 = ControlGetText("", "", $With1) $LogWith1 = ControlGetText("", "", $With1);LOG HotKeySet($GetReplace1, "ReplaceWith1") $GetReplace2 = ControlGetText("", "", $Replace2) $LogReplace2 = ControlGetText("", "", $Replace2);LOG $GetWith2 = ControlGetText("", "", $With2) $LogWith2 = ControlGetText("", "", $With2);LOG HotKeySet($GetReplace2, "ReplaceWith2") $GetReplace3 = ControlGetText("", "", $Replace3) $LogReplace3 = ControlGetText("", "", $Replace3);LOG $GetWith3 = ControlGetText("", "", $With3) $LogWith3 = ControlGetText("", "", $With3);LOG HotKeySet($GetReplace3, "ReplaceWith3") $GetReplace4 = ControlGetText("", "", $Replace4) $LogReplace4 = ControlGetText("", "", $Replace4);LOG $GetWith4 = ControlGetText("", "", $With4) $LogWith4 = ControlGetText("", "", $With4);LOG HotKeySet($GetReplace4, "ReplaceWith4") $GetReplace5 = ControlGetText("", "", $Replace5) $LogReplace5 = ControlGetText("", "", $Replace5);LOG $GetWith5 = ControlGetText("", "", $With5) $LogWith5 = ControlGetText("", "", $With5);LOG HotKeySet($GetReplace5, "ReplaceWith5") $GetReplace6 = ControlGetText("", "", $Replace6) $LogReplace6 = ControlGetText("", "", $Replace6);LOG $GetWith6 = ControlGetText("", "", $With6) $LogWith6 = ControlGetText("", "", $With6);LOG HotKeySet($GetReplace6, "ReplaceWith6") $GetReplace7 = ControlGetText("", "", $Replace7) $LogReplace7 = ControlGetText("", "", $Replace7);LOG $GetWith7 = ControlGetText("", "", $With7) $LogWith7 = ControlGetText("", "", $With7);LOG HotKeySet($GetReplace7, "ReplaceWith7") $GetReplace8 = ControlGetText("", "", $Replace8) $LogReplace8 = ControlGetText("", "", $Replace8);LOG $GetWith8 = ControlGetText("", "", $With8) $LogWith8 = ControlGetText("", "", $With8);LOG HotKeySet($GetReplace8, "ReplaceWith8") $GetReplace9 = ControlGetText("", "", $Replace9) $LogReplace9 = ControlGetText("", "", $Replace9);LOG $GetWith9 = ControlGetText("", "", $With9) $LogWith9 = ControlGetText("", "", $With9);LOG- HotKeySet($GetReplace9, "ReplaceWith9") $GetReplace10 = ControlGetText("", "", $Replace10) $LogReplace10 = ControlGetText("", "", $Replace10);LOG $GetWith10 = ControlGetText("", "", $With10) $LogWith10 = ControlGetText("", "", $With10);LOG HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith1() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith1) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith2() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith2) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith3() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith3) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith4() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith4) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith5() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith5) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith6() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith6) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith7() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith7) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith8() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith8) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith9() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith9) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith10() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith10) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ClearKeys1() $GetReplace1 = $LogReplace1 $GetWith1 = "" $LogWith1 = "" GUICtrlSetData($Replace1, "") GUICtrlSetData($With1, "") HotKeySet($GetReplace1) ReplaceKeys() EndFunc Func ClearKeys2() $GetReplace2 = $LogReplace2 $GetWith2 = "" $LogWith2 = "" GUICtrlSetData($Replace2, "") GUICtrlSetData($With2, "") HotKeySet($GetReplace2) ReplaceKeys() EndFunc Func ClearKeys3() $GetReplace3 = $LogReplace3 $GetWith3 = "" $LogWith3 = "" GUICtrlSetData($Replace3, "") GUICtrlSetData($With3, "") HotKeySet($GetReplace3) ReplaceKeys() EndFunc Func ClearKeys4() $GetReplace4 = $LogReplace4 $GetWith4 = "" $LogWith4 = "" GUICtrlSetData($Replace4, "") GUICtrlSetData($With4, "") HotKeySet($GetReplace4) ReplaceKeys() EndFunc Func ClearKeys5() $GetReplace5 = $LogReplace5 $GetWith5 = "" $LogWith5 = "" GUICtrlSetData($Replace5, "") GUICtrlSetData($With5, "") HotKeySet($GetReplace5) ReplaceKeys() EndFunc Func ClearKeys6() $GetReplace6 = $LogReplace6 $GetWith6 = "" $LogWith6 = "" GUICtrlSetData($Replace6, "") GUICtrlSetData($With6, "") HotKeySet($GetReplace6) ReplaceKeys() EndFunc Func ClearKeys7() $GetReplace7 = $LogReplace7 $GetWith7 = "" $LogWith7 = "" GUICtrlSetData($Replace7, "") GUICtrlSetData($With7, "") HotKeySet($GetReplace7) ReplaceKeys() EndFunc Func ClearKeys8() $GetReplace8 = $LogReplace8 $GetWith8 = "" $LogWith8 = "" GUICtrlSetData($Replace8, "") GUICtrlSetData($With8, "") HotKeySet($GetReplace8) ReplaceKeys() EndFunc Func ClearKeys9() $GetReplace9 = $LogReplace9 $GetWith9 = "" $LogWith9 = "" GUICtrlSetData($Replace9, "") GUICtrlSetData($With9, "") HotKeySet($GetReplace9) ReplaceKeys() EndFunc Func ClearKeys10() $GetReplace10 = $LogReplace10 $GetWith10 = "" $LogWith10 = "" GUICtrlSetData($Replace10, "") GUICtrlSetData($With10, "") HotKeySet($GetReplace10) ReplaceKeys() EndFunc Func ClearKeysALL() ClearKeys1() ClearKeys2() ClearKeys3() ClearKeys4() ClearKeys5() ClearKeys6() ClearKeys7() ClearKeys8() ClearKeys9() ClearKeys10() EndFunc ;------------------------------------------------------------------------------- REASSIGN KEYS {END} Func LogKeys();------------------------------------------------------------------------------- LOGS If $ToggleButton = 1 Then GUICtrlSetData($GetStartStop, $LogGetStartStop) EndIf If $GUIButton = 1 Then GUICtrlSetData($GUIOpen, $LogGUIOpen) EndIf If $GetEndButton = 1 Then GUICtrlSetData($GetEnd, $LogGetEnd) EndIf ;---------------------------------------------------- Create Macro If $X_Y_Send1 = 1 Then GUICtrlSetData($L1X, $LogL1X) GUICtrlSetData($L1Y, $LogL1Y) EndIf If $X_Y_Send2 = 1 Then GUICtrlSetData($L2X, $LogL2X) GUICtrlSetData($L2Y, $LogL2Y) EndIf If $X_Y_Send3 = 1 Then GUICtrlSetData($L3X, $LogL3X) GUICtrlSetData($L3Y, $LogL3Y) EndIf If $X_Y_Send4 = 1 Then GUICtrlSetData($L4X, $LogL4X) GUICtrlSetData($L4Y, $LogL4Y) EndIf ;---------------------------------------------------- If $LeftClickCheckA = 1 Then GUICtrlSetState($LeftClickA, $GUI_CHECKED) EndIf If $LeftClickCheckA = 0 Then GUICtrlSetState($LeftClickA, $GUI_UNCHECKED) EndIf If $LeftClickCheckB = 1 Then GUICtrlSetState($LeftClickB, $GUI_CHECKED) EndIf If $LeftClickCheckB = 0 Then GUICtrlSetState($LeftClickB, $GUI_UNCHECKED) EndIf If $LeftClickCheckC = 1 Then GUICtrlSetState($LeftClickC, $GUI_CHECKED) EndIf If $LeftClickCheckC = 0 Then GUICtrlSetState($LeftClickC, $GUI_UNCHECKED) EndIf If $LeftClickCheckD = 1 Then GUICtrlSetState($LeftClickD, $GUI_CHECKED) EndIf If $LeftClickCheckD = 0 Then GUICtrlSetState($LeftClickD, $GUI_UNCHECKED) EndIf ;---------------------------------------------------- If $RightClickCheckA = 1 Then GUICtrlSetState($RightClickA, $GUI_CHECKED) EndIf If $RightClickCheckA = 0 Then GUICtrlSetState($RightClickA, $GUI_UNCHECKED) EndIf If $RightClickCheckB = 1 Then GUICtrlSetState($RightClickB, $GUI_CHECKED) EndIf If $RightClickCheckB = 0 Then GUICtrlSetState($RightClickB, $GUI_UNCHECKED) EndIf If $RightClickCheckC = 1 Then GUICtrlSetState($RightClickC, $GUI_CHECKED) EndIf If $RightClickCheckC = 0 Then GUICtrlSetState($RightClickC, $GUI_UNCHECKED) EndIf If $RightClickCheckD = 1 Then GUICtrlSetState($RightClickD, $GUI_CHECKED) EndIf If $RightClickCheckD = 0 Then GUICtrlSetState($RightClickD, $GUI_UNCHECKED) EndIf ;---------------------------------------------------- If $PressKeyA = 1 Then GUICtrlSetData($KeysToSendA, $LogKeysToSendA) EndIf If $PressKeyB = 1 Then GUICtrlSetData($KeysToSendB, $LogKeysToSendB) EndIf If $PressKeyC = 1 Then GUICtrlSetData($KeysToSendC, $LogKeysToSendC) EndIf If $PressKeyD = 1 Then GUICtrlSetData($KeysToSendD, $LogKeysToSendD) EndIf ;---------------------------------------------------- GUICtrlSetData($SleepTimeA, $LogSleepTimeA) GUICtrlSetData($SleepTimeB, $LogSleepTimeB) GUICtrlSetData($SleepTimeC, $LogSleepTimeC) GUICtrlSetData($SleepTimeD, $LogSleepTimeD) ;---------------------------------------------------- Reassign Keys GUICtrlSetData($Replace1, $LogReplace1) GUICtrlSetData($With1, $LogWith1) GUICtrlSetData($Replace2, $LogReplace2) GUICtrlSetData($With2, $LogWith2) GUICtrlSetData($Replace3, $LogReplace3) GUICtrlSetData($With3, $LogWith3) GUICtrlSetData($Replace4, $LogReplace4) GUICtrlSetData($With4, $LogWith4) GUICtrlSetData($Replace5, $LogReplace5) GUICtrlSetData($With5, $LogWith5) GUICtrlSetData($Replace6, $LogReplace6) GUICtrlSetData($With6, $LogWith6) GUICtrlSetData($Replace7, $LogReplace7) GUICtrlSetData($With7, $LogWith7) GUICtrlSetData($Replace8, $LogReplace8) GUICtrlSetData($With8, $LogWith8) GUICtrlSetData($Replace9, $LogReplace9) GUICtrlSetData($With9, $LogWith9) GUICtrlSetData($Replace10, $LogReplace10) GUICtrlSetData($With10, $LogWith10) ;---------------------------------------------------- Key Into Click GUICtrlSetData($KeyToClick1, $LogKeyToClick1) GUICtrlSetData($Combo1, "") GUICtrlSetData($Combo1, "Left Click|Right Click|Middle Button", $LogCombo1) GUICtrlSetData($KeyToClick2, $LogKeyToClick2) GUICtrlSetData($Combo2, "") GUICtrlSetData($Combo2, "Left Click|Right Click|Middle Button", $LogCombo2) GUICtrlSetData($KeyToClick3, $LogKeyToClick3) GUICtrlSetData($Combo3, "") GUICtrlSetData($Combo3, "Left Click|Right Click|Middle Button", $LogCombo3) ;---------------------------------------------------- Disable Keys GUICtrlSetData($DisableKeys1, $LogDisableKeys1) GUICtrlSetData($DisableKeys2, $LogDisableKeys2) GUICtrlSetData($DisableKeys3, $LogDisableKeys3) GUICtrlSetData($DisableKeys4, $LogDisableKeys4) GUICtrlSetData($DisableKeys5, $LogDisableKeys5) GUICtrlSetData($DisableKeys6, $LogDisableKeys6) GUICtrlSetData($DisableKeys7, $LogDisableKeys7) GUICtrlSetData($DisableKeys8, $LogDisableKeys8) GUICtrlSetData($DisableKeys9, $LogDisableKeys9) GUICtrlSetData($DisableKeys10, $LogDisableKeys10) ;---------------------------------------------------- Mouse Button Swap If $SwapState = 1 Then GUICtrlSetState($ButtonSwap, $GUI_CHECKED) EndIf If $SwapState = 0 Then GUICtrlSetState($ButtonSwap, $GUI_UNCHECKED) EndIf EndFunc ;------------------------------------------------------------------------------- LOGS {END} Func MacroHelp();------------------------------------------------------------------------------- MACRO HELP Global $MacroHelpState = 1 Local $idListview = GUICtrlCreateListView("Send() Command| Resulting Keypress", 10, 32, 390, 358) Local $idItem1 = GUICtrlCreateListViewItem("{!}|!", $idListview) Local $idItem2 = GUICtrlCreateListViewItem("{#}|#", $idListview) Local $idItem3 = GUICtrlCreateListViewItem("{+}|+", $idListview) Local $idItem4 = GUICtrlCreateListViewItem("{^}|^", $idListview) Local $idItem5 = GUICtrlCreateListViewItem("{{}|{", $idListview) Local $idItem6 = GUICtrlCreateListViewItem("{}}|}", $idListview) Local $idItem7 = GUICtrlCreateListViewItem("{SPACE}|SPACEBAR key", $idListview) Local $idItem8 = GUICtrlCreateListViewItem("{ENTER}|ENTER key", $idListview) Local $idItem9 = GUICtrlCreateListViewItem("{ALT}|ALT", $idListview) Local $idItem10 = GUICtrlCreateListViewItem("{BACKSPACE} or {BS}|BACKSPACE", $idListview) Local $idItem11 = GUICtrlCreateListViewItem("{DELETE} or {DEL}|DELETE", $idListview) Local $idItem12 = GUICtrlCreateListViewItem("{UP}|Up arrow", $idListview) Local $idItem13 = GUICtrlCreateListViewItem("{DOWN}|Down arrow", $idListview) Local $idItem14 = GUICtrlCreateListViewItem("{LEFT}|Left arrow", $idListview) Local $idItem15 = GUICtrlCreateListViewItem("{RIGHT}|Right arrow", $idListview) Local $idItem16 = GUICtrlCreateListViewItem("{HOME}|HOME", $idListview) Local $idItem17 = GUICtrlCreateListViewItem("{END}|END", $idListview) Local $idItem18 = GUICtrlCreateListViewItem("{ESCAPE} or {ESC}|ESCAPE", $idListview) Local $idItem19 = GUICtrlCreateListViewItem("{INSERT} or {INS}|INS", $idListview) Local $idItem20 = GUICtrlCreateListViewItem("{PGUP}|PageUp", $idListview) Local $idItem21 = GUICtrlCreateListViewItem("{PGDN}|PageDown", $idListview) Local $idItem22 = GUICtrlCreateListViewItem("{F1} - {F12}|Function keys", $idListview) Local $idItem23 = GUICtrlCreateListViewItem("{PRINTSCREEN}|Print Screen key", $idListview) Local $idItem24 = GUICtrlCreateListViewItem("{LWIN}|Left Windows key", $idListview) Local $idItem25 = GUICtrlCreateListViewItem("{RWIN}|Right Windows key", $idListview) Local $idItem26 = GUICtrlCreateListViewItem("{NUMLOCK on}|NUMLOCK (on/off/toggle)", $idListview) Local $idItem27 = GUICtrlCreateListViewItem("{CAPSLOCK off}|CAPSLOCK (on/off/toggle)", $idListview) Local $idItem28 = GUICtrlCreateListViewItem("{SCROLLLOCK toggle}|SCROLLLOCK (on/off/toggle)", $idListview) Local $idItem29 = GUICtrlCreateListViewItem("{BREAK}|for Ctrl+Break processing", $idListview) Local $idItem30 = GUICtrlCreateListViewItem("{PAUSE}|PAUSE", $idListview) Local $idItem31 = GUICtrlCreateListViewItem("{NUMPAD0} - {NUMPAD9}|Numpad digits", $idListview) Local $idItem32 = GUICtrlCreateListViewItem("{NUMPADMULT}|Numpad Multiply", $idListview) Local $idItem33 = GUICtrlCreateListViewItem("{NUMPADADD}|Numpad Add", $idListview) Local $idItem34 = GUICtrlCreateListViewItem("{NUMPADSUB}|Numpad Subtract", $idListview) Local $idItem35 = GUICtrlCreateListViewItem("{NUMPADDIV}|Numpad Divide", $idListview) Local $idItem36 = GUICtrlCreateListViewItem("{NUMPADDOT}|Numpad period", $idListview) Local $idItem37 = GUICtrlCreateListViewItem("{NUMPADENTER}|Enter key on the numpad", $idListview) Local $idItem38 = GUICtrlCreateListViewItem("{APPSKEY}|Windows App key", $idListview) Local $idItem39 = GUICtrlCreateListViewItem("{LALT}|Left ALT key", $idListview) Local $idItem40 = GUICtrlCreateListViewItem("{RALT}|Right ALT key", $idListview) Local $idItem41 = GUICtrlCreateListViewItem("{LCTRL}|Left CTRL key", $idListview) Local $idItem42 = GUICtrlCreateListViewItem("{RCTRL}|Right CTRL key", $idListview) Local $idItem43 = GUICtrlCreateListViewItem("{LSHIFT}|Left Shift key", $idListview) Local $idItem44 = GUICtrlCreateListViewItem("{RSHIFT}|Right Shift key", $idListview) Local $idItem45 = GUICtrlCreateListViewItem("{SLEEP}|Computer SLEEP key", $idListview) Local $idItem46 = GUICtrlCreateListViewItem("{ALTDOWN}|Holds the ALT key down until {ALTUP} is sent", $idListview) Local $idItem47 = GUICtrlCreateListViewItem("{SHIFTDOWN}|Holds the SHIFT key down until {SHIFTUP} is sent", $idListview) Local $idItem48 = GUICtrlCreateListViewItem("{CTRLDOWN}|Holds the CTRL key down until {CTRLUP} is sent", $idListview) Local $idItem49 = GUICtrlCreateListViewItem("{LWINDOWN}|Holds the left Windows key down until {LWINUP} is sent", $idListview) Local $idItem50 = GUICtrlCreateListViewItem("{RWINDOWN}|Holds the right Windows key down until {RWINUP} is sent", $idListview) Local $idItem51 = GUICtrlCreateListViewItem("{ASC nnnn}|Send the ALT+nnnn key combination", $idListview) Local $idItem52 = GUICtrlCreateListViewItem("{BROWSER_BACK}|Select the browser 'back' button", $idListview) Local $idItem53 = GUICtrlCreateListViewItem("{BROWSER_FORWARD}|Select the browser 'forward' button", $idListview) Local $idItem54 = GUICtrlCreateListViewItem("{BROWSER_REFRESH}|Select the browser 'refresh' button", $idListview) Local $idItem55 = GUICtrlCreateListViewItem("{BROWSER_STOP}|Select the browser 'stop' button", $idListview) Local $idItem56 = GUICtrlCreateListViewItem("{BROWSER_SEARCH}|Select the browser 'search' button", $idListview) Local $idItem57 = GUICtrlCreateListViewItem("{BROWSER_FAVORITES}|Select the browser 'favorites' button", $idListview) Local $idItem58 = GUICtrlCreateListViewItem("{BROWSER_HOME}|Launch the browser and go to the home page", $idListview) Local $idItem59 = GUICtrlCreateListViewItem("{VOLUME_MUTE}|Mute the volume", $idListview) Local $idItem60 = GUICtrlCreateListViewItem("{VOLUME_DOWN}|Reduce the volume", $idListview) Local $idItem61 = GUICtrlCreateListViewItem("{VOLUME_UP}|Increase the volume", $idListview) Local $idItem62 = GUICtrlCreateListViewItem("{MEDIA_NEXT}|Select next track in media player", $idListview) Local $idItem63 = GUICtrlCreateListViewItem("{MEDIA_PREV}|Select previous track in media player", $idListview) Local $idItem64 = GUICtrlCreateListViewItem("{MEDIA_STOP}|Stop media player", $idListview) Local $idItem65 = GUICtrlCreateListViewItem("{MEDIA_PLAY_PAUSE}|Play/pause media player", $idListview) Local $idItem66 = GUICtrlCreateListViewItem("{LAUNCH_MAIL}|Launch the email application", $idListview) Local $idItem67 = GUICtrlCreateListViewItem("{LAUNCH_MEDIA}|Launch media player", $idListview) Local $idItem68 = GUICtrlCreateListViewItem("{LAUNCH_APP1}|Launch user app1", $idListview) Local $idItem69 = GUICtrlCreateListViewItem("{LAUNCH_APP2}|Launch user app2", $idListview) Local $idItem70 = GUICtrlCreateListViewItem("{OEM_102}|Either the angle bracket key or the backslash key on the RT 102-key keyboard", $idListview) GUISetState(@SW_SHOW) EndFunc Func CloseMacroHelp() $MacroHelpState = 0 GUIDelete($HelpTab1) EndFunc Func HelpTabs1() Global $MacroHelpState = 1 Global $MacroHelp $HelpTab1 = GUICreate("Change_Hotkeys") GUICtrlCreateTab(10, 10, 392, 382) $keystab = GUICtrlCreateTabItem("Keys") MacroHelp() GUICtrlCreateTabItem("Info") GUICtrlCreateLabel("Hotkeys will be used to control the whole program.", 15, 37, 390, 20) GUICtrlCreateLabel("Start/Stop - Will begin and pause the current macro; as a toggle function.", 15, 57, 390, 20) GUICtrlCreateLabel("Open GUI - Opens the GUI window back up when pressed; immediately cancels", 15, 77, 390, 20) GUICtrlCreateLabel("the currently running macro.", 15, 97, 390, 20) GUICtrlCreateLabel("End Program - Closes the MacroMaker program when the GUI is hidden during", 15, 117, 390, 20) GUICtrlCreateLabel("a macro.", 15, 137, 390, 20) GUICtrlCreateLabel("Open GUI key can be used whenever the GUI window is hidden.", 15, 177, 390, 20) GUICtrlCreateLabel("Start/Stop key is also used to set the coordinates for 'Get Coords'.", 15, 217, 390, 20) GUICtrlCreateTabItem("") GUICtrlSetState($keystab, $GUI_SHOW) GUISetState(@SW_SHOW) While $MacroHelpState = 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE CloseMacroHelp() EndSwitch WEnd EndFunc Func HelpTabs2() Global $MacroHelpState = 1 Global $MacroHelp $HelpTab1 = GUICreate("Create_Macro") GUICtrlCreateTab(10, 10, 392, 382) $keystab = GUICtrlCreateTabItem("Keys") MacroHelp() GUICtrlCreateTabItem("Info") GUICtrlCreateLabel("The order in which macros will execute is from top to bottom.", 15, 37, 390, 20) GUICtrlCreateLabel("All macros will begin paused on creation, Start/Stop key to activate.", 15, 57, 390, 20) GUICtrlCreateLabel("Macros will repeat indefinitely until the Start/Stop key is pressed.", 15, 77, 390, 20) GUICtrlCreateLabel("X, Y position - moves mouse to the location.", 15, 97, 390, 20) GUICtrlCreateLabel("Leftclick/Rightclick - will press the corresponding click.", 15, 117, 390, 20) GUICtrlCreateLabel("Keys - will type out anything in plain text; use {ENTER} to press the ENTER key.", 15, 137, 390, 20) GUICtrlCreateLabel("You can use {ENTER} YourMessageHere {ENTER} on a single 'Keys' line.", 15, 157, 390, 20) GUICtrlCreateLabel("Delay - sets a delay between macro functions. (in milliseconds)", 15, 177, 390, 20) GUICtrlCreateLabel("Get Coords - once pressed, use the Start/Stop key to set the coordinates.", 15, 197, 390, 20) GUICtrlCreateLabel("Leave anything you don't wish to use blank.", 15, 237, 390, 20) GUICtrlCreateLabel("", 15, 257, 390, 20) GUICtrlCreateTabItem("") GUICtrlSetState($keystab, $GUI_SHOW) GUISetState(@SW_SHOW) While $MacroHelpState = 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE CloseMacroHelp() EndSwitch WEnd EndFunc Func HelpTabs3() Global $MacroHelpState = 1 Global $MacroHelp $HelpTab1 = GUICreate("Reassign_Keys") GUICtrlCreateTab(10, 10, 392, 382) $keystab = GUICtrlCreateTabItem("Keys") MacroHelp() GUICtrlCreateTabItem("Info") GUICtrlCreateLabel("Reassign Keys will allow you to change any key into any other key or keys.", 15, 37, 390, 20) GUICtrlCreateLabel("Replace - key you want to replace.", 15, 57, 390, 20) GUICtrlCreateLabel("With - keypress to set the key as.", 15, 77, 390, 20) GUICtrlCreateLabel("The buttons to the right of each input box will clear the data and", 15, 117, 390, 20) GUICtrlCreateLabel("immediately take effect.", 15, 137, 390, 20) GUICtrlCreateTabItem("") GUICtrlSetState($keystab, $GUI_SHOW) GUISetState(@SW_SHOW) While $MacroHelpState = 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE CloseMacroHelp() EndSwitch WEnd EndFunc Func HelpTabs4() Global $MacroHelpState = 1 Global $MacroHelp $HelpTab1 = GUICreate("Key_Into_Click") GUICtrlCreateTab(10, 10, 392, 382) $keystab = GUICtrlCreateTabItem("Keys") MacroHelp() GUICtrlCreateTabItem("Info") GUICtrlCreateLabel("Key Into Click will change any keyboard key into a mouseclick.", 15, 37, 390, 20) GUICtrlCreateLabel("Turn - selected key to change.", 15, 57, 390, 20) GUICtrlCreateLabel("Into - Change the key into a click.", 15, 77, 390, 20) GUICtrlCreateLabel("Key can be held down to repeat the click until released.", 15, 97, 390, 20) GUICtrlCreateLabel("The buttons to the right of each input box will clear the data and", 15, 137, 390, 20) GUICtrlCreateLabel("immediately take effect.", 15, 157, 390, 20) GUICtrlCreateTabItem("") GUICtrlSetState($keystab, $GUI_SHOW) GUISetState(@SW_SHOW) While $MacroHelpState = 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE CloseMacroHelp() EndSwitch WEnd EndFunc Func HelpTabs5() Global $MacroHelpState = 1 Global $MacroHelp $HelpTab1 = GUICreate("Disable_Keys") GUICtrlCreateTab(10, 10, 392, 382) $keystab = GUICtrlCreateTabItem("Keys") MacroHelp() GUICtrlCreateTabItem("Info") GUICtrlCreateLabel("Disable Keys will disable any keyboard key.", 15, 37, 390, 20) GUICtrlCreateLabel("The buttons to the right of each input box will clear the data and", 15, 77, 390, 20) GUICtrlCreateLabel("immediately take effect.", 15, 97, 390, 20) GUICtrlCreateTabItem("") GUICtrlSetState($keystab, $GUI_SHOW) GUISetState(@SW_SHOW) While $MacroHelpState = 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE CloseMacroHelp() EndSwitch WEnd EndFunc ;------------------------------------------------------------------------------- MACRO HELP {END} Func Hotkeys();------------------------------------------------------------------------------- SHARED If $Hotkeys = 0 Then HotKeySet($GetStartStopNew) HotKeySet($GUIOpenNew) HotKeySet($End_Program_New) EndIf If $Hotkeys = 1 Then HotKeySet($GetStartStopNew, "Toggle") HotKeySet($GUIOpenNew, "OpenGUI") HotKeySet($End_Program_New, "End") EndIf EndFunc Func ReassignKeysNotification() MsgBox($MB_SYSTEMMODAL, "Info", "Keys Reassigned") EndFunc Func HideMacroMakerGUI() GUISetState(@SW_HIDE, $Form1) HotKeySet($GUIOpenNew, "OpenMacroMakerGUI") EndFunc Func OpenMacroMakerGUI() GUISetState(@SW_SHOW, $Form1) HotKeySet($GUIOpenNew) EndFunc Func End() $SwapState = 0 MouseClickSwap() Exit EndFunc ;------------------------------------------------------------------------------- SHARED {END} I might update the code sometime in the future to include more macro features.
      I plan to eventually clean the code up a bit
       
       
       
       
       
       
       
      MacroMaker 1.10.au3
      MacroMaker 1.10.exe
    • By Kevin Finnegan
      Hi all,
      Long time lurker and now forum poster! I'm writing a relatively simple backup script for my firm that automates the copy, compression and organization of Leaver's data on one of our secured NAS systems. I personally found the best method to do this so far was to use 7zG.exe (GUI version of 7Zip which can use command-line too) and it functions quite well!
      I would like to retrieve more info on whether any warnings or errors happen in 7Zip during the backup, but I can't quite get my head around the syntax and switches for reading out, it seems any adjustment I make to the RunWait call's string seems to break the backup or give unexpected repercussions! Hopefully its something silly I'm doing as I don't code very often.
      Here is the working version:
      ; Compress the directories one by one in the zip using the listfile.... Local $iPID = RunWait(@ScriptDir & "\bin\7zG.exe a -mx" & $compressionQuality & " -v" & $compressSplitFileSize & " -wc:\temp " _ & $backupToLocation & "\" & $userDirectory & ".7z @bin\listfile.txt -x@bin\excludefile.txt", "", @SW_SHOWDEFAULT, $STDOUT_CHILD) Ultimately I would love to switch entirely to 7za.exe (standalone) so that I can read the progress percentage, current file being uploaded and any warnings or errors could be processed and output to the AutoIT script's GUI I've created rather than jumping in and out of two applications per se.
       
    • By TheDcoder
      Hello Everyone , Are you tired of searching the forum for getting both the exit code & the stdout output? Then you are in the right place!

      With this UDF you can get the both output & exit code of the command or the console app! Or you can get the exit code of another process without having to use RunWait...
      Features:
      1. Simple & Lightweight (15 KB)
      2. Detailed comments & description
      3. Flexible functions with many optional parameters
      A BIG THANKS TO PsaltyDS for the functions! 2 of the (main) functions in the UDF are his work
       
      List of functions:
      Downloads:
      Grab the latest (in development) code from GitHub
       
      Hope it may help you, TD
       
      P.S Icon made by Freepik from www.flaticon.com, Modified by TheDcoder
    • By VIP
      Full Document: https://www.autoitscript.com/autoit3/docs/intro/running.htm
      Application used for checking CMD input into the application! (Attached with source) 


      Use: testCMD.exe CMD1 CMD2 CMD3 CMD.n..

      Quick source: 
       
      #NoTrayIcon ;~ #include <WinAPIShPath.au3> Global Const $iShow_MsgBox = 1, $iCmdLineRaw = @Compiled ? $CmdLineRaw : "" ;//; $CmdLineRaw ; StringReplace($CmdLineRaw, '/ErrorStdOut "' & @ScriptFullPath & '" ', "") Global $icmdMsgBox, $icmdConsole, $iCmdLine = _WinAPI_CommandLineToArgv($iCmdLineRaw) Global $ExeInfo = "-Execute: " & @ScriptFullPath & @CRLF & "-Working Dir: " & @WorkingDir Global $SysInfo = "> " & @OSVersion & "/" & @OSArch & "/" & @OSServicePack & " - UserName: " & @UserName & " (Is Admin = " & IsAdmin() & ")" ConsoleWrite(@CRLF & $SysInfo & @CRLF & "+ CommandLine Checker " & @CRLF) If @error Or ($iCmdLine[0] = 0) Then ConsoleWrite("! Error: no comnand line!" & @CRLF & @CRLF) If $iShow_MsgBox Then MsgBox(48 + 262144, "CommandLine Checker", "Error: no comnand line!" & @CRLF & @CRLF & $ExeInfo & @CRLF & @CRLF & $SysInfo) Exit 1 EndIf ConsoleWrite($ExeInfo & @CRLF & "+ Comnand List:" & @CRLF) For $i = 1 To $iCmdLine[0] $icmdConsole = "- CMD_" & $i & " = " & $iCmdLine[$i] & @CRLF ConsoleWrite($icmdConsole) $icmdMsgBox &= " " & $icmdConsole Next If $iShow_MsgBox Then MsgBox(64 + 262144, "CommandLine Checker", $ExeInfo & @CRLF & "+ Comnand List:" & @CRLF & $icmdMsgBox & @CRLF & @CRLF & $SysInfo) Exit 0 #Region Internal Functions :: WinAPIShPath.au3 Func _WinAPI_CommandLineToArgv($sCmd) Local $aResult[1] = [0] $sCmd = StringStripWS($sCmd, 1 + 2) ;$STR_STRIPLEADING = 1 / $STR_STRIPTRAILING = 2 If Not $sCmd Then Return $aResult EndIf Local $aRet = DllCall('shell32.dll', 'ptr', 'CommandLineToArgvW', 'wstr', $sCmd, 'int*', 0) If @error Or Not $aRet[0] Or (Not $aRet[2]) Then Return SetError(@error + 10, @extended, 0) Local $tPtr = DllStructCreate('ptr[' & $aRet[2] & ']', $aRet[0]) Dim $aResult[$aRet[2] + 1] = [$aRet[2]] For $i = 1 To $aRet[2] $aResult[$i] = _WinAPI_GetString(DllStructGetData($tPtr, 1, $i)) Next DllCall("kernel32.dll", "handle", "LocalFree", "handle", $aRet[0]) Return $aResult EndFunc ;==>_WinAPI_CommandLineToArgv Func _WinAPI_GetString($pString, $bUnicode = True) Local $iLength = _WinAPI_StrLen($pString, $bUnicode) If @error Or Not $iLength Then Return SetError(@error + 10, @extended, '') Local $tString = DllStructCreate(__Iif($bUnicode, 'wchar', 'char') & '[' & ($iLength + 1) & ']', $pString) If @error Then Return SetError(@error, @extended, '') Return SetExtended($iLength, DllStructGetData($tString, 1)) EndFunc ;==>_WinAPI_GetString Func _WinAPI_StrLen($pString, $bUnicode = True) Local $W = '' If $bUnicode Then $W = 'W' Local $aRet = DllCall('kernel32.dll', 'int', 'lstrlen' & $W, 'struct*', $pString) If @error Then Return SetError(@error, @extended, 0) Return $aRet[0] EndFunc ;==>_WinAPI_StrLen Func __Iif($bTest, $vTrue, $vFalse) Return $bTest ? $vTrue : $vFalse EndFunc ;==>__Iif #EndRegion Internal Functions :: WinAPIShPath.au3 ; * -----:| Dao Van Trong - TRONG.WIN  
      CMDtest.zip
×
×
  • Create New...