Jump to content

Recommended Posts

Posted

Is my code right for moving mouse automatically and then press right click?

HotKeySet("{=}", "_First")
HotKeySet("{ESC}", "_Quit")

Func _First()
MouseClick("right",304,278,1,5)
(Sleep 6500)
MouseClick("right",304,278,1,5)
(Sleep 6000)
MouseClick("right",304,278,1,5)
(Sleep 4000)
MouseClick("right",304,278,1,5)
  EndFunc

Func _Quit()
    Exit
EndFunc
Posted (edited)

It right clicks four times without moving so it you move it returns back to 304,278. It go pretty fast when doing it as it usually does it at 10 not 5 (1 being fast and it keeps slowing down)

Ahhh, Also changing the (Sleep <number>) to the correct way Sleep(<number>)

Edited by TerarinKerowyn

Contact via MSN: [email=terarink_msn@hotmail.com]terarink_msn@hotmail.com[/email], yahoo: terarink_yah

Posted

Is my code right for moving mouse automatically and then press right click?

HotKeySet("{=}", "_First")
HotKeySet("{ESC}", "_Quit")

Func _First()
MouseClick("right",304,278,1,5)
(Sleep 6500)
MouseClick("right",304,278,1,5)
(Sleep 6000)
MouseClick("right",304,278,1,5)
(Sleep 4000)
MouseClick("right",304,278,1,5)
  EndFunc

Func _Quit()
    Exit
EndFunc
Try this

HotKeySet("{=}", "_First")
HotKeySet("{ESC}", "_Quit")

While 1
    Sleep(10)
WEnd

Func _First()
    MouseClick("right", 304, 278, 1, 5)
    Sleep(6500)
    MouseClick("right", 304, 278, 1, 5)
    Sleep(6000)
    MouseClick("right", 304, 278, 1, 5)
    Sleep(4000)
    MouseClick("right", 304, 278, 1, 5)
EndFunc   ;==>_First

Func _Quit()
    Exit
EndFunc   ;==>_Quit

If your are wondering about the sleep inside the While-Wend loop, delete it and look at the CPU Usage in Windows Task Manager. CPU goes to 100% without the Sleep().

Without the loop your script would be run and finished in milliseconds.

Posted

Another question about my script:

MouseClick("right", 304, 278, 1, 5)

what does 1, 5 means? speed of mouse?

and also, how can my script run continuously.?

Posted

Lookup the function MouseClick

MouseClick ( "button" [, x, y [, clicks [, speed ]]] )

Also to run continously you'll need to put the Loop in there with a Sleep(100)

100 or 250 can be better if you want to use your PC while running that because it is .1 or .25 of a second. 10 is .01 of a second and must run through the loop 10 times else 25 times more

Contact via MSN: [email=terarink_msn@hotmail.com]terarink_msn@hotmail.com[/email], yahoo: terarink_yah

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...