Jump to content

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


Recommended Posts

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
Link to post
Share on other sites

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.

Link to post
Share on other sites

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]

Link to post
Share on other sites

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:
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...