Jump to content

Recommended Posts

Posted

Okay so mouseclick apparently can't handle arrays or variables:

$temp1 = "619 , 755"
    $temp = $Positions[13][1]
    MsgBox(64, "Test", $temp)
    MouseClick("right" , $temp1 , 1)
                MouseClick("right" , $temp , 1)

The array contains 619 , 755 and so does the temp1 variable... What's the issue? The script just rolls the mouse to the top mid of the screen and rclicks.

-Jace

Posted (edited)

$temp1 is just a string with a comma in it, and is treated as a single parameter when used in a function-call.

MouseClick("right" , "619 , 755", 1)

$temp is an array, but I can't find anywhere in the helpfile where it states that MouseClick can be passed an

array. The issue isn't on AutoIt's part but on yours.

Edited by Helge
Posted

$temp1 is just a string with a comma in it, and is treated as a single parameter when used in a function-call.

MouseClick("right" , "619 , 755", 1)

$temp is an array, but I can't find anywhere in the helpfile where it states that MouseClick can be passed an

array. The issue isn't on AutoIt's part but on yours.

So there is no way to read mouse coordinates from an INI file and pass them to MouseClick?
Posted (edited)

Of course there is. If you're having it in the format as shown in $temp1 you can just INIRead it and then StringSplit it.

$coords = INIRead(..)
$coords = StringSplit($coords, ",")
; error-checking...
MouseClick("right" , $coords[1], $coords[2], 1)

Something like that..

Edited by Helge
Posted

Worked like a charm THANK YOU so MUCH! I really can't explain to you how much trouble you saved me! I might actually pass Comp IV in my High School after all!

-Jace

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
  • Recently Browsing   0 members

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