SCAR Code:
function FightNPCFindMob(Color:TintegerArray; tol: integer;Uptext:TStringArray): integer; //My first function, so...
var
xxt,yyt,x,y,fcolx,fcoly,ftd:integer;
BoolInfight:boolean;
begin
if (not (LoggedIn) or (FindDead) or (InFight)) then Exit;
for ftd:=0 to high(color) do //Thanks to troll for pointing out the forgotten begin and end;
begin
x:=MSCX;
y:=MSCY;
if FindObjTPA(x, y, color[ftd], tol, -1, 15, 15, 25,Uptext)and
not(FindColor(fcolx, fcoly, 65280, x - 20, y, x + 20, y + 80)) and
not (BoolInfight=true) then
begin
BoolInfight:=True;
Result:=1;
Mouse(x,y,1,1,true);
Wait(1000+random(500));
Exit;
end else
end;
begin
xxt:=MMCX;
yyt:=MMCY;
if findcolorspiraltolerance(xxt,yyt,195836, MMX1, MMY1, MMX2, MMY2,tol) and
not(Boolinfight=true) and
not(findcolortolerance(fcolx,fcoly,16711422,xxt - 10,yyt - 10, xxt + 10, yyt + 10,tol)) then
begin
Mouse(xxt,yyt,5,5,true);
result:=2
Exit;
end else
end;
res
SCAR Code:
case (FightNPCFindMob([9935011,4542295,6785973,3623778,6983867],8,['ttack'])) of
1:writeln('Attacking Monster');
2:writeln('Found mob, walking there');
3:writeln('Found no mob nor attacking NPC');
end;