Tiberivs Posted October 6, 2009 Share Posted October 6, 2009 (edited) 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 October 6, 2009 by Tiberivs Link to comment Share on other sites More sharing options...
exodius Posted October 7, 2009 Share Posted October 7, 2009 (edited) 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 October 7, 2009 by exodius Link to comment Share on other sites More sharing options...
Tiberivs Posted October 7, 2009 Author Share Posted October 7, 2009 (edited) 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 October 7, 2009 by Tiberivs Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted October 7, 2009 Share Posted October 7, 2009 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! .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
exodius Posted October 7, 2009 Share Posted October 7, 2009 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 More sharing options...
Tiberivs Posted October 7, 2009 Author Share Posted October 7, 2009 Okay, now the script works perfectly after correcting that Now it is time to make it a bit more complex... I highly appreciate your help guys! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now