Jump to content
Macro Express Forums

Color variable manually defined by #?


macronoob7

Recommended Posts

Is there any way that I can save a Pixel Color number and store it within a macro permanently? For instance, if I always wanted text that is color 255 to be what the macro is looking for can I set that somehwere?

 

Basically I would want my macro to always use the same color without having to go grab it every time the macro runs, since it is represented by a number I was assuming that color value could be saved in a macro somehow.

 

I was looking at the options in the variables, and I read the help on variables and I couldn't see any way to define a color as a variable manually, but I may have not been looking in the right place. I found the color that I need using the get pixel command, but that makes me define the variable each time.

 

Is this possible, or am I trying to live out a pipe dream?

Link to comment
Share on other sites

What you want to do is to persist the value of a variable. There is a number of ways to do this:

- save a value in the registry and retrieve it each time you run the macro

- write the value to a file (e.g. an .ini file) and read the value back in each time you run the macro

If you want help with either of these techniques, simply ask.

Link to comment
Share on other sites

You don't always have to "store" it. It can be part of the macro. Here's a few lines from a web page loading macro:

 

Get Pixel Color at (1017, 39) Relative to Current Window into %N8%
   If Variable %N8% Equals "12632256"
     Break
   End If

If you use it numerous times in the macro you may want to set

%N7% = 12632256 then the above becomes

If Variable %N8% Equals %N7%

 

I see that you don't care to go this route but it's as quick to type the value as it is to sort out a link to a stored value. I usually copy and paste the value from a similar macro.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...