Jump to content

mousecoords with var?


Recommended Posts

hi guys,

I was making a script and I was wondering if there is any way to "recall" the coords where I need them. I was thinking about this (which doesn't work of course):

$Locvar= 100, 200
mouseclick ("left", $Locvar, 2)

Maybe you guys have a way to make this possible?

Berend Jan

Link to comment
Share on other sites

$Locvar= "100, 200"
MouseClick ("left", $Locvar, 2)

You just enclose the $Locvar in quotation marks.

<{POST_SNAPBACK}>

:) This is incorrect

You cannot combine two parameters of a function into one variable! You must specify a separate variable for each parameter.

If you wanted to create your own function that takes a single string (text) paramter that contains two numbers separated by a comma, you can:

$Locvar= "100,200"
_MyMouseClick ("left", $Locvar, 2)

Func _MyMouseClick($button, $point, $clicks = 1, $speed = 10)
    Local $coords = StringSplit($point, ",")
    If UBound($coords) = 3 Then MouseClick($button, Number($coords[1]), Number($coords[2]), $clicks, $speed)
EndFunc
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
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...