Hendricius Posted October 17, 2006 Share Posted October 17, 2006 How is this possible. I am completly new. HotKeySet("b","beenden"); func beenden() Exit EndFunc thats the function i use to exit the programm. It would be bether to just pause the programm. The second part: i need a function to continue running the programm. Help please thanks Link to comment Share on other sites More sharing options...
Kickassjoe Posted October 17, 2006 Share Posted October 17, 2006 after you exit you cant start running the program again... What goes around comes around... Payback's a bitch. Link to comment Share on other sites More sharing options...
cppman Posted October 17, 2006 Share Posted October 17, 2006 (edited) this should work: expandcollapse popupHotKeySet("{F9}", "TogglePause") Global $PAUSED = False While 1 sleep(10) while ($PAUSED) sleep(100) ;The Code is paused. WEnd ;Put your normal code here WEnd Func TogglePause() if ($PAUSED == False) Then $PAUSED = True Else $Paused = False EndIf EndFunc oÝ÷ Ù©Ýiû¥ìZ^jëh×6 HotKeySet("{F9}", "TogglePause") Global $PAUSED = False GLobal $INT = 0 $d = GUICreate("Test") $lab = GUICtrlCreateLabel("Not Paused", 10, 10) $lab2 = GUICtrlCreateLabel($INT, 10, 40, 200) GUISetState() While 1 sleep(10) while ($PAUSED) sleep(100) ;The Code is paused. if (GUICtrlRead($lab) == "Not Paused") Then GUICtrlSetData($lab, "Paused!") WEnd if (GUICtrlRead($lab) == "Paused!") Then GUICtrlSetData($lab, "Not Paused") ;Put your normal code here $INT += 1 GUICtrlSetData($lab2, $INT) WEnd Func TogglePause() if ($PAUSED == False) Then $PAUSED = True Else $Paused = False EndIf EndFunc Edited October 17, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
Hendricius Posted October 17, 2006 Author Share Posted October 17, 2006 after you exit you cant start running the program again...yep. thats why i asked for a function that just pauses the programm and a function to start running the programm. Link to comment Share on other sites More sharing options...
Hendricius Posted October 17, 2006 Author Share Posted October 17, 2006 ; copy any you want to change ;default value is listed firstPixel WinActivate("Warcraft III") HotKeySet("b","beenden"); HotKeySet("p", "TogglePause") Global $PAUSED = False While 1 sleep(10) while ($PAUSED) sleep(100) WEnd Sleep(5000); Send("!a"); Send("{F10}"); Send("!e"); Send("!q"); MouseClick("left",1018,942,1,1); WEnd func beenden() Exit EndFunc Func TogglePause() if ($PAUSED == False) Then $PAUSED = True Else $Paused = False EndIf EndFunc this is my code... The pause doesnt work.. Additionatly i would like the part Sleep(5000); Send("!a"); Send("{F10}"); Send("!e"); Send("!q"); MouseClick("left",1018,942,1,1); to run as an infinite loop. Thanks for your patience + help. Link to comment Share on other sites More sharing options...
cppman Posted October 17, 2006 Share Posted October 17, 2006 (edited) It works.. Its just that, the Sleep(5000), is keeping you from noticing. Edited October 17, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
Hendricius Posted October 17, 2006 Author Share Posted October 17, 2006 It works.. Its just that, the Sleep(5000), is keeping you from noticing.hehe sorry... but it keeps running. 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