Tomb Posted December 15, 2007 Posted December 15, 2007 i am trying to make a check for x and y coordinates for a control in a script, but what i have doesnt seem to work. if x is at 10 and y is at 10, i want a message box to come up. If $GetPos[0] = 10 & $GetPos[1] = 10 then MsgBox(0, "Window Stats:", "POS: " & $pos[0] & "," & $pos[1]) EndIf
Richard Robertson Posted December 15, 2007 Posted December 15, 2007 The problem is that you used &, which is the string concatenation operator in AutoIt. When using boolean operators, you literally use And and Or.
Tomb Posted December 15, 2007 Author Posted December 15, 2007 (edited) so could i do this and it work? If $GetPos[0] = 10 and $GetPos[1] = 10 then MsgBox(0, "Window Stats:", "POS: " & $pos[0] & "," & $pos[1]) EndIf im not sure but i think saying $GetPos = something isnt working. although if i do $GetPos > 10 it seems to. what is causing this. Edited December 15, 2007 by Tomb616
Valuater Posted December 15, 2007 Posted December 15, 2007 This might help#include <AutoitInfo.au3> ; Set option Opt("MouseCoordMode", 1) ;1=absolute, 0=relative, 2=client ; Get mouse position / looped While GUIGetMsg() <> -3 $GetPos = MouseGetPos() _AutoitInfoDisplay($GetPos, "MouseGetPos", 2) If $GetPos[0] = 10 and $GetPos[1] = 10 then MsgBox(0, "Window Stats:", "POS: " & $GetPos[0] & "," & $GetPos[1]) EndIf Sleep(10) WEndAutoitInfo.au3 located here...http://www.autoitscript.com/forum/index.ph...st&p=4468418)8)
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