DeSnob
2010-10-30 09:37:25
For the past few days much of my free time has been spent working on a little project of mine. Whether it will be completed or not is another story. Currently problems are already being encountered when trying to run through a for..to..do loop. I need the bot to randomly choose the skin color, but first it needs to detect the current skin color. So I set this up:
[/BANANA]
Technically it should compile. However, my rusty scripting is at fault. I do not understand why it does not work!(Gives me a runtime error.) Could someone please explain to me please? There is no need for code snippets unless it is an example. I'll include credits where it is needed to whoever helps me out. :)
function SSkin: boolean;
var
GPos: Array of TPoint;
i, Skin: Integer;
begin
GPos[0] := Point(487, 27);
GPos[1] := Point(507, 27);
GPos[2] := Point(530, 27);
GPos[3] := Point(558, 27);
GPos[4] := Point(563, 27);
GPos[5] := Point(587, 27);
GPos[6] := Point(614, 27);
GPos[7] := Point(640, 27);
GPos[8] := Point(663, 27);
GPos[9] := Point(687, 27);
GPos[10] := Point(713, 27);
GPos[11] := Point(739, 27);
for i:= 0 to 11 do
begin
if (CountColorTolerance(14859158, GPos[i].x, GPos[i].y, GPos[i].x+1, GPos[i].y+1, 3) > 0) then
Constant := GPos[i];
else
Continue;
end;
end; [BANANA]*NOTE: Constant is a global variable in my script- Constant: variant; It will be used to save the current coords where the outline color is found. [/BANANA]
Technically it should compile. However, my rusty scripting is at fault. I do not understand why it does not work!(Gives me a runtime error.) Could someone please explain to me please? There is no need for code snippets unless it is an example. I'll include credits where it is needed to whoever helps me out. :)