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.
Help on get pixel color
Moderators: Dorian (MJT support), JRL
Have a try,
(Let's assume the health bar has a length of 100 pixels (SevenOfNine: "Heigth is irrelevant")).
BTW: What was advised by the support ? Any details ...
(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 ...