SRL Archive - First Scripts

ChickenKiller


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.

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.

KillSwitch

2008-02-26 07:19:49

I get that error :'(

User specified a new RS window
Successfully compiled
SRL Compiled in 0 msec
[Runtime Error] : Exception: Access violation at address 019310AB in module 'Embedded SMART.dll'. Read of address 000006DC in line 47 in script D:\Documents and Settings\All Users\Desktop\SCAR 3.14\includes\SRL/SRL/misc/Smart.scar

skilld u

2008-02-26 21:57:41

Its pretty good for a first script, I have a few suggestions though.

For your antiban I suggest making it so that there is more than one thing each time:

case Random(20) of
0: begin
RandomRClick;
Wait(40 + Random(20));
Mouse(40 - Random(20), 30 + Random(20), 5, 5, False);
Wait(10 + Random(55));
MMouse(5 + Random(60),5 + Random(60),5,5);
end;
1: begin
BoredHuman;
Wait(40 + Random(30));
MMouse(20,49,10,10);
end;...

You could also maybe add a feather picker. Shouldn't be too hard to add that, just use FindObj or FindObjCustom.

You could make your own IsFightAt function, Just make check if the red or green color is near the chicken. People like it when you make your own functions. :p

Also you did not use the SRL Stats right. You should read pwnz0rs tut on putting SRL Stats in scripts.

It does Not check for randoms, for it to do that you have to add FindNormalRandoms somewhere in the script.

You never break out of your loop, so it will just continue doing that forever, and since you dont have FindNormalRandoms it will never know if your character is False or not. You should add if not LoggedIn then Break; in your AttackChicken procedure.

Also no multiplayer. I'm not really sure how to explain it so I just edited it in to your main loop.
procedure MainLoop;
var
playerTime : integer;
begin
repeat
repeat
MarkTime(playerTime);
if not LoggedIn then Exit;
ManageBanEvasion;
AttackChicken;
until (TimeFromMark(playertime) * 60) >= 7));
NextPlayer(LoggedIn); //this checks and if your current player is logged in
until(false); // and if it is then it switches players leaving the
end; //current one active

Fasga

2008-02-26 23:17:31

First of all, if you look at the ManageBanEvasion function, you'll notice that I'm calling FindNormalRandoms. Also, why would I make my own function when it's already provided? Unless, of course, it doesn't work. I've implemented a few of your suggestions, see the main post. Thanks!

Adolis

2008-02-26 23:39:18

You're much ahead of me. I have yet to attempt to make a script. What you have looks good and their input is also pretty good.

HellBoyz

2008-02-26 23:40:33

we like to see extraordinary instead of normal simple script tr to make it sound like your special…

KoodiHirmu

2008-02-28 11:35:00

Failed when compiling :(

Puretheif295

2008-10-03 17:23:08

nice

good script :)

joelster134

2008-10-03 19:31:26

looks good, will test soon. how theh ell you make like that :P i tried (Joelster134's chicken rape) and its TERRIBLE! lol.

BTW showed up with this ( i delete the {.include SRL/SRL/misc/Smart.scar} just cuz i hate smart :) and it came up with this

Failed when compiling
Line 31: [Error] (16315:24): Invalid number of parameters in script

then i put back SMart line and it still came up with same error.

noidea

2008-10-03 21:25:55

Guys, this is 7 months old. It wont work, it's out dated.

joelster134

2008-10-06 08:56:07

From: Puretheif295
good script :)



Nice spamming Puretheif295 :) love double posting!! kidding lol…try and read some tuts and make your own script or at least post constructive feedback or atleast try to :)

in2it

2008-10-12 05:51:56

Nice script add feather pick up code soz im not sure what the code is but good job for your first script :f:

jackchen10

2009-01-31 19:40:53

Failed when compiling
Line 31: [Error] (16498:24): Invalid number of parameters in script

ian.

2009-02-05 21:09:31

From: jackchen10
Failed when compiling
Line 31: [Error] (16498:24): Invalid number of parameters in script


script is outdated

agentkid15

2009-02-05 21:40:15

hes a tip for feather picking, hes a code from one of my scripts the cmds might be outdated but this is what it lookes like

procedure PickFeather;
begin
FindObjCustom(x,y, ['Feather','eath', 'eather'], [FeatherColor1,FeatherColor2], Tolerance);
begin
Mouse(x,y,5,5,False);
ChooseOption('eather');
Wait(400);
end;
end;

MtW

2009-02-28 05:25:10

nice script.