Jump to content
Macro Express Forums

Little help, please?


Cander
 Share

Recommended Posts

Alright, what i'm TRYING to do is..

1.) Activate the window i'm trying to create a macro for

2.) Move the mouse to X-Y's

3.) Click and then check if the pixel is the correct color

4.) If it is, then play a .wav file and pause the macro

5.) If Not, then do it all over.

 

I don't have any real experience with creating macros, But I'd love some help bringing my vision to life.

 

 

 

<begloop>(99999)

<cmds>

<actwin>("[Window |ThunderRT6Form|#244|#120]\[Reroll|ThunderRT6CommandButton|#32|#432]",0,0,"no")

<if_win>("[Window |ThunderRT6Form|#244|#120]","NOACT",0)

<wx>(250,1)

<execappex>("C:\Program Files\game\game.exe","","%_vQuoteChar%C:\Program Files\game%_vQuoteChar%",0,0)

<wx>(250,1)

<mm>(1154,757)

<wx>(250,1)

<mlbd>

<wx>(250,1)

<mlbu>

<wx>(250,1)

<mm>(400,190)

<wx>(50,1)

<mlbd>

<wx>(250,1)

<mlbu>

<wx>(400,1)

<mm>(329,592)

<wx>(400,1)

<mlbd>

<wx>(400,1)

<mlbu>

<wx>(400,1)

<display_getpixel>(360,501,vColor)

<wx>(400,1)

<if_num>("vColor=>5500000")

<wx>(400,1)

<beep>("C:\Documents and Settings\John\Desktop\Downloaded\beep-1.wav",1)

<wx>(6000000,1)

<else>

<mm>(329,592)

<wx>(5,1)

<mlbd>

<wx>(10,1)

<mlbu>

<endif>

<endloop>

Link to comment
Share on other sites

Alright, what i'm TRYING to do is..

1.) Activate the window i'm trying to create a macro for

2.) Move the mouse to X-Y's

3.) Click and then check if the pixel is the correct color

4.) If it is, then play a .wav file and pause the macro

5.) If Not, then do it all over.

 

I don't have any real experience with creating macros, But I'd love some help bringing my vision to life.

 

 

 

<begloop>(99999)

<cmds>

<actwin>("[Window |ThunderRT6Form|#244|#120]\[Reroll|ThunderRT6CommandButton|#32|#432]",0,0,"no")

<if_win>("[Window |ThunderRT6Form|#244|#120]","NOACT",0)

<wx>(250,1)

<execappex>("C:\Program Files\game\game.exe","","%_vQuoteChar%C:\Program Files\game%_vQuoteChar%",0,0)

<wx>(250,1)

<mm>(1154,757)

<wx>(250,1)

<mlbd>

<wx>(250,1)

<mlbu>

<wx>(250,1)

<mm>(400,190)

<wx>(50,1)

<mlbd>

<wx>(250,1)

<mlbu>

<wx>(400,1)

<mm>(329,592)

<wx>(400,1)

<mlbd>

<wx>(400,1)

<mlbu>

<wx>(400,1)

<display_getpixel>(360,501,vColor)

<wx>(400,1)

<if_num>("vColor=>5500000")

<wx>(400,1)

<beep>("C:\Documents and Settings\John\Desktop\Downloaded\beep-1.wav",1)

<wx>(6000000,1)

<else>

<mm>(329,592)

<wx>(5,1)

<mlbd>

<wx>(10,1)

<mlbu>

<endif>

<endloop>

 

I'm replying here to your PM as I think it's better to keep discussion in the forum. That way, others can contribute and/or learn. First, here's the main part of your PM, as it differs a bit from the above:

 

 

... and was wondering if you could help me out? Like the forum member Archer, I also have a need for a pixel finding macro. I started using another macro program to do this, but may switch to this site's platform if need be.

 

The macro I want is basically

 

1.) Active the window I want to perform the macro on

2.) Move mouse to a X-Y coords

3.) Mouse button down

4.) Mouse button up

5.) Get pixel color from X-Y coords

6.) IF color number is lower then 1700000 then

Play sound

Else

Move mouse to X-Y coords

Mouse button down

Mouse button up

