dazjehyy 0 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. Share this post Link to post Share on other sites
veronesi 1 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 Share this post Link to post Share on other sites
dazjehyy 0 Posted April 23, 2010 It works, thanks. Well I was close . Share this post Link to post Share on other sites