Jump to content
Sign in to follow this  
trulu

[need help] what's wrong with my code >_<

Recommended Posts

trulu

what's wrong with this code?

Global $Paused
HotKeySet("{ESC}", "Terminate")
HotKeySet("{'}", "TogglePause")

Func TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(0)
ToolTip('Script is "Paused"',0,0)
WEnd
ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

$i = 0

Send("'")

While $i = 0
    Do
    ControlClick("A Client","", "", "left", 631, 453, 2)
    sleep(5000)
    ControlClick("A Client","", "", "left", 631, 453, 2)
    sleep(5000)
    ControlClick("A Client","", "", "left", 631, 453, 2)
    
    sleep(6000)
    ControlClick("A Client","", "", "middle", 0)
    sleep(1000)
    
    ControlClick("A Client","", "", "left", 639, 216, 2)
    sleep(10000)
    
    ControlClick("A Client","", "", "left", 624, 458, 2)
    sleep(5000)
    ControlClick("A Client","", "", "left", 624, 458, 2)
    sleep(5000)
    ControlClick("A Client","", "", "left", 624, 458, 2)
    
    sleep(6000)
    ControlClick("A Client", "", "", "middle", 0)
    sleep(1000)
    
    ControlClick("A Client", "", "", "left", 624, 181, 2)
    sleep(100000)
Until $i = 1
WEnd
Edited by trulu

Share this post


Link to post
Share on other sites
trulu

1) what do you want to script to do?

2) what happened instead?

3) what error do you get?

1)i want my script to send a mouse click to a curtain program while i'm browsing.

2 & 3) my script is not working right now, no error msg and doin nothing.

Share this post


Link to post
Share on other sites
VixinG

Should be: ControlClick("A Client","", "", "left", 2, 624, 458)

It was: ControlClick("A Client","", "", "left", 624, 458, 2)

Remember: ControlClick("A Client","", "", "BUTTON", CLICKS, X, Y)

fix'd:

Global $Paused
HotKeySet("{ESC}", "Terminate")
HotKeySet("{'}", "TogglePause")
Func TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(100)
ToolTip('Script is "Paused"',0,0)
WEnd
ToolTip("")
EndFunc
Func Terminate()
    Exit 0
EndFunc
Send("'")
While 1
    ControlClick("A Client","", "", "left", 2, 631, 453)
    sleep(5000)
    ControlClick("A Client","", "", "left", 2, 631, 453)
    sleep(5000)
    ControlClick("A Client","", "", "left", 2, 631, 453)
    sleep(6000)
    ControlClick("A Client","", "", "middle", 1)
    sleep(1000)
    ControlClick("A Client","", "", "left", 2, 639, 216)
    sleep(10000)
    ControlClick("A Client","", "", "left", 2, 624, 458)
    sleep(5000)
    ControlClick("A Client","", "", "left", 2, 624, 458)
    sleep(5000)
    ControlClick("A Client","", "", "left", 2, 624, 458)
    sleep(6000)
    ControlClick("A Client", "", "", "middle", 1)
    sleep(1000)
    ControlClick("A Client", "", "", "left", 2, 624, 181)
    sleep(100000)
WEnd

[indent=3][/indent]

Share this post


Link to post
Share on other sites
trulu

Should be: ControlClick("A Client","", "", "left", 2, 624, 458)

It was: ControlClick("A Client","", "", "left", 624, 458, 2)

Remember: ControlClick("A Client","", "", "BUTTON", CLICKS, X, Y)

fix'd:

Global $Paused
HotKeySet("{ESC}", "Terminate")
HotKeySet("{'}", "TogglePause")
Func TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(100)
ToolTip('Script is "Paused"',0,0)
WEnd
ToolTip("")
EndFunc
Func Terminate()
    Exit 0
EndFunc
Send("'")
While 1
    ControlClick("A Client","", "", "left", 2, 631, 453)
    sleep(5000)
    ControlClick("A Client","", "", "left", 2, 631, 453)
    sleep(5000)
    ControlClick("A Client","", "", "left", 2, 631, 453)
    sleep(6000)
    ControlClick("A Client","", "", "middle", 1)
    sleep(1000)
    ControlClick("A Client","", "", "left", 2, 639, 216)
    sleep(10000)
    ControlClick("A Client","", "", "left", 2, 624, 458)
    sleep(5000)
    ControlClick("A Client","", "", "left", 2, 624, 458)
    sleep(5000)
    ControlClick("A Client","", "", "left", 2, 624, 458)
    sleep(6000)
    ControlClick("A Client", "", "", "middle", 1)
    sleep(1000)
    ControlClick("A Client", "", "", "left", 2, 624, 181)
    sleep(100000)
WEnd

woah thx vixing, it's working now :oops:

Share this post


Link to post
Share on other sites
VixinG

I'm glad I could help :oops:


[indent=3][/indent]

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.