Jump to content
Sign in to follow this  
AzGuL^

Problem - on/off function?

Recommended Posts

AzGuL^

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

Share this post


Link to post
Share on other sites
Matrix112

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

Share this post


Link to post
Share on other sites
AzGuL^

Thanks, but where to place it? :P I placed it at the bottom, but didn't work ;)

Share this post


Link to post
Share on other sites
ligenza

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

Share this post


Link to post
Share on other sites
AzGuL^

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^

Share this post


Link to post
Share on other sites
AzGuL^

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 ;)

Share this post


Link to post
Share on other sites
Matrix112
CWW256

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

Share this post


Link to post
Share on other sites
AzGuL^

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! ;)

Share this post


Link to post
Share on other sites
Matrix112

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

Share this post


Link to post
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
Sign in to follow this  

×