SRL Archive - First Scripts

ChickenChoper beta 0.1


Karlanter

2008-07-13 08:12:42

:google: Ok randomness to start with…


Now, this is my first script, its a generic chicken… well… choper… So dont be hatin on me TOOO much.;) So just find a spot with some chickens… and let er loose!


As the title says this is a beta as it is my first and its really not the best…

Known bugs:

1. Somtimes when chickens are moving it misses the beak (have to use beak cause there are 2 differant types of chickens).
2. It tags imps in the vicinity as well as chickens.
3. If a chicken is in a diagonal direction it somtimes misses.


If you find any other bugs please let me know… im attempting to fix the current ones and in my later stages of beta testing it will get better.


Just have fun, and remember DONT STEAL IT!:eek: (like any of you awsome peps would do that!!! :sasmokin: ) Oh and please give me any tips and ill respect ALL feed back unless your flamming me or somthing.

ShowerThoughts

2008-07-13 08:20:12

Hey, there :)


Begin
FindColorTolerance(x,y,RedBeakColor,8,10,515,336,30);
MoveMouseSmoothEx(x,y,1,2,45,20,10);
ClickMouse(x,y,True);
Counter:=0;
Stopper:=False;
Repeat
Counter:=Counter+1;
If ChickenDead Then
Begin
Stopper:=True;
End;
Wait(10000)
Until(Stopper=True) Or (Counter>=5)
End;

you can change that to ;)
Procedure KillChicken;
Var
X,Y,Counter: Integer;
Begin
FindColorTolerance(X, Y, RedBeakColor, 8, 10, 515, 336, 30);
MMouse(X, Y, 5,5);
If IsUpText('icken') then Mouse(x,y,5,5,True);
Counter:=0;
Repeat
Counter:=Counter+1;
If ChickenDead Then Break;
Wait(5000 + Random(2500));//might want to use some randomness ;)
Until(Counter>=5);
End;

only use MMouse and Mouse!!!!!

Hermpie

ss23

2008-07-13 08:22:31

Looks not to bad for a first script.

Scripting standards are a little off. Looks through some tutorials for that.

And a good thing / feature would be to have a thing to check if your on low hp and then it logs out etc.

But decent enough :)

Karlanter

2008-07-13 08:24:42

From: Hermpie
Hey, there :)


Begin
FindColorTolerance(x,y,RedBeakColor,8,10,515,336,30);
MoveMouseSmoothEx(x,y,1,2,45,20,10);
ClickMouse(x,y,True);
Counter:=0;
Stopper:=False;
Repeat
Counter:=Counter+1;
If ChickenDead Then
Begin
Stopper:=True;
End;
Wait(10000)
Until(Stopper=True) Or (Counter>=5)
End;

you can change that to ;)
Procedure KillChicken;
Var
X,Y,Counter: Integer;
Begin
FindColorTolerance(X, Y, RedBeakColor, 8, 10, 515, 336, 30);
MMouse(X, Y, 5,5);
If IsUpText('icken') then Mouse(x,y,5,5,True);
Counter:=0;
Repeat
Counter:=Counter+1;
If ChickenDead Then Break;
Wait(5000 + Random(2500));//might want to use some randomness ;)
Until(Counter>=5);
End;

only use MMouse and Mouse!!!!!

Hermpie


Ill give it a try, thanks.

ss23

2008-07-13 09:13:50

/////////////////////////Karlanters Chicken Choper//////////////////
//////////////////////////////beta version 0.1//////////////////////
/////////////////Don't hate on it to much its my first!!!////////////////
Program ChickenChoper; // <- This is your program line here
{.include srl\srl.scar} // This includes all the srl functions
Const
RedBeakColor=923501;
HealthBar=65280;

Var
ChickenCount: Integer;

Function ChickenDead: Boolean;
Var
x,y:Integer;

Begin

Result:=True;
If(FindColorTolerance(x,y,HealthBar,290,209,471,364,3))Then
Begin
Result:=False;
End;
End;

Procedure KillChicken;
Var
x,y,Counter: Integer;
Stopper: Boolean;

Begin
FindColorTolerance(x,y,RedBeakColor,8,10,515,336,30);
MoveMouseSmoothEx(x,y,1,2,45,20,10);
ClickMouse(x,y,True);
Counter:=0;
Stopper:=False;
Repeat
Counter:=Counter+1;
If ChickenDead Then
Begin
Stopper:=True;
End;
Wait(10000)
Until(Stopper=True) Or (Counter>=5)
End;

Begin // <- Main loop starts here
SetupSRL; // Needed for some SRL functions
MoveToTray;
ActivateClient;
Repeat
KillChicken;
ChickenCount:=ChickenCount+1;
Until(ChickenCount >=200000)
End.


end;

WhoCares357

2008-07-13 16:32:29

    If ChickenDead Then
Begin
Stopper:=True;
End;

|
|
\/

  Stopper := ChickenDead;

Just felt like showing a tip for cutting down on the number of lines. :)

Edit: Karlanter, check out this little tut I made: HERE
There are a lot of tips I could give you for conserving space/making the script a bit better. PM me if you ever need help.

Harkonnen

2008-07-14 17:26:19

Hey I saw that your scripting standards were slightly off just remember the rule of two sort of like this.


procedure Whater;
begin
if somethingyouwantgoeshere then
whateverissupposedtohappenhere;
else something happens
yeah;
end else;
end;
end.

get the picture

P1nky

2008-07-14 18:49:52

small tips:
antirandom
antiban

Claymore

2008-07-14 18:51:56

Try using SRL functions