Matterz
2009-09-26 01:29:40
Hello,
I am having an issue with a script I wrote. I've written a few basic SCAR scripts in the past so I'm not completely new to the process.
I am using the ColorPicker to grab the colors for enemy health bars. I save these to a const and then my script uses FindColorTolerance().
Sample Code:
However the script is never able to find the colors I specify. I tried adjusting the tolerance and the size of the scan area, but neither worked. I've also checked the colors immediately after running the script and they haven't changed.
I tried using the following script to get the color codes, but it always returns 0.
I figure my problem is one of the three:
I am able to get SCAR to send key/mouse commands to the game.
Any input as to what is causing my problem would be great.
Thanks!
I am having an issue with a script I wrote. I've written a few basic SCAR scripts in the past so I'm not completely new to the process.
I am using the ColorPicker to grab the colors for enemy health bars. I save these to a const and then my script uses FindColorTolerance().
Sample Code:
var
x : Integer;
y : Integer;
const
//Color Codes
enemyHealth1 = 7112404;
enemyHealth2 = 5136792;
//Window Scanning
PxTop = 54;
PyTop = 144;
PxBot = 188;
PyBot = 149;
//Tolerance
Tol=100;
If(FindColorTolerance(x,y,enemyHealth1,PxTop,PyTop,PxBot,PyBot,Tol) OR
FindColorTolerance(x,y,enemyHealth2,PxTop,PyTop,PxBot,PyBot,Tol))Then
begin
end
However the script is never able to find the colors I specify. I tried adjusting the tolerance and the size of the scan area, but neither worked. I've also checked the colors immediately after running the script and they haven't changed.
I tried using the following script to get the color codes, but it always returns 0.
var
x : Integer;
x=GetColor(100,145);
Writeln(IntToStr(x));
I figure my problem is one of the three:
- 1) I screwed up the code.
- 2) I'm running SCAR on Vista x64 and it has an issue reading the screen?
- 3) The game I'm attempting to automate is preventing me from reading the colors.
I am able to get SCAR to send key/mouse commands to the game.
Any input as to what is causing my problem would be great.
Thanks!