Simba Code:
program new;
{$I SRL/SRL.scar}
type
TMonster = record
Names: TStringArray;
Color: TColor;
Hue, Sat, Tol: Extended;
end;
TMonsterArr = array of TMonster;
var
MonsterArr: TMonsterArr;
procedure LoadMonster(const Name: string);
function Monster(const Name: TStringArray; const Color: TColor; const Hue, Sat, Tol: Extended): TMonster;
begin
Result.Name := Name;
Result.Color := Color;
Result.Hue := Hue;
Result.Sat := Sat;
Result.Tol := Tol;
end;
begin
SetLength(MonsterArr, 0); //Reset
case (Name) of
'pig': begin
SetLength(MonsterArr, 2);
MonsterArr[0] := Monster([''], 0, 0.0, 0.0, 0.0);
MonsterArr[1] := Monster([''], 0, 0.0, 0.0, 0.0);
end;
'cow': begin
SetLength(MonsterArr, 2);
MonsterArr[0] := Monster([''], 0, 0.0, 0.0, 0.0);
MonsterArr[1] := Monster([''], 0, 0.0, 0.0, 0.0);
end;
'zombie': begin
SetLength(MonsterArr, 2);
MonsterArr[0] := Monster([''], 0, 0.0, 0.0, 0.0);
MonsterArr[1] := Monster([''], 0, 0.0, 0.0, 0.0);
end;
end;
end;
procedure FindMonster();
procedure _RandMArr(var Arr: TMonsterArr);
begin
//Didn't write this cause I'm lazy....
//Results the same arr >..>
end;
var
TempArr: TMonsterArr;
oC, A, H, J, I: Integer;
oH, oS: Extended;
Point: TPoint;
Points: TPointArray;
Points2D: T2DPointArray;
begin
if (not (LoggedIn)) then
Exit;
TempArr := MonsterArr;
_RandMArr(TempArr);
oC := GetToleranceSpeed();
GetToleranceSpeed2Modifiers(oH, oS);
try
SetColorToleranceSpeed(2);
H := High(TempArr);
for A := 0 to H do
with TempArr[A] do
begin
SetToleranceSpeed2Modifiers(Hue, Sat);
if (FindColorsSpiralTolerance(MSCX, MSCY, Points, Color, MSX1, MSY1, MSX2, MSY2, Tol)) then
if (Length(Points) > 1) then
begin
Points2D := TPAtoATPAEx(Points, 3, 3);
J := High(Points2D);
for I := 0 to J do
begin
Point := MiddleTPA(Points2D[I]);
MMouse(Point.X, Point.Y, RandomRange(-3, 3), RandomRange(-3, 3));
if (IsUpTextMultiCustom(Names)) then
begin
if (Random(5) <> 0) then
Continue;
WriteLn('Found Monster!');
GetMousePos(Point.X, Point.Y);
Mouse(Point.X, Point.Y, 0, 0, False);
if (not (ChooseOption('Attack'))) then
Mouse(Point.X, Point.Y, 0, 0, True);
Result := True;
Exit;
end;
end;
end;
end;
finally
SetColorToleranceSpeed(oC);
SetToleranceSpeed2Modifiers(oH, oS);
end;
end;
begin
end.