AzGuL^ Posted September 30, 2005 Share Posted September 30, 2005 How can I change the function below, so that I am able to turn it on/off by pressing a button. Like "Pause" button for instance.Func clicker () MouseMove ( 66, 404 ) MouseClick( "left", 66, 404 ) Sleep ( 200 ) MouseMove ( 339, 404 ) MouseClick( "left", 339, 404 ) Sleep ( 200 ) MouseMove ( 613, 404 ) MouseClick( "left", 613, 404 ) Sleep ( 200 ) MouseMove ( 896, 404 ) MouseClick( "left", 896, 404 ) Sleep ( 200 ) MouseMove ( 1188, 404 ) MouseClick( "left", 118, 404 ) Sleep ( 200 ) ReturnEndFuncwhile (1)clicker()wend Link to comment Share on other sites More sharing options...
Matrix112 Posted September 30, 2005 Share Posted September 30, 2005 (edited) Try this expandcollapse popupGlobal $t = 0 While 1;keeps it alive HotKeySet("^{PAUSE}", "start");crtl + pause HotKeySet("{PAUSE}", "stop");pause sleep(35) Wend Func start () Do clicker() Until $t = 1 $t = 0 EndFunc Func stop() $t=1 EndFunc Func clicker () MouseMove ( 66, 404 ) MouseClick( "left", 66, 404 ) Sleep ( 200 ) MouseMove ( 339, 404 ) MouseClick( "left", 339, 404 ) Sleep ( 200 ) MouseMove ( 613, 404 ) MouseClick( "left", 613, 404 ) Sleep ( 200 ) MouseMove ( 896, 404 ) MouseClick( "left", 896, 404 ) Sleep ( 200 ) MouseMove ( 1188, 404 ) MouseClick( "left", 118, 404 ) Sleep ( 200 ) EndFunc Edited September 30, 2005 by Matrix112 Link to comment Share on other sites More sharing options...
AzGuL^ Posted September 30, 2005 Author Share Posted September 30, 2005 Thanks, but where to place it? I placed it at the bottom, but didn't work Link to comment Share on other sites More sharing options...
ligenza Posted September 30, 2005 Share Posted September 30, 2005 (edited) Thanks, but where to place it? I placed it at the bottom, but didn't work At the top! And that code won't work anyway. You need an actual pause script. Unless you just want it to run when you press Pause, if that's the cause then remove the function call in the while loop. Edited September 30, 2005 by ligenza Link to comment Share on other sites More sharing options...
AzGuL^ Posted September 30, 2005 Author Share Posted September 30, 2005 (edited) At the top! And that code won't work anyway. You need an actual pause script. Unless you just want it to run when you press Pause, if that's the cause then remove the function call in the while loop.HotKeySet("{PAUSE}", "clicker")Func clicker ()... rest ofc ....Like this? If yes, it do not work EDIT; How to make it then? Edited September 30, 2005 by AzGuL^ Link to comment Share on other sites More sharing options...
Matrix112 Posted September 30, 2005 Share Posted September 30, 2005 Look in my edited post Link to comment Share on other sites More sharing options...
AzGuL^ Posted September 30, 2005 Author Share Posted September 30, 2005 Try this expandcollapse popup$t = 0 While 1;keeps it alive HotKeySet("^{PAUSE}", "start");crtl + pause HotKeySet("{PAUSE}", "stop");pause sleep(35) Wend Func start () Do clicker() Until $t = 1 $t = 0 EndFunc Func stop() $t=1 EndFunc Func clicker () MouseMove ( 66, 404 ) MouseClick( "left", 66, 404 ) Sleep ( 200 ) MouseMove ( 339, 404 ) MouseClick( "left", 339, 404 ) Sleep ( 200 ) MouseMove ( 613, 404 ) MouseClick( "left", 613, 404 ) Sleep ( 200 ) MouseMove ( 896, 404 ) MouseClick( "left", 896, 404 ) Sleep ( 200 ) MouseMove ( 1188, 404 ) MouseClick( "left", 118, 404 ) Sleep ( 200 ) EndFuncI don't understand I tried it, and now it doesn't even start Link to comment Share on other sites More sharing options...
Matrix112 Posted September 30, 2005 Share Posted September 30, 2005 I edited my first post again. I wrote this in the board so there are some errors in. This should now work. Use "Crtl + pause" to start it and "Pause" to stop it. Link to comment Share on other sites More sharing options...
AzGuL^ Posted September 30, 2005 Author Share Posted September 30, 2005 It does not Link to comment Share on other sites More sharing options...
CWW256 Posted September 30, 2005 Share Posted September 30, 2005 F1 to Pause F2 to Exit expandcollapse popupHotKeySet("{F1}", "ScriptPause") HotKeySet("{F2}", "KillScript") Global $Paused = 0 while 1 Clicker() wend Func clicker () MouseMove ( 66, 404 ) MouseClick( "left", 66, 404 ) Sleep ( 200 ) MouseMove ( 339, 404 ) MouseClick( "left", 339, 404 ) Sleep ( 200 ) MouseMove ( 613, 404 ) MouseClick( "left", 613, 404 ) Sleep ( 200 ) MouseMove ( 896, 404 ) MouseClick( "left", 896, 404 ) Sleep ( 200 ) MouseMove ( 1188, 404 ) MouseClick( "left", 118, 404 ) Sleep ( 200 ) EndFunc Func ScriptPause() $Paused = NOT $Paused While $Paused = 1 Sleep(1000) WEnd EndFunc Func KillScript() Exit EndFunc Link to comment Share on other sites More sharing options...
AzGuL^ Posted September 30, 2005 Author Share Posted September 30, 2005 F1 to PauseF2 to Exitexpandcollapse popupHotKeySet("{F1}", "ScriptPause") HotKeySet("{F2}", "KillScript") Global $Paused = 0 while 1 Clicker() wend Func clicker () MouseMove ( 66, 404 ) MouseClick( "left", 66, 404 ) Sleep ( 200 ) MouseMove ( 339, 404 ) MouseClick( "left", 339, 404 ) Sleep ( 200 ) MouseMove ( 613, 404 ) MouseClick( "left", 613, 404 ) Sleep ( 200 ) MouseMove ( 896, 404 ) MouseClick( "left", 896, 404 ) Sleep ( 200 ) MouseMove ( 1188, 404 ) MouseClick( "left", 118, 404 ) Sleep ( 200 ) EndFunc Func ScriptPause() $Paused = NOT $Paused While $Paused = 1 Sleep(1000) WEnd EndFunc Func KillScript() Exit EndFuncWorking one, thank you very much! Link to comment Share on other sites More sharing options...
Matrix112 Posted September 30, 2005 Share Posted September 30, 2005 (edited) This should work too. Now i testet it. expandcollapse popupGlobal $t = 0 HotKeySet("!{PAUSE}", "clicker");Alt + pause HotKeySet("{PAUSE}", "stop");pause HotKeySet("!{ESC}", "End");Alt + esc While 1;keeps it alive sleep(100) Wend Func stop() $t=1 EndFunc Func clicker() Do MouseMove ( 66, 404 ) MouseClick( "left", 66, 404 ) Sleep ( 200 ) MouseMove ( 339, 404 ) MouseClick( "left", 339, 404 ) Sleep ( 200 ) MouseMove ( 613, 404 ) MouseClick( "left", 613, 404 ) Sleep ( 200 ) MouseMove ( 896, 404 ) MouseClick( "left", 896, 404 ) Sleep ( 200 ) MouseMove ( 1188, 404 ) MouseClick( "left", 118, 404 ) Sleep ( 200 ) Sleep(20) Until $t = 1 $t = 0 EndFunc Func End () Exit EndFunc Edited September 30, 2005 by Matrix112 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