Jump to content

Recommended Posts

Posted

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
Posted

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

 

Posted (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 by Lightor
Posted

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

 

Posted

Got me there, I didn't read them, my mistake.  :oops:  I understand the moral stance on game automation and can understand why, thanks for the heads up and quick response though.  :D

Guest
This topic is now closed to further replies.
×
×
  • Create New...