SCAR Code:
function Fight : Boolean;
var
x, y, i, t1 : Integer;
NPC : array of TNPC;
begin
NPC := SortNPCs(GetNPCs);
for i := 0 to High(NPC) do
begin
if (NPC[i].Name = 'Yak') and (not NPC[i].InFight) then
begin
x := TileToMS(NPC[i].Tile, 20).x;
y := TileToMS(NPC[i].Tile, 20).y;
if FindColorTolerance(x, y, 4673114, x - 40, y - 40, x + 40, y + 40, 7) then
begin
if MouseCross(x, y, 0, 0, True) then
begin
Result := True;
t1 := GetSystemTime;
while (not FightAt(TileToMS(NPC[i].Tile, 20).x, TileToMS(NPC[i].Tile, 20).y)) or ((GetSystemTime - t1) < 6000) do Wait(1000); // [Runtime Error] : Out of Global Vars range in line 117 in script C:\Users\Lance\Desktop\My Scripting Projects\Reflection\First Reflection Script.scar
repeat
ClearDebug;
Writeln('Fighting ' + NPC[i].Name + ' - HP: ' + IntToStr(NPC[i].HPRatio) + '%'); // is writing that the yak is always at 0% HP.. can anyone fix?
// Antiban;
wait(1000);
until(not FightAt(TileToMS(NPC[i].Tile, 20).x, TileToMS(NPC[i].Tile, 20).y));
end;
FFlag(2);
Wait(500);
Exit;
end;
end;
end;
end;
Hey having some problems with the above function, ima nub with reflection =/
(you will have to scroll to the right to see the //Error)