Jump to content

Problem - on/off function?


AzGuL^
 Share

Recommended Posts

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 )

Return

EndFunc

while (1)

clicker()

wend

Link to comment
Share on other sites

Try this ;)

Global $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 by Matrix112
Link to comment
Share on other sites

Thanks, but where to place it? :P 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 by ligenza
Link to comment
Share on other sites

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 :P

EDIT; How to make it then? ;)

Edited by AzGuL^
Link to comment
Share on other sites

Try this :mad2:

$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
I don't understand :P I tried it, and now it doesn't even start ;)
Link to comment
Share on other sites

F1 to Pause

F2 to Exit

HotKeySet("{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

F1 to Pause

F2 to Exit

HotKeySet("{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
Working one, thank you very much! ;)
Link to comment
Share on other sites

This should work too. Now i testet it. ;)

Global $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 by Matrix112
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...