Jump to content
eazyjay

How do i set mouse point?

Recommended Posts

eazyjay

Hey guys, i've been searching for a long time now but i still cannot find what i am looking for.

What i need the script to do is allow me to set a mouse location point somewhere with button 1.

After that i want to press 2 (take it from pause) so the script will start, and bring the mouse to the set location and

right click it, go 50 pixels down and left click there. As last it sends a 2 to pause the script again.  Button 3 activates the Attackloop and Alt + Q Exit's the script.

 

I've come pretty far but i am really stuck at this point. When I press 1 it shows my msgbox with the mouse positions. But those positions aren't saved. When i press 3 my script wont run and gives me the following error:  .au3" (27) : ==> Variable used without being declared.:
MouseMove($MousePos[0], $MousePos[1], 1)
MouseMove(^ ERROR
>Exit code: 1    Time: 7.797

Can anybody help me please?

So far i have created the following script:

HotKeySet("!q", "Terminate")
HotKeySet("1", "getloc")
HotKeySet("2", "_Continue")
HotKeySet("3", "attackLoop")

Dim $binFlag = True


Func Terminate()
   Exit 1
EndFunc

Func getloc()
$MousePos = MouseGetPos()
$MousePos[0] ; Mouse X position
$MousePos[1] ; Mouse Y position
msgbox(0,"Debug","Cursor located at " & $MousePos[0] & "," & $MousePos[1])
EndFunc

Func _Continue()
    $binFlag = Not $binFlag
EndFunc

Func attackLoop()
   While 1
      sleep(1000)
             MouseMove($MousePos[0], $MousePos[1], 1)
             sleep(5000)

         $MousePos[1] = $MousePos[1] -50          ; Moves 50 pixels down of the original coordinate
          MouseMove($MousePos[0], $MousePos[1])
          Sleep( 200 )

          MouseClick( "Left" )
          sleep (200)

          Send("2")
          sleep(1000)

          EndIf
          Sleep(50)

   WEnd
EndFunc



While 1
   sleep(250)
WEnd

 

Share this post


Link to post
Share on other sites
FrancescoDiMuro

@eazyjay

Welcome to the AutoIt forum :)

Seems that you missed the Forum Rules.

Take a look before posting :)


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites
eazyjay

So where do i go with this question ;S just need help lol

Share this post


Link to post
Share on other sites
Jos
2 minutes ago, eazyjay said:

So where do i go with this question ;S just need help lol

Understood... but not in these forums....  sorry, but "we have been there, seen it and have way too many T-Shirts". :)

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×