SCAR Code:
program ChickenKiller;
{.include SRL/SRL.Scar}
const
ChickensToKill = 5;
var
ChickensKilled: Integer;
ChickenColors: TIntegerArray;
procedure DeclarePlayers;
begin
CurrentPlayer := 0;
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
ChickenColors := [0, 0, 0]; // Choose a few colors off of the chickens and put them here.
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
end;
function KillChickens: boolean;
var
l, i: Integer;
ChickenPointsATPA: T2DPointArray;
ChickenPoints: TPointArray;
ChickenPoint: TPoint;
begin
l := High(ChickenColors);
FindColorsSpiralTolerance(MSCX, MSCY, ChickenPoints, ChickenColors[Random(l)], MSX1, MSY1, MSX2, MSY2, 5);
if Length(ChickenPoints)=0 then
FindColorsSpiralTolerance(MSCX, MSCY, ChickenPoints, ChickenColors[Random(l)], MSX1, MSY1, MSX2, MSY2, 5);
ChickenPointsATPA := SplitTPA(ChickenPoints, 3);
SortATPASize(ChickenPointsATPA, True);
for i := 0 to High(ChickenPointsATPA) do
begin
ChickenPoint := MiddleTPA(ChickenPointsATPA[i]);
Mouse(ChickenPoint.x, ChickenPoint.y, 0, 0, False);
Wait(750);
if ChooseOption('hicken') then
begin
Result := True;
Exit;
end;
end;
end;
procedure ProgressReport;
begin
ClearDebug;
WriteLn('Chickens Killed: ' + IntToStr(ChickensKilled));
end;
begin
SetupSRL;
LoginPlayer;
repeat
FindNormalRandoms;
if KillChickens then
Inc(ChickensKilled);
ProgressReport;
until(ChickensKilled=ChickensToKill)
end.
EDIT: I'll try to write you a feather picker upper.
EDIT2: Here you are with a feather picker upper.
SCAR Code:
program ChickenKiller;
{.include SRL/SRL.Scar}
const
ChickensToKill = 5;
var
ChickensKilled, FeatherColor: Integer;
ChickenColors: TIntegerArray;
procedure DeclarePlayers;
begin
CurrentPlayer := 0;
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
ChickenColors := [0, 0, 0]; // Choose a few colors off of the chickens and put them here.
FeatherColor := 0; // Choose a color off of the "stem" of the feather.
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
end;
function KillChickens: boolean;
var
l, i: Integer;
ChickenPointsATPA: T2DPointArray;
ChickenPoints: TPointArray;
ChickenPoint: TPoint;
begin
if not LoggedIn then TerminateScript;
l := High(ChickenColors);
FindColorsSpiralTolerance(MSCX, MSCY, ChickenPoints, ChickenColors[Random(l)], MSX1, MSY1, MSX2, MSY2, 5);
if Length(ChickenPoints)=0 then
FindColorsSpiralTolerance(MSCX, MSCY, ChickenPoints, ChickenColors[Random(l)], MSX1, MSY1, MSX2, MSY2, 5);
ChickenPointsATPA := SplitTPA(ChickenPoints, 3);
SortATPASize(ChickenPointsATPA, True);
for i := 0 to High(ChickenPointsATPA) do
begin
ChickenPoint := MiddleTPA(ChickenPointsATPA[i]);
Mouse(ChickenPoint.x, ChickenPoint.y, 0, 0, False);
Wait(750);
if ChooseOption('hicken') then
begin
Result := True;
Exit;
end;
end;
end;
function PickupFeathers: boolean;
var
i: Integer;
FeatherPoints: TPointArray;
FeatherPointsATPA: T2DPointArray;
FeatherPoint: TPoint;
begin
if not LoggedIn then TerminateScript;
FindColorsSpiralTolerance(MSCX, MSCY, FeatherPoints, FeatherColor, MSX1, MSY1, MSX2, MSY2, 5);
if Length(FeatherPoints)=0 then
FindColorsSpiralTolerance(MSCX, MSCY, FeatherPoints, FeatherColor, MSX1, MSY1, MSX2, MSY2, 10);
if Length(FeatherPoints)=0 then
TerminateScript;
FeatherPointsATPA := SplitTPA(FeatherPoints, 3);
SortATPASize(FeatherPointsATPA, True);
for i := 0 to High(FeatherPointsATPA) do
begin
FeatherPoint := MiddleTPA(FeatherPointsATPA[i]);
MMouse(FeatherPoint.x, FeatherPoint.y, 0, 0);
Wait(750);
if IsUpText('eather') then
begin
Mouse(FeatherPoint.x, FeatherPoint.y, 0, 0, False);
Wait(750);
if ChooseOption('eather') then
begin
Result := True;
Exit;
end;
end;
end;
end;
procedure ProgressReport;
begin
ClearDebug;
WriteLn('Chickens Killed: ' + IntToStr(ChickensKilled));
end;
begin
SetupSRL;
LoginPlayer;
repeat
FindNormalRandoms;
if KillChickens then
Inc(ChickensKilled);
PickupFeathers;
ProgressReport;
until(ChickensKilled=ChickensToKill)
end.