How to use output variable, % symbols? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Grimmy

How to use output variable, % symbols?

03 Jun 2018, 00:45

F5::
{
PixelSearch, Px, Py, 0, 0, 960, 540, 0xFF6600, 3, Fast
if ErrorLevel
MsgBox, That color was not found in the specified region.
else
MsgBox, A color within 3 shades of variation was found at X%Px% Y%Py%.
MouseMove, % Px, % Py , 1
}

Why is it that in the MsgBox command, I can use %Px% and %Py%.
But in MouseMove command I cannot use %Px% and %Py%? And must use % Px, % Py spaced exactly so? :crazy:
Thankyou!
garry
Posts: 3770
Joined: 22 Dec 2013, 12:50

Re: How to use output variable, % symbols?  Topic is solved

03 Jun 2018, 04:34

note , must use brackets if you have more then 1 line ( if ... else ) , in this case after else
(didn't tested )

Code: Select all

F5::
PixelSearch, Px, Py, 0, 0, 960, 540, 0xFF6600, 3, Fast
if ErrorLevel
   MsgBox, That color was not found in the specified region.
else
   {
   MsgBox, A color within 3 shades of variation was found at X=%Px% Y=%Py%.
   MouseMove, %Px%, %Py% , 1
   } 
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Araphen, mikeyww and 403 guests