SRL Archive - First Scripts

[SRL][RS2] Chicken Killer


Maxcore

2007-10-29 23:43:55

This script kills chickens and takes and buries the bones. No anti-randoms as of yet, probably never will be either because I am already working on a new script.

////////////////////////////////////////////////////////////////////////////////
// //
// Maxcore's Chicken Killer //
// //
// Directions: //
// 1) Go to any place that has chickens. //
// 2) Press play //
// //
// Credits: Everyone at Mopar and the SRL forums, keep owning everyone! //
////////////////////////////////////////////////////////////////////////////////


program ChickenKiller;
{.include SRL\SRL.scar}
{.include SRL\SRL\Skill\Fighting.scar}
var
intKilled, intXP, BonesMenu, intPXP : integer;
const
intChicken = 1121677; // Color of the chickens.
intBones = 14803428; // Color of the bones.

procedure DeclarePlayers;
var
i : integer;
begin
Disguise('Norton Anti-Virus');

HowManyPlayers := 1;
CurrentPlayer := 0;
NumberOfPlayers(HowManyPlayers);
Players[0].Name := 'Username';
Players[0].Pass := 'Password';
Players[0].Nick := 'Baird';
Players[0].Active := True;
for i := 0 to Length(Players) - 1 do
SetArrayLength(Players[i].Integers, 4);
for i := 0 to Length(Players) - 1 do
SetArrayLength(Players[i].Strings, 1);
for i := 0 to Length(Players) - 1 do
SetArrayLength(Players[i].Booleans, 1);
end;

procedure ProgressReport;
begin
Writeln('==========================================>');
Writeln('Script running for ' + TimeRunning);
Writeln('You have killed ' + IntToStr(intKilled) + ' for ' + IntToStr(intXP) + ' XP.');
Writeln('You have gained ' + IntToStr(intPXP) + ' prayer XP.');
Writeln('==========================================>');
Writeln('');
Writeln('');
end;

procedure Login;
begin
Mouse(464, 293, 10, 20, true);
TypeSend(Players[CurrentPlayer].Name);
Wait(200 + Random(78));
TypeSend(Players[CurrentPlayer].Pass);
Wait(300 + Random(78));
Mouse(303, 323, 10, 20, true);
Wait(3500 + Random(2500));
Mouse(401, 338, 10, 20, true);
end;

procedure LoadMenuImages;
begin
BonesMenu := BitmapFromString(10, 11, 'beNpjYPg/wQEZMaACZEF' +
'MBZTLYrUXTRCTTWtZXK5iwAMA/Y1f3A==');
end;

procedure FindChicken;
var
found : boolean;
changeDir, x, y : integer;
begin
found := false;
changeDir := 1;
while(not found) do
begin
found := FindColorSpiralTolerance(x, y, intChicken, 5, 5, 515, 337, 15);
if found then
begin
MMouse(x, y, 0, 0);
if IsUpText('Chicken') then
begin
Mouse(x, y, 0, 0, true);
end else
begin
found := false;
end;
end else
begin
if changeDir = 1 then
begin
MakeCompass('n');
changeDir := 2;
wait(400 + Random(1000));
end else
begin
MakeCompass('s');
changeDir := 1;
wait(400 + Random(1000));
end;
end;
end;
end;

procedure PickUpBones;
var
found : boolean;
changeDir, x, y : integer;
begin
changeDir := 0;
repeat
found := FindColorSpiralTolerance(x, y, intBones, 203, 117, 292, 223, 15);
if found then
begin
Mouse(x, y, 0, 0, false);
LoadMenuImages;
if FindBitmapToleranceIn(BonesMenu, x, y, 5, 5, 515, 337, 15) then
begin
Mouse(x, y, 0, 0, true);
FreeBitmap(BonesMenu);
wait(2500 + Random(1500));
Mouse(576, 227, 15, 15, true);
wait(1000);
intPXP := intPXP + 10;
end;
end;
case changeDir of
0: MakeCompass('N');
1: MakeCompass('S');
2: MakeCompass('E');
3: MakeCompass('W');
end;
if changeDir = 3 then
begin
found := true;
end;
changeDir := changeDir + 1;
until(found);
end;

