dazjehyy Posted April 23, 2010 Share Posted April 23, 2010 Hi, I just begin AutoIT scripting and I'm very sad on it. Trying to make script what: Mouse Left click, move from mouse position to 20 coord down and Mouse Left click. I tryed this: While 1 HotKeySet("{esc}", "ExitScript") HotKeySet("1", "THarvest") WEnd Func ExitScript() Exit EndFunc $posx = MouseGetPos() $posy = MouseGetPos() Func THarvest() MouseGetPos() MouseClick("left") MouseMove($posx[0], $posy[1] 20, 10) MouseClick("left") EndFunc Can anyone who know this language better to explain what is wrong on this and how to fix it ;P. Thanks. Link to comment Share on other sites More sharing options...
veronesi Posted April 23, 2010 Share Posted April 23, 2010 (edited) Hi, try this code: ;Main Loop While 1 HotKeySet("{ESC}", "ExitScript") HotKeySet("1", "THarvest") WEnd ;Used functions Func ExitScript() ;Exit Main Loop Exit EndFunc ;==>ExitScript Func THarvest() $posX = MouseGetPos(0) ;Get x position of mouse $PosY = MouseGetPos(1) ;Get y position of mouse MouseClick("Left") ;click left MouseMove($PosX, $PosY + 20, 10) ;move mouse MouseClick("Left") ;click left EndFunc ;==>THarvest Regards Veronesi Edited April 23, 2010 by veronesi Link to comment Share on other sites More sharing options...
dazjehyy Posted April 23, 2010 Author Share Posted April 23, 2010 It works, thanks. Well I was close . Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now