Help on get pixel color

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Oblodra
Newbie
Posts: 6
Joined: Sat Jun 07, 2003 1:22 pm

Help on get pixel color

Post by Oblodra » Mon Jun 16, 2003 1:07 am

I need very specific help on how to use get pixel color.

This is the scenerio :

Say i am playing an online game, my health bar (line) is represented by red color (meaning as your health decrease, your red color decreases and is replaced by a blackish color)

The stamina bar is represented by a greenish color.

Say i want my macro to do this : read the health bar's red color and as the red color decreases to a certain amount, consume a health potion.
Likewise for the stamina bar line.

How would i go about doing that? Please help. I got an email reply from MJT's staff but can't seem to get it working.

Lumumba

Post by Lumumba » Mon Jun 16, 2003 10:38 am

Have a try,

(Let's assume the health bar has a length of 100 pixels (SevenOfNine: "Heigth is irrelevant")).

Code: Select all

Label>Vars
Let>RedPixCoord=0
Let>MaxXCoord=100
Let>MinHealthLevel=50
Let>Red=255

Label>ScanTheBar
Add>RedPixCoord,1
If>RedPixCoord>MaxXCoord,Gosh
GetPixelColor>0,%RedPixCoord%,Tan
If>Tan=%Red%, ScanTheBar
Sub>RedPixCoord,1
If>RedPixCoord<%MinHealthLevel%,Cemetary
Message>Your current health level is: %RedPixCoord%
Wait>1.5
CloseWindow>Macro Scheduler Message
Goto>Improvement

Label>Gosh
MessageModal>Damn, you've the healthiest tan I've ever seen!

Label>Improvement
Wait>1
GetPixelColor>0,%MinHealthLevel%,CurrHealth
If>CurrHealth=%Red%, Improvement,Vars

Label>Cemetary
MessageModal>Ooops, let's start to collect money for a gravedigger ...
BTW: What was advised by the support ? Any details ...

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts