toanhung Posted May 16, 2012 Share Posted May 16, 2012 basicly i wanna hit a button and it start to send key, and that same button turn to stop and hit it again it stop sending key,, im still have hard time how to make it stop .. thank for anyhelp expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Hung", 131, 273, 192, 114) $Label1 = GUICtrlCreateLabel("Combo Retarget Loot", 16, 16, 105, 17) $Button1 = GUICtrlCreateButton("ComRe", 16, 40, 99, 25) $Label2 = GUICtrlCreateLabel("Combo Loot", 32, 80, 61, 17) $Label3 = GUICtrlCreateLabel("Bm3 Retarget Loot", 16, 152, 93, 17) $Button2 = GUICtrlCreateButton("ComLo", 16, 112, 99, 25) $Button3 = GUICtrlCreateButton("Bm3Re", 16, 176, 99, 25) $Label4 = GUICtrlCreateLabel("Bm3 Loot", 40, 216, 49, 17) $Button4 = GUICtrlCreateButton("Bm3Lo", 16, 240, 99, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button1 ComRe() EndSwitch Sleep(100) WEnd Func ComRe() If GUICtrlRead($Button1) = "ComRe" Then ; GUICtrlSetData($Button1, "STOP") ; $xx1 = 1 ; Else GUICtrlSetData($Button1, "ComRe") ; $xx1 = 0 ; EndIf ; While $xx1 = 1; $ComRe = 1 Send("5") Send("z") Send("0") sleep (500) WEnd EndFunc Func stop() $xx1 = 0 ; ComRe = False GUICtrlSetData($Button1, "ComRe") Exit EndFunc ;==>stop Link to comment Share on other sites More sharing options...
smashly Posted May 17, 2012 Share Posted May 17, 2012 Hi, #include <GUIConstantsEx.au3> $Form1 = GUICreate("Hung", 131, 273, 192, 114) $Label1 = GUICtrlCreateLabel("Combo Retarget Loot", 16, 16, 105, 17) $Button1 = GUICtrlCreateButton("ComRe", 16, 40, 99, 25) $Label2 = GUICtrlCreateLabel("Combo Loot", 32, 80, 61, 17) $Label3 = GUICtrlCreateLabel("Bm3 Retarget Loot", 16, 152, 93, 17) $Button2 = GUICtrlCreateButton("ComLo", 16, 112, 99, 25) $Button3 = GUICtrlCreateButton("Bm3Re", 16, 176, 99, 25) $Label4 = GUICtrlCreateLabel("Bm3 Loot", 40, 216, 49, 17) $Button4 = GUICtrlCreateButton("Bm3Lo", 16, 240, 99, 25) GUISetState(@SW_SHOW, $Form1) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button1 If GUICtrlRead($Button1) = "ComRe" Then AdlibRegister("ComRe", 500) GUICtrlSetData($Button1, "STOP") Else AdlibUnRegister("ComRe") GUICtrlSetData($Button1, "ComRe") EndIf EndSwitch WEnd Func ComRe() Send("5") Send("z") Send("0") EndFunc ;==>ComRe Cheers Link to comment Share on other sites More sharing options...
toanhung Posted May 18, 2012 Author Share Posted May 18, 2012 one more question if you can help too.. let say i wanna send those key for 40 times then stop for 5 hour then send again loop thank for any help Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now