End

 

I can't seem to get this to work, I'd love if you could help me write out the code and then I could get a better understanding of what I was doing wrong and get a grasp on learning about macros.

 

==================

 

First, the commands you need to use are all well-explained in ME 3 Help, so I recommend you do some basic studying. For example, read the topics 'Get Pixel Color' and 'If Commands'. Although, re-reading your post, it sounds as if you don't even have a trial vesrion of ME 3 yet? In which case you are OT and sort of handicapped! :rolleyes:

 

Next, your description is not fully clear to me. It's usually better to describe in plain English exactly what you are doing, in what application, and what you are trying to achieve. So I'm assuming you:

- are moving the mouse around (in a game?)

- presumably left-clicking as well

- want to repeatedly test if the mouse cursor is positioned over a certain unique pixel colour.

- want to play a sound if it IS

 

The following demo:

1. Activates or opens Notepad.

2. Tests repeatedly for the colour of the pixel under the mouse cursor.

3. If that colour matches exactly the colour at a certain position I've chosen (in the middle of the Notepad icon, top left of its window), then play a sound.

 

// Active Notepad (or launch it if not already open)

Activate or Launch: "Notepad" OR "Notepad.exe"

Repeat Until %T1% <> %T1%

Get Pixel: Under Mouse into %N1%

If Variable %N1% = 14859595

Sound Wave File: $OI_YOU.WAV

End If

Delay 1 Milliseconds

Repeat End

Macro Return

 

<REM2:Active Notepad (or launch it if not already open)><LAUNCHYES3:0:0112Notepad<LAUNCH:Notepad.exe><REP3:08:000002:000001:0001:1:01:T1><GETPXM:1><IFVAR2:2:01:1:14859595><WAV2:C:\Docs\Sounds\Wave\$OI_YOU.WAV><ENDIF><MSD:1><ENDREP><MRETURN>

 

Stop the macro either using the running man icon or the abort hotkeys.

 

You'll obviously need to modify this accordingly.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Well I am working with 6 numbers, multi-line, ranging from 1-20 like so:

11

12

