SCAR Code:
program ChickenKiller;
{.include SRL/SRL.scar}
var x, y : Integer;
Chickens, PlayerTimer : Integer;
count:string;
const
TimePerPlayer = 15;// How long to fight and switch players (in mins)
FightMode = 1;// 1,2,3,4 are your choices
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 1;
Players[0].Name := ' '; //username
Players[0].Pass := ' '; //password
Players[0].Nick := 'rio'; //3-4 letters from your username
Players[0].Skill := 'strength';
Players[0].Active := True;
end;
function FindChicken : Boolean;
var
Colors : array[1..4]of Integer;
i : Integer;
begin
Result := False;
colors[1] := 5227996;
colors[2] := 923765;
colors[3] := 5161431;
colors[4] := 5269622;
for i := 1 to 4 do
begin
if(FindObj(x, y, 'ick', colors[i], 5))then
begin
Result := True;
end else
Result := false;
end;
end;
{ NOT MINE I borrowed from Forefeathers }
function countfeathers:integer;
var
feathers:integer;
begin
result:=0;
feathers:=DTMFromString('78DA639464606010614001DBD7AC61E002D28' +
'C40FC1F081845810C5E0634C08844026921202148400D485E8C08' +
'73A409A8E107124A04D480FC2443408D3CA6DF31D448000949FC6' +
'A00153F07BB');
gametab(4);
wait(200+random(50));
if finddtm(feathers,x,y,mix1,miy1,mix2,miy2) then
begin
count:=GetTextAtEx(x-16, y-17, 0, statchars, False, False, 0, 1, 65535, 10, false, tr_AlphaNumericChars);
count:=trim(TrimOthers(count));
if not(count='') then
begin
result:=strtoint(count);
end;
end;
freedtm(feathers);
end;
{ NOT MINE I borrowed from Forefeathers }
function FindFastRandoms: Boolean; //By WT-Fakawi.
var
i: Integer;
begin
for i := 1 to 8 do
begin
case I of
1: if FindDead then
Result := True;
2: if FindMod then
Result := True;
3: if FindMime then
Result := True;
4: if FindMaze then
Result := True;
5: if FindQuiz then
Result := True;
6: if FindDemon then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;
7: begin
if InBlack then
begin
Result := True;
Players[CurrentPlayer].loc := 'InBlack';
Logout;
Exit;
end;
end;
8: RC;
end;
wait(1);
end;
end;
procedure Feathers;
var
f : Integer;
begin
repeat
begin
if(FindObj(x, y, 'ath', 12171971, 5))then
begin
FTWait(2);
MMouse(x, y, 5, 5);
wait(30 + random(10));
Mouse(x, y, 0, 0, false);
wait(100 + random(30));
ChooseOption('eather');
end;
F := f + 1;
end;
until(not(FindObj(x, y, 'ath', 12171971, 5))) or (f = 5);
end;
procedure Attack;
begin
if(FindChicken)then
begin
if(FindFight)then Exit;
FindFastRandoms;
MMouse(x, y, 5, 5);
Mouse(x, y, 0, 0, true);
end;
repeat
wait(300);
until(not(FindFight));
if(Random(5) = 2)then
begin
HoverSkill(Players[CurrentPlayer].Skill, false);
wait(1000 + random(500));
end;
Chickens := Chickens + 1;
end;
procedure SetupPlayer;
Begin
if(not(LoggedIn))then
Begin
LoginPlayer;
end;
SetFightMode(FightMode);
end;
procedure Proggy;
begin
writeln('|<---------------------------->|');
writeln('|< Stamp''s Chicken Killer 1.0 >|');
writeln('|<---------------------------->|');
writeln('|< Killed : ' + inttostr(Chickens) + 'Chickens >|');
writeln('|<---------------------------->|');
end;
begin
ActivateClient;
SetupSRL;
DeclarePlayers;
SetupPlayer;
repeat
if(not(LoggedIn))then
Begin
NextPlayer(False);
begin
SetupPlayer;
MarkTime(PlayerTimer);
repeat
Attack;
wait(50);
Feathers;
FindFastRandoms;
until(TimePerPlayer>= TimeFromMark(PlayerTimer));
NextPlayer(True);
end;
end;
until(false);
end.