SCAR Code:
program FallyCowCruncher;
{.include srl/srl.scar}
{.include srl/srl/skill/fighting.scar}
var
x,y,a,i,CowsKilled,HidesPicked: integer;
CowColor: array [0..3] of Integer;
procedure DeclarePlayers;
begin
HowManyPlayers := 4;
CurrentPlayer := 0;
NumberOfPlayers(HowManyPlayers);
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Integers[1] :=0; //desired attack
Players[0].Integers[2] :=50; //desired strength
Players[0].Integers[3] :=0; //desired defense
Players[1].Integers[4] :=1; //How many loads before logging
Players[0].Active := true;
Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Integers[1] :=20; //desired attack
Players[1].Integers[2] :=20; //desired strength
Players[1].Integers[3] :=0; //desired defense
Players[1].Integers[4] :=1;
Players[1].Active := true;
Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Integers[1] :=0; //desired attack
Players[2].Integers[2] :=0; //desired strength
Players[2].Integers[3] :=0; //desired defense
Players[2].Integers[4] :=1;
Players[2].Active := False;
Players[3].Name := '';
Players[3].Pass := '';
Players[3].Nick := '';
Players[3].Integers[1] :=0; //desired attack
Players[3].Integers[2] :=0; //desired strength
Players[3].Integers[3] :=0; //desired defense
Players[3].Integers[4] :=1;
Players[3].Active := False;
end;
function AttackMode:boolean;
var
i,att,str,def:integer;
begin
if not(loggedIn) then exit;
result:=true;
if (timefrommark(a)>30000)or(players[currentplayer].skill='') then
begin
Mouse(575,183,10,10,true);
wait(200);
att:=getskillinfo('attack',false);
str:=getskillinfo('strength',false);
def:=getskillinfo('defence',false);
writeln(inttostr(att)+' attack');
writeln(inttostr(str)+' strength');
writeln(inttostr(def)+' defence');
marktime(a);
if (lowercasE(players[currentplayer].skill)='attack') then
if (att<players[currentplayer].integers[1]) then exit else players[currentplayer].skill:='';
if (lowercasE(players[currentplayer].skill)='strength') then
if (str<players[currentplayer].integers[2]) then exit else players[currentplayer].skill:='';
if (lowercasE(players[currentplayer].skill)='defence') then
if (def<players[currentplayer].integers[3]) then exit else players[currentplayer].skill:='';
for i:=0 to 0 do
begin
if (players[currentplayer].skill='') then
begin
if (att<players[currentplayer].integers[1]) then
if not(players[currentplayer].integers[1]=99) then
begin
players[currentplayer].skill:='attack';
break;
end;
if (str<players[currentplayer].integers[2]) then
if not(players[currentplayer].integers[2]=99) then
begin
players[currentplayer].skill:='strength';
break;
end;
if (def<players[currentplayer].integers[3]) then
if not(players[currentplayer].integers[3]=99) then
begin
players[currentplayer].skill:='defence';
break;
end;
if (players[currentplayer].integers[1]=99) then players[currentplayer].skill:='attack';
if (players[currentplayer].integers[2]=99) then players[currentplayer].skill:='strength';
if (players[currentplayer].integers[3]=99) then players[currentplayer].skill:='defence';
end;
end;
Mouse(542,183,10,10,true);
case lowercase(players[currentplayer].skill) of
'attack': setfightmode(1);
'strength': setfightmode(2);
'defence','defense': setfightmode(4);
else result:=false;
end;
end;
end;
Procedure Proggy;
begin
ClearDebug;
Writeln('=====================================================================');
Writeln('FallyCowCruncher has been running for ' + Timerunning);
Writeln('---------------------------------------');
Writeln('Your Players have killed ' + inttostr(CowsKilled) + ' Cows');
Writeln('and Picked up ' + inttostr(hidespicked) + ' CowHides');
Writeln('');
for i := 0 to (HowManyPlayers - 1) do
begin
if Players[i].Active = true then
begin
if players[i].integers[5] > 0 then
begin
Writeln(Players[i].name + ' has killed ' + inttostr(players[i].integers[5]) + ' Cows');
end;
if players[i].integers[6] > 0 then
begin
Writeln('and has picked ' + inttostr(players[i].integers[6]) + ' Hides');
end;
Writeln('');
end;
end;
Writeln('====================FallyCowCruncher===================');
end;
procedure SetRetaliate(ret:boolean);
var
i:integer;
begin
if not(loggedIn) then exit;
gametab(1);
for i:=1 to 5 do
begin
case getColor(600,390) of
4540745: if ret=true then mouse(600+random(100),370+random(20),0,0,true) else exit;
1711220: if ret=false then mouse(600+random(100),370+random(20),0,0,true) else exit;
end;
wait(200);
end;
end;
Procedure AntiBan;
begin
case random(8) of
3: HoverSkill(players[currentplayer].skill,false);
5: PickupMouse;
7: BoredHuman;
1: findnormalrandoms;
end;
end;
Procedure FightSetup;
begin
If not(loggedin) then Exit;
MakeCompass('s');
SetRun(true);
AttackMode;
SetAngle(True);
SetRetaliate(true);
Mouse(643,183,10,10,true);
end;
procedure LogIn;
begin
if not(loggedin) then LoginPlayer;
Wait(500);
FindNormalRandoms;
MakeCompass('n');
Mouse(672,482,5,5,true);
SetRun(false);
SetBar('Brightness',4);
end;
//taken off men_tal's cow killing script
procedure CollectHide;
var
j: integer;
Hide:Array [0..1] of integer;
begin
Hide[0] := 11842750;
Hide[1] := 13093070;
for j := 0 to 1 do
begin
if FindColorSpiralTolerance(x,y,Hide[j],MSX1,MSY1,MSX2,MSY2,2) then
begin
Mouse(x, y, 3, 3, false);
if ChooseOption('ide') = true then
begin
Flag;
FindNormalRandoms;
HidesPicked := HidesPicked + 1;
end;
end;
end
end;
procedure KillDaCow;
begin
Writeln('now to own some cows');
CowColor[0] := 6119781;
CowColor[1] := 5863838;
CowColor[2] := 9936291;
CowColor[3] := 5397096;
FightSetup;
repeat
FindNormalRandoms;
if FindColorSpiralTolerance(x,y,Cowcolor[Random(3)],0,0,518,339,3) then
begin
MMouse(x,y,10,10);
Wait(100);
if IsUpText('Cow')=true then
begin
Mouse(x,y,5,5,False);
if ChooseOption('ttack') = true then
begin
Flag;
Antiban;
if (infight = true) then
begin
repeat
wait(100);
until(infight = false);
end;
CowsKilled := CowsKilled + 1;
Players[currentplayer].integers[5] := Players[currentplayer].integers[5] + 1;
Collecthide;
Wait(500);
end;
end;
end;
until(InvFull);
end;
procedure BankStuff;
begin
GameTab(4);
if (FindBank('feb') = true) then
begin
MMouse(x,y,10,10);
Wait(1000);
DepositAll;
Wait(1000);
CloseBank;
FindNormalRandoms;
end;
end;
procedure ToPen;
var
z,p,u,TheRoadColor:integer;
begin
login;
Z:=0;
BankStuff;
Makecompass('n');
TheRoadColor := findfallyroadColor;
Wait(500);
if radialwalk(TheRoadColor,180,270,40,1,1) then
begin
wait(500);
end else Exit;
repeat
radialroadwalk(TheRoadColor,165,200,50,1,1);
AntiBan;
wait(200);
until(findsymbolin(x,y,'tree',628,8,704,165));
mouse(x + 10,y,10,5,true);
flag;
if findcolortolerance(p,u,236,628,8,705,117,10) then
begin
mouse(p,u - 5,5,5,true);
flag;
Antiban;
end;
Setangle(false);
if findcolortolerance(p,u,236,628,8,705,117,10) then
begin
mouse(p,u + 15,10,10,true);
Z:= Z + 1;
end;
end;
procedure ToBank;
var
LoadsDone,TheRoadColor: Integer;
begin
LoadsDone := 0;
LogIn;
if findcolortolerance(x,y,236,628,8,705,117,10) then
begin
Mouse(x,y - 6,5,5,true);
wait(1000);
mouse(x - 3,y - 5,5,5,true);
flag;
wait2(2000,true);
end;
if findsymbolin(x,y,'tree',548,9,627,165) then
begin
mouse(x - 5,y - 5,5,5,true);
flag;
wait(1000);
AntiBan;
end;
TheRoadColor := FindFallyRoadColor
RadialWalk(TheRoadColor,-50,0,65,2,2)
Wait(1000);
repeat
FindNormalRandoms;
RadialWalk(TheRoadColor,0,40,50,2,2);
until(findsymbol(x,y,'bank') = true);
BankStuff;
LoadsDone := LoadsDone + 1;
if players[currentplayer].integers[4] <= LoadsDone then
begin
Proggy;
NextPlayer(true);
end
end;
begin
SetupSRL;
ActivateClient;
DeclarePlayers;
CowsKilled := 0;
HidesPicked := 0;
for I:= 0 to (HowManyPlayers - 1) do
begin
Players[I].integers[5] := 0;
Players[I].integers[6] := 0;
end;
repeat
ToPen;
KillDaCow;
ToBank;
until(False);
end.