Skizot Posted September 3, 2007 Share Posted September 3, 2007 (edited) Global $Paused #include <GUIConstants.au3> GUICreate("Custom Game Text Repeater.", 245, 140) $Label = GUICtrlCreateLabel("Message", 10, 10) $YesID = GUICtrlCreateButton("Start/Stop", 90, 110, 75, 20) $SpamMsg = GuiCtrlCreateInput("Message", 10, 25, 225, 20) $LabelStatus = GuiCtrlCreateLabel("", 50, 55, 131, 21) GUISetState(); display the GUI Do $msg = GUIGetMsg() Select Case $msg= $YesID TogglePause() EndSelect Until $msg = $GUI_EVENT_CLOSE Func TogglePause() $Paused = Not $Paused While $Paused Sleep(10000) Send("{ENTER}") Sleep(10) Send((GUICtrlRead($SpamMsg))) Sleep(10) Send("{ENTER}") WEnd EndFunc This STARTS.... but never stops.... EVER.... heh when i click the button to stop it just keeps going. any ideas on how to make it stop? even if it's a stop button that ends the loop? Edited September 3, 2007 by Skizot Link to comment Share on other sites More sharing options...
JustinReno Posted September 3, 2007 Share Posted September 3, 2007 Shouldn't it stop if you click the red x? Link to comment Share on other sites More sharing options...
Skizot Posted September 3, 2007 Author Share Posted September 3, 2007 it does nothing. just keeps running. Link to comment Share on other sites More sharing options...
flip209 Posted September 3, 2007 Share Posted September 3, 2007 (edited) This one work use ESC to exitCODEGlobal $Paused #include <GUIConstants.au3> #include <Misc.au3> GUICreate("Custom Game Text Repeater.", 245, 140) $Label = GUICtrlCreateLabel("Message", 10, 10) $YesID = GUICtrlCreateButton("Start/Stop", 90, 110, 75, 20) $SpamMsg = GuiCtrlCreateInput("Message", 10, 25, 225, 20) $LabelStatus = GuiCtrlCreateLabel("", 50, 55, 131, 21) $dll = DllOpen("user32.dll") GUISetState(); display the GUI Func TogglePause() $read = GUICtrlRead($SpamMsg) While 1 if _IsPressed("1B",$dll) then ExitLoop Sleep(100) Send("{ENTER}") Sleep(10) ;Send($read) MsgBox(0,"",$read) Sleep(10) Send("{ENTER}") WEnd EndFunc while 1 $msg = GUIGetMsg() Select case $msg = $GUI_EVENT_CLOSE Exit Case $msg= $YesID $t = 1 call("TogglePause") EndSelect WEnd Editted sorry placement was off Edited September 3, 2007 by flip209 " I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln Link to comment Share on other sites More sharing options...
Skizot Posted September 3, 2007 Author Share Posted September 3, 2007 is there no way to make it stop via the button? Link to comment Share on other sites More sharing options...
flip209 Posted September 3, 2007 Share Posted September 3, 2007 Try this oneCODEGlobal $Paused #include <GUIConstants.au3> #include <Misc.au3> GUICreate("Custom Game Text Repeater.", 245, 140) $Label = GUICtrlCreateLabel("Message", 10, 10) $YesID = GUICtrlCreateButton("Start/Stop", 90, 110, 75, 20) $SpamMsg = GuiCtrlCreateInput("Message", 10, 25, 225, 20) $LabelStatus = GuiCtrlCreateLabel("", 50, 55, 131, 21) $dll = DllOpen("user32.dll") GUISetState(); display the GUI Func TogglePause() $read = GUICtrlRead($SpamMsg) While 1 if _IsPressed("1B",$dll) then ExitLoop Sleep(100) Send("{ENTER}") Sleep(10) ;Send($read) MsgBox(0,"",$read) Sleep(10) Send("{ENTER}") WEnd EndFunc while 1 $msg = GUIGetMsg() Select case $msg = $GUI_EVENT_CLOSE Exit Case $msg= $YesID $t = 1 call("TogglePause") EndSelect WEnd " I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln Link to comment Share on other sites More sharing options...
Skizot Posted September 3, 2007 Author Share Posted September 3, 2007 (edited) still nothing.... your message box might be slowing it down. try the send with the cursor in the message box. see if you can make it stop. also this timer should be random between 30-45 seconds. also i made it change the label if it works. All it says is running...... expandcollapse popupGlobal $Paused #include <GUIConstants.au3> #include <Misc.au3> GUICreate("Custom Game Text Repeater.", 245, 140) $Label = GUICtrlCreateLabel("Message", 10, 10) $YesID = GUICtrlCreateButton("Start/Stop", 90, 110, 75, 20) $SpamMsg = GuiCtrlCreateInput("Message", 10, 25, 225, 20) $LabelStatus = GuiCtrlCreateLabel("", 50, 55, 131, 21) $dll = DllOpen("user32.dll") GUISetState(); display the GUI Func TogglePause() $read = GUICtrlRead($SpamMsg) While 1 GuiCtrlSetData($LabelStatus, "") if _IsPressed("1B",$dll) then ExitLoop GuiCtrlSetData($LabelStatus, "running....") Sleep(10000) Send("{ENTER}") Sleep(10) Send($read) ;MsgBox(0,"",$read) Sleep(10) Send("{ENTER}") GuiCtrlSetData($LabelStatus, "End Loop...") WEnd EndFunc while 1 $msg = GUIGetMsg() Select case $msg = $GUI_EVENT_CLOSE Exit Case $msg= $YesID $t = 1 call("TogglePause") EndSelect WEnd Edited September 3, 2007 by Skizot Link to comment Share on other sites More sharing options...
flip209 Posted September 3, 2007 Share Posted September 3, 2007 It works now you have to hold down f12 (changed the button so program would not exit) because you have a sleep of 1000 it has to finisht that until it is done. And you had the label in the wrong place. CODEGlobal $Paused #include <GUIConstants.au3> #include <Misc.au3> GUICreate("Custom Game Text Repeater.", 245, 140) $Label = GUICtrlCreateLabel("Message", 10, 10) $YesID = GUICtrlCreateButton("Start/Stop", 90, 110, 75, 20) $SpamMsg = GuiCtrlCreateInput("Message", 10, 25, 225, 20) $LabelStatus = GuiCtrlCreateLabel("", 50, 55, 131, 21) $dll = DllOpen("user32.dll") GUISetState(); display the GUI Func TogglePause() $read = GUICtrlRead($SpamMsg) While 1 GuiCtrlSetData($LabelStatus, "") if _IsPressed("7B",$dll) then GuiCtrlSetData($LabelStatus, "End Loop...") ExitLoop EndIf GuiCtrlSetData($LabelStatus, "running....") Sleep(10000) Send("{ENTER}") Sleep(10) Send($read) ;MsgBox(0,"",$read) Sleep(10) Send("{ENTER}") GuiCtrlSetData($LabelStatus, "End Loop...") WEnd EndFunc while 1 $msg = GUIGetMsg() Select case $msg = $GUI_EVENT_CLOSE Exit Case $msg= $YesID $t = 1 call("TogglePause") EndSelect WEnd " I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln Link to comment Share on other sites More sharing options...
qazwsx Posted September 3, 2007 Share Posted September 3, 2007 try on event mode. Or putting a sleep in the while loop. If you are doing a lot in the while loop guis can become sluggish. Link to comment Share on other sites More sharing options...
Skizot Posted September 3, 2007 Author Share Posted September 3, 2007 that's actually pretty good. though the having to wait kinda sucks. i'm cool with it as it is... but if you can come up with a way to make it stop the second the start/stop button is pressed that would be awesome. thanks for your help so far Link to comment Share on other sites More sharing options...
Skizot Posted September 3, 2007 Author Share Posted September 3, 2007 (edited) Ignore this post figured it out. Edited September 3, 2007 by Skizot 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