SRL Archive - First Scripts

Chicken Killer


Electron Man

2007-11-12 21:15:43

Hello everyone, this is my first script, a simple chicken killer. It does not work as well as I want it to and I cannot figure out how to make it pick up feathers well but I hope to learn these things in time. Please post your feedback on it, thanks.

////////////////////////////////////////////////////////////////////////////////
// Electron Man Presents //
// //
// Name: Chicken Killer //
// Description: Finds and kills chickens. This program allows the user to //
// choose which skills he/she would like to train, or they can //
// have the program choose the lowest skill. //
// Date: 11/12/07 //
// //
// Directions: //
// 1) Target the Runescape Client with the cross hairs. //
// 2) Fill out player info in lines 39 - 71. //
// 3) Change lines 26 and 27 if you want to change the settings. //
// 4) Make sure all players are by some chickens. //
// 5) Press play. //
////////////////////////////////////////////////////////////////////////////////

program ChickenKiller;
{.include SRL\SRL.scar}
{.include SRL\SRL\Skill\Fighting.scar}
var
intKilled, SkillXP : integer;
CurSkill : string;
const
Chick = 1121677; // Color of the red on the chickens.
WaitTime = 14; // Time in seconds to wait to kill chicken.
NumToKill = 200; // Number to kill per account.

////////////////////////////////////////////////////////////////////////////////
// Procedure: DeclarePlayers; //
// Author: Wizzup? //
// Description: Declare the players that will be running the script. //
// //
// Note: When setting a Nick, make sure it has no capital letters or spaces. //
// ex: If your username is 'Damon B4ird' make your nick '4ird' //
////////////////////////////////////////////////////////////////////////////////
procedure DeclarePlayers;
begin
HowManyPlayers := 5;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='USERNAME1';
Players[0].Pass :='PASSWORD1';
Players[0].Nick :='';
Players[0].Strings[0]:='auto'; // Set attack, defence, strength, or auto.
Players[0].Active:=True;

Players[1].Name :='USERNAME2';
Players[1].Pass :='PASSWORD2';
Players[1].Nick :='';
Players[1].Strings[0]:='auto'; // Set attack, defence, strength, or auto.
Players[1].Active:=True;

Players[2].Name :='USERNAME3';
Players[2].Pass :='PASSWORD3';
Players[2].Nick :='';
Players[2].Strings[0]:='auto'; // Set attack, defence, strength, or auto.
Players[2].Active:=True;

Players[3].Name :='USERNAME4';
Players[3].Pass :='PASSWORD4';
Players[3].Nick :='';
Players[3].Strings[0]:='auto'; // Set attack, defence, strength, or auto.
Players[3].Active:=True;

Players[4].Name :='USERNAME5';
Players[4].Pass :='PASSWORD5';
Players[4].Nick :='';
Players[4].Strings[0]:='auto'; // Set attack, defence, strength, or auto.
Players[4].Active:=True;
end;

////////////////////////////////////////////////////////////////////////////////
// Procedure: ProgressReport; //
// Author: Electron Man //
// Description: Prints out a progress report. //
////////////////////////////////////////////////////////////////////////////////
procedure ProgressReport;
begin
Writeln('<=================================================>');
Writeln(' Chicken Killer v1 ');
Writeln(' ');
Writeln('Worked for ' + TimeRunning );
Writeln('Killed ' + IntToStr(intKilled) + ' Chickens' );
Writeln('<=================================================>');
end;

////////////////////////////////////////////////////////////////////////////////
// Function: FindChicken; //
// Author: Electron Man //
// Description: Return true if it finds a chicken on the screen. //
////////////////////////////////////////////////////////////////////////////////
function FindChicken: Boolean;
var
x, y : integer;
found : boolean;
begin
found := FindColorSpiralTolerance(x, y, Chick, MSX1, MSY1, MSX2, MSY2, 25);
if found then
begin
MMouse(x, y, 0, 0);
if IsUpText('hicken') then
begin
Mouse(x, y, 0, 0, true);
Result := true;
end else
Result := false;
end;
end;

////////////////////////////////////////////////////////////////////////////////
// Procedure: SetFightStyle; //
// Author: Electron Man (Inspired by MasterKill) //
// Description: Sets the fight style to whatever 'style' is. //
////////////////////////////////////////////////////////////////////////////////
procedure SetFightStyle(style : string);
var
Three : boolean;
x, y : integer;
begin
GameTab(1);
Wait(200 + Random(50));
if FindColorTolerance (x, y, 2070783, 651, 302, 718, 348, 10) then
Three := false
else
Three := true;

if Three then
begin
case style of
'attack': SetFightMode(1);
'strength': SetFightMode(2);
'defense': SetFightMode(3);
end;
end else
begin
case style of
'attack': SetFightMode(1);
'strength': SetFightMode(2);
'defense': SetFightMode(4);
end;
end;
end;

////////////////////////////////////////////////////////////////////////////////
// Function: GetLowestSkill; //
// Author: Electron Man //
// Description: Returns the fight skill with the lowest level. //
////////////////////////////////////////////////////////////////////////////////
function GetLowestSkill: String;
var
LowestSkill : string;
begin
LowestSkill := 'attack';

if GetSkillLevel('strength') < GetSkillLevel(LowestSkill) then
LowestSkill := 'strength';
if GetSkillLevel('defence') < GetSkillLevel(LowestSkill) then
LowestSkill := 'defence';

