Lightor Posted December 13, 2014 Posted December 13, 2014 Hey guys, I've been able to research most things I've been trying to do but this one has stumped me. I have 2 mouse captures, then I want to move from one to the other while clicking and I can't seem to get it. I can move then click but thats about it. Right now this is where I'm at. MouseMove($mousePos1[0], $mousePos1[1], 0) MouseMove($mousePos2[0], $mousePos2[1], 75) $tempMousePos = MouseGetPos() While Not ($tempMousePos[0] == $mousePos2[0] and $tempMousePos[1] == $mousePos2[1]) MouseClick("Left") Sleep(250) $tempMousePos = MouseGetPos() WEnd
alienclone Posted December 13, 2014 Posted December 13, 2014 have you looked at any of the other mouse functions? like mouseclickdrag, or mousedown and mouseup? If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version
water Posted December 13, 2014 Posted December 13, 2014 Welcome to AutoIt and the forum! Can you please tell us which program you try to automate? We then can provide a solution (hiopefully) that suits your needs. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Lightor Posted December 13, 2014 Author Posted December 13, 2014 (edited) I was trying to automate clicks in a game, clicking possible fishing spots while moving along the water. I ended up using this, not sure if its the most efficient way but it works. Although if there's a better way I'd be very interested in learning it. While $endLoop == False ControlSend($hwnd, "", "", "r") MouseMove($mousePos1[0], $mousePos1[1], 0) Sleep(100) MouseClick("Left") Sleep(250) For $p = 0.1 To 1 Step + 0.05 $xDif = Abs($mousePos1[0] - $mousePos2[0]) $yDif = Abs($mousePos1[1] - $mousePos2[1]) If $mousePos1[0] > $mousePos2[0] Then $xDif = $xDif * -1 EndIf If $mousePos1[1] > $mousePos2[1] Then $yDif = $yDif * -1 EndIf MouseMove($mousePos1[0] + $xDif * $p, $mousePos1[1] + $yDif * $p, 25) Sleep(10) MouseClick("Left") Sleep(250) Next Call("sleeper", 8) WEnd Edited December 13, 2014 by Lightor
water Posted December 13, 2014 Posted December 13, 2014 Seems you missed to read the forum rules on your way in. The rules do not allow game automation of any kind. A link to the rules can be found in the lower right corner of each page. So that's why you will not get any help on the subject. Hope to see you with a legitimate question soon My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Lightor Posted December 13, 2014 Author Posted December 13, 2014 Got me there, I didn't read them, my mistake. I understand the moral stance on game automation and can understand why, thanks for the heads up and quick response though.
Recommended Posts