20 (These colors are all Red, because they are not maxed.

16

14

9

 

Those are bad, I want to acheive,

18

18

21 (These are the maxed numbers for this class, so they are all Yellow.)

18

18

18

 

And so the program would first, go click the button that generates the numbers. Then it would do a check on the x-y coords where the yellow pixel should be consistant, but it isn't because everytime you generate the numbers they move ever so slightly, throwing off the pixel getters IF numer # then it's Yellow option. Should I take a color sample from the yellow number and then keep looping a Get pixel in a radius around the whole number area in X-Y coords. But then I would have to do like 200 loops of checking X-Y coors in different spots for One color. And I would have to do that for 6 numbers. That's the only thing I can work towrds right now.. Any advice on a better plan?

Link to comment
Share on other sites

Well I am working with 6 numbers, multi-line, ranging from 1-20 like so:

11

12

20 (These colors are all Red, because they are not maxed.

16

14

9

 

Those are bad, I want to acheive,

18

18

21 (These are the maxed numbers for this class, so they are all Yellow.)

18

18

18

 

And so the program would first, go click the button that generates the numbers. Then it would do a check on the x-y coords where the yellow pixel should be consistant, but it isn't because everytime you generate the numbers they move ever so slightly, throwing off the pixel getters IF numer # then it's Yellow option. Should I take a color sample from the yellow number and then keep looping a Get pixel in a radius around the whole number area in X-Y coords. But then I would have to do like 200 loops of checking X-Y coors in different spots for One color. And I would have to do that for 6 numbers. That's the only thing I can work towrds right now.. Any advice on a better plan?

 

Sorry, I don't think I can help. That looks a lot more complicated than your original query. Maybe someone who is into gaming can chip in?

 

It sounds as if the game is randomly shifting your targets (if that's what these numbers are), perhaps to prevent the use of macros? But providing the shift is small, and the locations don't overlap, I'd have thought a relatively small number of tests, say 5-20, could give reliable results? A carefully chosen set of locations (a line, or a spiral maybe) would greatly reduce the number needed.

 

Have you experimented along those lines, using the example I wrote? Also, you haven't confirmed whether you have ME yet.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

How can black have a pixel color reference number like 500k and yellow have one at around that reference number too? Can someone tell me how to decypher pixel color reference numbers? Is it like a RGB thing? I don't understand how Red, yellow and black can all have a pixel color reference # in the 500k area..

 

 

I want to convert the color ref to a RGB value and then I can do like.. ' Get the lowest RGB that a color yellow can be and then just set it up to Accept anything above that is yellow. Since my yellow color pixel varies so much

 

 

 

The numbers automatically generates various yellow color pixels and places them in different spots each time, so I'm going to need to do a "If it's greater then colorref #, then it's yellow." But color reference numbers are outta' whack, so I need to convert them to a RGB or something so I can be able to determine the lowest yellow RGB value.

post-4119-1235157143.jpg

Link to comment
Share on other sites

How can black have a pixel color reference number like 500k and yellow have one at around that reference number too?

It doesn't. Black = 0. ;)

 

Can someone tell me how to decypher pixel color reference numbers? Is it like a RGB thing? I don't understand how Red, yellow and black can all have a pixel color reference # in the 500k area..

 

I want to convert the color ref to a RGB value and then I can do like.. ' Get the lowest RGB that a color yellow can be and then just set it up to Accept anything above that is yellow. Since my yellow color pixel varies so much

 

The numbers automatically generates various yellow color pixels and places them in different spots each time, so I'm going to need to do a "If it's greater then colorref #, then it's yellow." But color reference numbers are outta' whack, so I need to convert them to a RGB or something so I can be able to determine the lowest yellow RGB value.

 

I see where you're coming from but I'm not optimistic about this line of approach. For one thing, I can't yet detect any linear arithmetical relationship between 'shades of yellow' (or 'orange' or 'light green', or even 'grey' when you examine that area at high zoom levels) and the ME Pro value. But to be sure we need some technical explanation from ISS as to how the value is derived. Here are a few examples, which could possibly serve as a basis for discussion, before we rule out your current approach. I suspect its a hex-to-decimal algorithm, with the digits grouped in some proprietary fashion, but with nothing on this in Help I'm just guessing. BTW, my 4 'yellows' are arbitrary selections within your example:

 

MEPro-PixelColours.jpg

 

Changing direction, did you establish what the maximum variation was in the presumably deliberate random positioning of the numbers? Knowing that might allow you to test for Colour 1 OR Colour 2 OR Colour 3... OR (say) Colour 10 within a specific area.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Alright, just did a better check..sadly, even worse news. The color reference goes from like 130k to 10 mil-ish.. so doing a few random numbers would probably be useless. And the black around the area's are not all black or something, because they go up in color ref. to like 4-500k. And those are maxed, is why they are yellow, if they generate and are not maxed they are red, and the red goes way up there just like yellow.

Link to comment
Share on other sites

  • 2 weeks later...

Here's a loop I wrote to scan upwards for the 'blue' in the default windows titlebar and then double click to maximize, short on time but maybe this can help you guys a bit (or maybe I'm waaaay off lol):

 

You can probably ignore the part between the end if's - it just tries to check for if the mouse hit the next titlebar up (i.e. if it 'missed')

 

  Repeat Until %N99% = 1
Mouse Move Position 0, -1
Get Pixel: Under Mouse into %N98%
If Variable %N98% = 15357184
  Variable Set Integer %N99% to 1
End If
If Variable %N98% = 8388608
  Variable Set Integer %N99% to 1
End If
 Repeat End
 Delay 0.2 Seconds
 Mouse Left Button Double Click

 

<DIS:<TEXTTYPE:FIND ACTIVE CASE TITLE BAR><REP3:08:000001:000002:0099:0:01:1><MMP2:0,-1><GETPXM:98><IFVAR2:2:98:1:15357184><IVAR2:99:01:1><ENDIF><IFVAR2:2:98:1:8388608><IVAR2:99:01:1><ENDIF><ENDREP><DIS:<TEXTTYPE:DOUBLE CLICK BAR TO MAXIMIZE CLARIFY><DELAY:.2><LDCLK>

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...
 Share

×
×
  • Create New...