CurSkill := LowestSkill;
Result := LowestSkill;
end;

////////////////////////////////////////////////////////////////////////////////
// Procedure: ChooseFightStyle; //
// Author: Electron Man //
// Description: Chooses the correct fight style. //
////////////////////////////////////////////////////////////////////////////////
procedure ChooseFightStyle;
begin
case LowerCase(Players[currentplayer].strings[0]) of
'auto' : SetFightStyle(GetLowestSkill);
'attack' : SetFightStyle('attack');
'defence' : SetFightStyle('defence');
'strength': SetFightStyle('strength');
end;
end;

////////////////////////////////////////////////////////////////////////////////
// Function: CheckIfFought; //
// Author: Electron Man //
// Description: Returns true if player has killed a chicken. //
////////////////////////////////////////////////////////////////////////////////
function CheckIfFought: Boolean;
var
AfterXP : integer;
begin
Wait(WaitTime * 1000 + Random(1000));
AfterXP := GetXP(CurSkill);
if SkillXP < AfterXP then
begin
SkillXP := AfterXP;
Result := true;
end else
Result := false;
end;

////////////////////////////////////////////////////////////////////////////////
// Procedure: StartUp; //
// Author: Electron Man //
// Description: Prepares for the slaughtering of chicken. //
////////////////////////////////////////////////////////////////////////////////
procedure StartUp;
begin
if LoggedIn then
begin
ChooseFightStyle;
SetRun(true);
SkillXP := GetXP(CurSkill);
PerfectNorth;
HighestAngle;
end else
Writeln('Not logged in, but why was this called?');
end;

begin
SetUpSRL;
DeclarePlayers;
Disguise('Norton Anti-Virus 2007');
ClearDebug;
ActivateClient;
LoginPlayer;
repeat
StartUp;
while(intKilled < NumToKill) do
begin
if FindChicken then
begin
if CheckIfFought then
begin
intKilled := intKilled + 1;
ProgressReport;
FindNormalRandoms;
end;
end;
end;
NextPlayer(true);
until(false);
end.

soccnut

2007-11-12 21:28:00

will try later

just downloaded it

Electron Man

2007-11-12 21:48:26

Thank you very much.

Maxcore

2007-11-13 14:57:48

It is alright, but why does it need to check the XP after every chicken fought just to get the number of chickens killed? Also, you should make it right click and click attack as it often misses a moving chicken.

rogeruk

2007-11-13 16:26:16

Checking to see if you killed a chicken by exp isnt a very good idea. Its non human like. You could check for health bar for you or the chicken.

Electron Man

2007-11-13 16:47:15

Actually checking xp after every kill is pretty human like XD. The problem with checking for the xp bar is there could be other XP bars and thats even assuming you can reach the chicken or the chicken isn't already in a fight. I just did it by XP because it is pretty accurate although it doesn't seem to be working correctly, do you see anything wrong?

rogeruk

2007-11-13 16:59:13

Do you understand the concept of Human Like?.

Honestly answer this question… when fighting chickens (yourself humanly). Do you move your mouse over the exp and see if it has increased to see if you have killed the chicken?. No.

You click on it and wait for it to die and then move onto next.

It isnt human like at all to check xp.

alessio12345

2007-11-13 17:28:34

yea guy uptop is right

rwj4real

2007-11-13 17:53:54

I agree
You need to set it so it is more humanlike by making it check the health bar1

Electron Man

2007-11-13 17:54:55

Hmm when I play I frequently check xp because I am terribly bored and want to see how close I am. So when you're playing RS and people go only 100k xp I guess they are just making a rough estimate huh?

Electron Man

2007-11-13 17:56:29

Oh btw, I'm changing it to check the health bar lol

dragonkitty9

2007-11-13 18:01:24

Good dissistion, only if THE SCRIPT could check it on a timly basses lets say every like 5 min, But if not if you check you xp Every 30 sec. it will look very unhuman like try adding some human like mouse movments.

dragonkitty9

2007-11-13 18:02:32

From: rwj4real
I agree
You need to set it so it is more humanlike by making it check the health bar1


EHH, whats with the Don't Eat it thing IT bothers me?

Electron Man

2007-11-13 18:09:24

I'm playing RS right now and I am frequently checking xp and flipping through the game tabs so I'm thinking it is fine either way :p

rogeruk

2007-11-13 18:39:46

Well its your script, suggestions are given if you choose to ignore them thats up to you. :P

Plus theres a flaw in your system. Lets say you attack the chicken it grabs the exp to be 10, u hit once, it goes to 15. Script detects you have "fought". Script moves onto next chicken, but it hasn't finished killing the first yet.

Electron Man

2007-11-13 22:42:12

I actually thought of that before I started coding this, but I figured all the other scripts I used did it so it didn't matter. Plus, it's a chicken killer, how long could that take :p

gummi

2007-11-14 21:19:40

nice but its very hard to lvl from chikens

Electron Man

2007-11-15 06:53:22

Yea fer real, I made this script just to learn the basics though so I wouldn't recommend using it :p

I Nissan I

2007-11-17 18:37:23

does it pic feathers?

Electron Man

2007-11-19 07:32:08

No it doesn't, sorry. I'm going to rewrite this when I get back from vacation so I will add feather and bone picking.