Fasga
2008-02-25 23:23:35
This is my first script (could you tell?) that actually works, and doesn't randomly walk off into the kbd's lair to get itself raped. As it is my first script, and it simply kills chickens, I see no real reason to provide a large explanation. All it does is kills the chicken, then moves on to the next one, checking for randoms and performing ban evasion techniques throughout. It doesn't pick up the feathers (yet), as I'm not sure the best way of finding them. Any input would be appreciated.
P.S. - Don't hate because it sucks.
program ChickenKiller;
{.include SRL/SRL/misc/Smart.scar}
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Fighting.scar}
const
YourSRLID = ''; // Fill in your SRL Stats username
YourSRLPassword = ''; // Fill in your SRL Stats password
ChickenColor1 = 857453; // Should be no need to change
ChickenColor2 = 5161945; // Should be no need to change
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
MouseSpeed := 20;
end;
procedure PreparePlayer;
begin
if not LoggedIn then LoginPlayer;
SetRun(true);
SetBar('Brightness', 4);
end;
procedure ManageBanEvasion;
begin
FindNormalRandoms;
case Random(100) of
0: PickupMouse;
1: AlmostLogout;
2: RandomRClick;
3: RandomMovement;
4: BoredHuman;
5: Wait2(10000, true);
end;
end;
procedure AttackChicken;
var X, Y, Mark : Integer;
begin
if not FindMonsterTol(X, Y, 'hicken', ChickenColor1, MSX1, MSY1, MSX2, MSY2, 7)
or not FindMonsterTol(X, Y, 'hicken', ChickenColor2, MSX1, MSY1, MSX2, MSY2, 7) then Exit;
if IsFightAt(X, Y) then Exit;
Mouse(X, Y, 0, 0, false);
Wait(25 + Random(100));
if not ChooseOption('ttack') then Exit;
Flag;
MarkTime(Mark);
Wait(2 * 1000 + Random(1000));
repeat
if (TimeFromMark(Mark) / 1000) > 20 then Break;
ManageBanEvasion;
if HPPercent < 25 then RunTo('E', true);
Wait(250);
until not(InFight);
ReportVars[0] := ReportVars[0] + 1;
end;
procedure MainLoop;
var Mark : Integer;
begin
repeat
repeat
MarkTime(Mark);
if not LoggedIn then Exit;
ManageBanEvasion;
AttackChicken;
until((TimeFromMark(Mark) / 1000 * 60) >= 50); //50 minutes
NextPlayer(LoggedIn);
until(false);
end;
begin
SetupSRL;
SRLID := YourSRLID;
SRLPassword := YourSRLPassword;
ScriptID := '684';
DeclarePlayers;
PreparePlayer;
MainLoop;
SendSRLReport;
end.P.S. - Don't hate because it sucks.