SRL Archive - First Scripts

First script~ ChickenKiller


UNo

2008-11-06 22:11:22

:spongebob: :sasmokin: :cartman: :fiery: MY FIRST SCRIPT EVER! CHICKEN KILLER BABY!:fiery: :cartman: :sasmokin: :spongebob:

Hi I'm UNo, a new dude to these SRL forums, and I made a script that kills chickens, which I know works. The only problems that I have had with it are that it sometimes attacks the farmer on the other side of the barn, but that sometimes resolves itself, as the script starts looking for another chicken by the time it gets to the farmer. I will find a way to resolve this problem and others that you guys have, in future updates. Also at the moment I do not have a proggie, but I promise that I will have that in the next update.

CREDITS
d1s3l- Feather pickup procedure
SRL- many tutorials
If i forgot you Im deeply sorry

Future Updates
Proggie (main idea so far)
adding forms
a way to fix farmer bug
better feather pickup
inclusion of S.M.A.R.T
More Antiban/Antirandoms
fix a bug where script has problems logging into next player
picking up and cooking raw chicken
picking up and burying bones
Anything else that you guys and I can think of

INSTRUCTIONS

Make sure your character is at either the chicken farm near the cow pen or near on other side of the river near lumbridge

it doesn't matter if they are logged in or not when you start the script

fill in your pass and usernames, and nicknames in the declare players section

Edit the CONST section to your liking

DOWNLOAD

Ive posted a link for now because the manage attachments button isnt working… I dont know why
Anywho, without further ado, here is the download, please comment ChickenKiller v1

D1zl3

2008-11-06 22:26:01

haha like your feather procedure ;) just ask me if you need help with that next time:P
and the main loop haha

UNo

2008-11-06 22:32:17

Omg I Totally Forgot To Give U Credit! Im Sorry Man

D1zl3

2008-11-06 22:35:24

From: UNo
Omg I Totally Forgot To Give U Credit! Im Sorry Man


haha no prob and if you need help with it I can:P

UNo

2008-11-06 22:51:00

thanks ill keep that in mind. this is like my 5th day with SCAR so im still having a little trouble

killer1111111

2008-11-07 15:02:11

lol, nice script but it picks up like 1 pile of feathers every 5 chickens :)

~BobFm~

2008-11-07 15:08:24

I took a look and it still needs work but good for first script :D

UNo

2008-11-08 21:07:55

thanks, and I'll look into your problem killer. I'm still working on the progress report, its just that I don't get around to scripting that often

Tniffoc

2008-11-08 21:18:54

Here's a way to fix the problem stated at the beginning : IsUpText('Some Text'); checks to see if the "Hover text" of Runescape is something… You could do the following…

if(IsUpText('hicken')) then // "hicken" instead of "chicken" because you can't use the first letter in UpTexts
Mouse(x,y,2,2,true);

thecon21

2008-11-09 05:19:00

problem fixed.

UNo

2008-11-09 15:31:55

thanks for the advice Tniffoc

Edit: i will post the new update tomorrow, but i got to go to a romeo and juliet play

exhounter

2008-11-09 15:48:04

i will try this script :D

savagekiller

2008-11-11 17:27:18

Every time I run the script I get this error
"Line 1: [Error] (1:1): Unable to register function function FindGapsTPA(TPA : TPointArray; MinPixels: Integer): T2DPointArray; in script"

I copyed and pasted it exactly how you had it… What is the problem?

joelster134

2008-11-17 13:40:56

From: savagekiller
Every time I run the script I get this error
"Line 1: [Error] (1:1): Unable to register function function FindGapsTPA(TPA : TPointArray; MinPixels: Integer): T2DPointArray; in script"

I copyed and pasted it exactly how you had it… What is the problem?




have you got latest SVN/REV/SRL version? have you installed?

Dani Bolton

2009-01-18 10:39:00

Great Script I am now using this with my army!
Thanks
Dani Bx

Jmanx

2009-01-18 11:14:10

Testing once i get to the chicken place…

Will post proggy

EDIT: Tried it but it was simply to slow to find chickens o.O it actually picked up the feathers though, so its good enough.

Ill try it later for a long time and see what i get.

Dani Bolton

2009-01-18 11:20:40

Your script is great there is very little wrong with it!

I have managed to add S.M.A.R.T. to it:

program ChickenKiller;
{.include SRL/SRL/Misc/Smart.scar}
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\fighting.scar}

const
SmartWorld = 11;
Signed = True;


const
ChickenColor1 = 8167863 ;//set white chicken color, to get specific color I suggest you go to runehq and find chicken under monsters
ChickenColor2 = 2972796 ;//set brown chickens color, and ditto
KillsPerPlayer = 500 ; //sets kills before switching to next player
KillTime = 6750 ;// estimate time it takes you to kill a chicken
var
x, y, CurrentPlayerKills : integer;

procedure AntiRandoms;
begin
if not LoggedIn then Exit;
FindNormalRandoms;
end;

procedure SetupSmart;
begin
SmartSetupEx(Smartworld,false,signed,false); //extra false is for the detail
ClearDebug;
WriteLn('Setting up Smart… Please Hold…');
Wait(10000 + random(5000));
SetTargetDC(SmartGetDC);
While not(SmartActive) do Wait(100); //smartactive instead of smartready
end;


procedure AntiBan;
begin
if not LoggedIn then Exit;
case (Random(30)) of
5: HoverSkill('attack', False);
11: RandomMovement;
24: PickUpMouse;
27: begin
Gametab(1 + Random(12));
Gametab(4);
end;
30: SleepAndMoveMouse(300);
end;
end;

