SCAR Code:
program Czepa;
//{.include SRL/SRL/misc/SMART.scar}
{.include srl/srl.scar}
const
HPToEat = 100; // Percentage of HP you want to eat at.
dir = 'n'; // Direction to run away to. Valid arguments: n,e,s,w.
procedure DeclarePlayers;
var i: Integer;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Active := True;
for i := 0 to HowManyPlayers-1 do
Players[i].Active := True;
SetPlayerNameTPAs;
end;
end;
procedure StayLoggedIn;
var x, y: Integer;
begin
case Random(150) of
1, 33, 56 : HoverSkill('random', False);
16, 24, 88 : begin
GetMousePos(x, y);
MoveMouseSmoothEx(x + Random(65),y + Random(120), 1,
3, 45, 20, 10);
end;
53, 44, 122 : ExamineInv;
97, 133, 146 : BoredHuman;
94, 95, 149 : PickUpMouse;
end;
end;
function HPCheck(HP: Integer): Boolean;
begin
Writeln('HP Check...');
if (not (LoggedIn)) then Exit;
Result := HPPercent < HP;
if Result then
Writeln('Health is less than '+IntToStr(HP)+'%!');
Status('');
end;
function GetColorPoints(x, y, Color, bp1, bp2, bp3, bp4, Width, Height, Tol: Integer): TPointArray;
var tpa: array of TPoint; i, o: SmallInt; atpa: T2DPointArray;
begin
FindColorsSpiralTolerance(x, y, tpa, Color, bp1, bp2, bp3, bp4, Tol);
atpa := TPAtoATPAEx(tpa, Width, Height);
for i := 0 to High(atpa) do
begin
o := GetArrayLength(Result);
SetArrayLength(Result, o + 1);
Result[o] := MiddleTPA(atpa[i]);
end;
if Length(Result) > 1 then
WriteLn('Length(Array): '+IntToStr(o)+';');
end;
procedure StayAlive;
var i, x, y: Integer; iBox: TBox; Find: Boolean; Arr: array of TPoint;
P: TPoint;
begin
if not HPCheck(HPToEat) then Exit;
if GetCurrentTab <> tab_Inv then
GameTab(tab_Inv);
for i := 1 to 28 do
begin
iBox := InvBox(i);
Arr := GetColorPoints(x, y, 1533377, iBox.x1, iBox.y1, iBox.x2, iBox.y2, 5, 5, 20);
if Length(Arr) > 4 then
begin
Find := True;
P := MiddleTpa(Arr);
Writeln('Found Lobster At ('+IntToStr(x)+', '+IntToStr(y)+');');
MMouse(P.x, P.y, 3, 3);
Wait(120 + Random(50));
if Pos('obster', Rs_GetUpText) > 0 then
Mouse(P.x, P.y, 5, 3 + Random(2), True);
Wait(RandomRange(800, 1600));
if not HPCheck(HPToEat) then
Exit;
end;
if i = 28 then
if not Find then
begin
RunTo(dir, True);
NextPlayer(False);
end;
end;
end;
begin
SetUpSRL;
ClearDebug;
Writeln('Author := NCDS;');
ActivateClient;
DeclarePlayers;
LogInPlayer;
SetAngle(True);
FindNormalRandoms;
while Players[CurrentPlayer].Active = True do
begin
StayAlive;
StayLoggedIn;
Wait(RandomRange(5000, 15000));
end;
end.