Nazo Posted August 24, 2008 Share Posted August 24, 2008 This program sending F11 button each 15s but i want this program to start paused with ToolTip like in code. Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{Insert}", "Terminate") while 1 Sleep(15000) Send("{F11}") wEnd Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('P',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc I tried this and now it starts paused, but when i want to pause it i must waiting till loop end... i need code which will stop action and show me tooltip again when i paused it after unpausing Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{Insert}", "Terminate") while 1 ToolTip('P',0,0) Sleep(100) wEnd Func TogglePause() $Paused = NOT $Paused While $Paused ToolTip("") Sleep(15000) Send("{F11}") WEnd ToolTip('P',0,0) EndFunc Func Terminate() Exit 0 EndFunc Link to comment Share on other sites More sharing options...
Szhlopp Posted August 24, 2008 Share Posted August 24, 2008 (edited) This program sending F11 button each 15s but i want this program to start paused with ToolTip like in code. Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{Insert}", "Terminate") while 1 Sleep(15000) Send("{F11}") wEnd Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('P',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc I tried this and now it starts paused, but when i want to pause it i must waiting till loop end... i need code which will stop action and show me tooltip again when i paused it after unpausing Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{Insert}", "Terminate") while 1 ToolTip('P',0,0) Sleep(100) wEnd Func TogglePause() $Paused = NOT $Paused While $Paused ToolTip("") Sleep(15000) Send("{F11}") WEnd ToolTip('P',0,0) EndFunc Func Terminate() Exit 0 EndFunc Here ya go: Global $Paused = 1 ; Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{Insert}", "Terminate") while 1 Sleep(20) While $Paused = 0 ToolTip("Not very paused...", 0, 0) Sleep(15000) WEnd ToolTip('P',0,0) Sleep(100) wEnd Func TogglePause() If $Paused = 1 Then $Paused = 0 Else $Paused = 1 EndIf EndFunc Func Terminate() Exit 0 EndFunc Edited August 24, 2008 by Szhlopp RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
Nazo Posted August 24, 2008 Author Share Posted August 24, 2008 I need to have possibility of multi pausing, this code which you wrote after unpausing doesn't want to pause again Link to comment Share on other sites More sharing options...
Szhlopp Posted August 24, 2008 Share Posted August 24, 2008 I need to have possibility of multi pausing, this code which you wrote after unpausing doesn't want to pause again Errr... Try this. This enables you to pause at ANY point=) No 15sec wait expandcollapse popupGlobal $Paused = 1 ; Paused Global $Time = 0 HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{Insert}", "Terminate") AdlibEnable("Addfunction", 500) while 1 If $Paused = 1 Then ToolTip('P',0,0) Sleep(100) EndIf wEnd Func TogglePause() If $Paused = 1 Then $Paused = 0 ToolTip("") Else $Paused = 1 EndIf EndFunc Func Terminate() Exit 0 EndFunc Func Addfunction() If $Paused = 0 Then $Time += 500 If $Time = 15000 Then ; Do something here. Send("{F11}") TrayTip("NOT paused", "=)", 1) $Time = 0 EndIf EndIf EndFunc RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
Nazo Posted August 24, 2008 Author Share Posted August 24, 2008 (edited) Now it works but while clicking is active it using CPU a looot so something is still wrong ;/ edit ------------------------------------------------------------------------------ problem solved by adding sleep after "while 1" oO tnx for your help Edited August 24, 2008 by Nazo 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