Jump to content

MouseClickDrag()


Recommended Posts

My goal is to create a rather simple script for automating a simple task in a computer game through the use of MouseClickDrag(). But, I have run into a problem where, the mouse moves to the first set of coordinates, but fails to click and drag to the second set. I know that this problem is not local to this game application, because it also occurs when on the desktop attempting to drag icons.

Version 0.1

$answer = MsgBox(4, "FullAutoCraft", "Run?")
If $answer = 7 Then
    MsgBox(0, "FullAutoCraft", "Abort Successfull")
    Exit
EndIf
WinWaitActive("SwgClient")
$loop = 0
While $loop = 0
    Sleep(3000)
    MouseClickDrag("Component #1", 250, 200, 400, 200)
    SLeep(2500)
    MouseClickDrag("Component #2", 250, 200, 525, 200)
    SLeep(2500)
    MouseClickDrag("Component #3", 115, 275, 400, 350)
    Sleep(3000)
WEnd
Exit
Edited by Tiberivs
Link to comment
Share on other sites

Umm, the Helpfile defines the parameters for MouseClickDrag as:

MouseClick ( "button" [, x, y [, clicks [, speed ]]])

"Component #1", "Component #2", and "Component #3" are not buttons. For that matter, I doubt you need to click 400 and 525 times.

Edited by exodius
Link to comment
Share on other sites

Umm, the Helpfile defines the parameters for MouseClickDrag as:

MouseClick ( "button" [, x, y [, clicks [, speed ]]])

"Component #1", "Component #2", and "Component #3" are not buttons. For that matter, I doubt you need to click 400 and 525 times.

You described the parameter of MouseClick(), but not that of MouseClickDrag().

MouseClickDrag() ==> ( "button" [, x1, y1, x2, y2 [, clicks [, speed ]]])

The parameter in quotations is just whatever you choose to name the specific button right? I'll try using "button" and see if that changes anything just to be sure.

Edited by Tiberivs
Link to comment
Share on other sites

The parameter in quotations is just whatever you choose to name the specific button right? I'll try using "button" and see if that changes anything just to be sure.

You are not even close. Check the helpfile and then slap yourself, HARD! :)
Link to comment
Share on other sites

You described the parameter of MouseClick(), but not that of MouseClickDrag().

MouseClickDrag() ==> ( "button" [, x1, y1, x2, y2 [, clicks [, speed ]]])

The parameter in quotations is just whatever you choose to name the specific button right? I'll try using "button" and see if that changes anything just to be sure.

My bad, you're right, I was looking at the wrong function but... At least this has you headed in the right direction, and as AdmiralAlkex said, you're still a little off about the button convention. :)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...