Procedure DeclarePlayers;
begin
NumberOfPlayers(8);
CurrentPlayer := 0;

Players[0].Name :='chromo 1';
Players[0].Pass :='****';
Players[0].Nick :='chro';
Players[0].Active :=True;


end;

procedure AttackChicken1;
begin
if not Loggedin then Exit;
if FindObj(x, y, 'ttack', ChickenColor1,10) then
begin
Mouse(x, y, 2, 3, False);
if ChooseOption('ttack') then
begin
wait(KillTime);
Inc(CurrentPlayerKills);
Exit;
end;
end;
end;

procedure AttackChicken2;
begin
if not Loggedin then Exit;
if FindObj(x, y, 'ttack', ChickenColor2,10) then
begin
Mouse(x, y, 2, 3, False);
if ChooseOption('ttack') then
begin
wait(KillTime);
Inc(CurrentPlayerKills);
Exit;
end;
end;
end;

procedure FindFeathers;
begin
if not LoggedIn then exit;
if (FindObjCustom(x, y, ['eat', 'ther'], [403205,403717,12632520], 5)) then
begin
Mouse(x, y, 2, 2, False)
if not(ChooseOption('ake')) then
wait(500);
Exit;
end else
end;

begin
SetupSRL;
SetupSmart;
DeclarePlayers;
if LoggedIn then Logout;
LoginPlayer;
repeat
AttackChicken1;
FindFeathers;
AttackChicken2;
FindFeathers;
AntiRandoms;
Antiban;
if CurrentPlayerKills = KillsPerPlayer then
begin
NextPlayer(true);
end;
if not Loggedin then NextPlayer(False);
until(false)
end.


There ^^^^^ see what you think!?

Dani B x

HarryJames

2009-01-18 13:41:48

From: Dani Bolton
Your script is great there is very little wrong with it!

I have managed to add S.M.A.R.T. to it:

program ChickenKiller;
{.include SRL/SRL/Misc/Smart.scar}
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\fighting.scar}

const
SmartWorld = 11;
Signed = True;


const
ChickenColor1 = 8167863 ;//set white chicken color, to get specific color I suggest you go to runehq and find chicken under monsters
ChickenColor2 = 2972796 ;//set brown chickens color, and ditto
KillsPerPlayer = 500 ; //sets kills before switching to next player
KillTime = 6750 ;// estimate time it takes you to kill a chicken
var
x, y, CurrentPlayerKills : integer;

procedure AntiRandoms;
begin
if not LoggedIn then Exit;
FindNormalRandoms;
end;

procedure SetupSmart;
begin
SmartSetupEx(Smartworld,false,signed,false); //extra false is for the detail
ClearDebug;
WriteLn('Setting up Smart... Please Hold...');
Wait(10000 + random(5000));
SetTargetDC(SmartGetDC);
While not(SmartActive) do Wait(100); //smartactive instead of smartready
end;


procedure AntiBan;
begin
if not LoggedIn then Exit;
case (Random(30)) of
5: HoverSkill('attack', False);
11: RandomMovement;
24: PickUpMouse;
27: begin
Gametab(1 + Random(12));
Gametab(4);
end;
30: SleepAndMoveMouse(300);
end;
end;

Procedure DeclarePlayers;
begin
NumberOfPlayers(8);
CurrentPlayer := 0;

Players[0].Name :='chromo 1';
Players[0].Pass :='****';
Players[0].Nick :='chro';
Players[0].Active :=True;


end;

procedure AttackChicken1;
begin
if not Loggedin then Exit;
if FindObj(x, y, 'ttack', ChickenColor1,10) then
begin
Mouse(x, y, 2, 3, False);
if ChooseOption('ttack') then
begin
wait(KillTime);
Inc(CurrentPlayerKills);
Exit;
end;
end;
end;

procedure AttackChicken2;
begin
if not Loggedin then Exit;
if FindObj(x, y, 'ttack', ChickenColor2,10) then
begin
Mouse(x, y, 2, 3, False);
if ChooseOption('ttack') then
begin
wait(KillTime);
Inc(CurrentPlayerKills);
Exit;
end;
end;
end;

procedure FindFeathers;
begin
if not LoggedIn then exit;
if (FindObjCustom(x, y, ['eat', 'ther'], [403205,403717,12632520], 5)) then
begin
Mouse(x, y, 2, 2, False)
if not(ChooseOption('ake')) then
wait(500);
Exit;
end else
end;

begin
SetupSRL;
SetupSmart;
DeclarePlayers;
if LoggedIn then Logout;
LoginPlayer;
repeat
AttackChicken1;
FindFeathers;
AttackChicken2;
FindFeathers;
AntiRandoms;
Antiban;
if CurrentPlayerKills = KillsPerPlayer then
begin
NextPlayer(true);
end;
if not Loggedin then NextPlayer(False);
until(false)
end.


There ^^^^^ see what you think!?

Dani B x





Fixed. Use
 tags please.

SantaPker

2009-01-18 14:45:24

Nice job for a first script ;)
Prety slow to find a chicken, but the pickup feathers works fine :)

Im going to let it run for an hour now and then i'll see what i get.


Gl making other scripts, ur gonna make it!

runegold

2009-01-22 20:13:04

kool i will use to train my new account

jackchen10

2009-01-31 19:09:10

the script just makes my mouse click and it stays in the same spot and i can't move it. do i have to be logged in first?