procedure FightChicken;
var
fought : boolean;
begin
fought := false;
if InFight then
begin
intKilled := intKilled + 1;
intXP := intXP + 28;
ProgressReport;
fought := true;
end;
while(InFight) do
begin
wait(2000);
end;
if fought then
begin
PickUpBones;
end;
end;

begin
SetUpSRL;
Cleardebug;
GetSelf.WindowState := wsMinimized;
DeclarePlayers;
ProgressReport;
Login;
wait(4000);
while(not IsFKeyDown(10)) do
begin
FindChicken;
wait(4000);
FightChicken;
end;
GetSelf.WindowState := wsMaximized;
end.

beta

2007-10-30 00:06:24

nice script

Sir R. M8gic1an

2007-10-30 04:20:15

you left your password in there, and your nickname is set the wrong way.

for i := 0 to Length(Players) - 1 do
SetArrayLength(Players[i].Integers, 4);
for i := 0 to Length(Players) - 1 do
SetArrayLength(Players[i].Strings, 1);
for i := 0 to Length(Players) - 1 do
SetArrayLength(Players[i].Booleans, 1);
can be shortened into:

for i := 0 to Length(Players) - 1 do
begin
SetArrayLength(Players[i].Integers, 4);
SetArrayLength(Players[i].Strings, 1);
SetArrayLength(Players[i].Booleans, 1);
end;


end else
// begin --> not needed, only 1 command
found := false;
// end; --> no begin, no end.

if IsUpText('Chicken') then your better off looking only for hicken.


begin
fought := false;
if InFight then
begin
intKilled := intKilled + 1;
intXP := intXP + 28;
ProgressReport;
fought := true;
while(InFight) do wait(1000+Random(1000));
PickUpBones;
end;
end;
shortened version, i do like your fighting procedure.


FindChicken;
wait(4000);// this might be too much, by the time you
// get to fight chicken it might already be dead.
FightChicken;


RMagician

Maxcore

2007-10-30 07:12:29

Hey thanks, I am looking at your corrections and they are so stupid on my part. Thanks for the tips, and the password thing was just stupid :( lol

Also, what is the correct way to set a nickname?

krisishere

2007-10-30 08:41:16

nice but does it takes the feathers???

qwix

2007-10-30 08:45:46

Nice just what i needed

Maxcore

2007-10-30 13:56:52

I was going to make it take feathers, but then I decided not to because making it takes bones would just be easier. With a little modification (just changing the bitmap of the take feathers option) you can have it take feathers.

Sir R. M8gic1an

2007-10-30 15:26:34

here's the username thing:
kaltrigalt –> alt
maxcore —> axc
cio38daf75 –> daf

just simply 3/4 letters from your username. What i corrected wasn't stupid from you, it was jsut lack of experience. Keep on going, your on the right way ;)

~RMagician

Maxcore

2007-10-31 21:04:26

Yea thanks, I had no idea what that did so I looked it up on the forums and found a tut by Wizzup and that explained it pretty well

2black2hack

2007-10-31 21:34:10

Hey i have been useing this often thanks for the script it runs well!

Willowworker

2007-11-22 13:04:27

im about to try it it looks like a good script!

X Gilli X

2007-11-22 20:53:47

Hm, I'll test it out to see how it works for you.

Wipe Ur Ass

2007-11-23 08:42:27

I think it would be better if it would pick feathers

satan6209

2007-11-23 14:10:35

nice script thanks :D

poopers

2007-11-23 14:25:26

From: Wipe Ur Ass
I think it would be better if it would pick feathers


Agreed! burry bones is a good feat if u you prayer.. (not all do)!

Willowworker

2007-11-23 14:56:07

its the only chickenkiller that works for me but i found it freezes when using compass- the compass dosent do much

BeViS

2007-11-23 16:21:05

i got 30 lvls and 30000 feathers

pshynosis

2007-11-25 08:25:59

Looking good :)

blackblue

2007-12-05 19:28:43

works pretty good.
not to good at detecting the chicken
though

ub3rn00b

2007-12-06 06:31:29

nice man but its hard finding chickens and i didnt pick up the bones.