SRL Archive - First Scripts

[First script]PwnDemChickens[RS07]


Ghandi

2013-03-27 02:43:46

Hello, I have just joined your forums and was reading countless tuts on how to create my own script. Currently working on this one and simultaneously working on a master farmer pick pocketing script, will probably post beta in the evening (GMT +2).
The script is called PwnDemChickens;

Features:
    [*]AutoLogin[works]
    [*]Supports 4 colours (two for chickens, two for feathers)[works]
    [*]Picks up an occasional feather or two[works]
    [*]MiniBreaker[works]
  • AntiBan[Works]
  • [*]Random Support[Not yet Added]
    [*]DeathWalk[Not yet added]
    [*]Proggy[Haven't decided is it worth it]

Feel free to criticise this as this is my first script and I most definitely know that I still have a long way to go.


[SIMBA=program PwnDemChickens; {$DEFINE SMART} {$I SRL/SRL.Simba} {$I SRL/SRL/Misc/Debug.Simba} {$I P07Include.Simba} const chicCOLOR1 = 1121418; chicCOLOR2 = 1121421; featherColor1 = 11119285; featherColor2 = 12434885; greenLifeBar = 65280; var x, y, x1, y1: Integer; //Declare your username an password procedure P07_DeclarePlayer; begin P07_PlayerName := 'username'; P07_PlayerPass := 'password'; end; //More human like movement Procedure HumanMove; Begin case random(200) of 1..160: MMouse(RandomRange(X - 7, X + 7), RandomRange(y - 7, y + 7), 0, 0); 161..190: MMouse(RandomRange(X - 9, X + 9), RandomRange(y - 9, y + 9), 0, 0); 191..200: MMouse(RandomRange(X - 12, X + 12), RandomRange(y - 12, y + 12), 0, 0); End; End; procedure PickUp(); begin if P07_FindObjCustom(x, y, ['ake'], [featherColor1, featherColor2], 5) then begin sleep(200); HumanMove; sleep(400); if P07_IsUpTextMultiCustom(['ake']) then begin HumanMove; Writeln('Trying to get some feathers.'); ClickMouse2(mouse_left); end; end; end; procedure Antiban; begin case Random(100) of 1: HoverSkill('magic', False); 2: HoverSkill('random', False); 3: Boredhuman; 4: Wait(2500 + random(4500)); 5: HoverSkill('smithing', False); 6: PickUpMouse; 7: RandomMovement; 8: RandomRClick; end; end; procedure MiniBreaker; begin case Random(160) of 1: Wait(40000 + random(7400)); 2: Wait(25500 + random(8550)); 3: Wait(60040 + random(6759)); 4: Wait(20400 + random(2549)); end; end; procedure ClickChick; begin repeat repeat wait(1200); until (FindColor(x, y, greenLifeBar, 206, 127, 298, 196) = false) P07_MakeCompassNorth; if P07_FindObjCustom(x, y, ['Chicken'], [chicCOLOR1, chicCOLOR2], 5) then begin x := x - 20; y := y - 20; if x < 0 then begin x := 0; end; if y < 0 then begin y := 0; end; if FindColor(x1, y1, greenLifeBar, x, y, x + 40, y + 40) = false then begin x := x + 20; y := y + 20; MMouse(x, y, 3, 3); Writeln('Detected a chicken, lets kill it!'); ClickMouse2(mouse_left); PickUp(); end else begin case Random(4) of 0: PickUp(); 1: Antiban(); 2: MiniBreaker(); 3: PickUp(); end; end; end; wait(2000); if (not P07_LoggedIn) then begin P07_LogInPlayer; P07_MakeCameraAngleHigh; P07_MakeCompassNorth; end; until (false) end; begin SetupSRL; P07_DeclarePlayer; SetupP07Include; ActivateClient; Wait(2000); ClickChick; end.]program PwnDemChickens;
{$DEFINE SMART}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I P07Include.Simba}

const
chicCOLOR1 = 1121418;
chicCOLOR2 = 1121421;
featherColor1 = 11119285;
featherColor2 = 12434885;
greenLifeBar = 65280;

var
x, y, x1, y1: Integer;

//Declare your username an password
procedure P07_DeclarePlayer;
begin
P07_PlayerName := 'username';
P07_PlayerPass := 'password';
end;

//More human like movement
Procedure HumanMove;
Begin
case random(200) of
1..160: MMouse(RandomRange(X - 7, X + 7), RandomRange(y - 7, y + 7), 0, 0);
161..190: MMouse(RandomRange(X - 9, X + 9), RandomRange(y - 9, y + 9), 0, 0);
191..200: MMouse(RandomRange(X - 12, X + 12), RandomRange(y - 12, y + 12), 0, 0);
End;
End;

procedure PickUp();
begin
if P07_FindObjCustom(x, y, ['ake'], [featherColor1, featherColor2], 5)
then
begin
sleep(200);
HumanMove;
sleep(400);
if P07_IsUpTextMultiCustom(['ake']) then
begin
HumanMove;
Writeln('Trying to get some feathers.');
ClickMouse2(mouse_left);
end;
end;
end;


procedure Antiban;
begin
case Random(100) of
1: HoverSkill('magic', False);
2: HoverSkill('random', False);
3: Boredhuman;
4: Wait(2500 + random(4500));
5: HoverSkill('smithing', False);
6: PickUpMouse;
7: RandomMovement;
8: RandomRClick;
end;
end;

procedure MiniBreaker;
begin
case Random(160) of
1: Wait(40000 + random(7400));
2: Wait(25500 + random(8550));
3: Wait(60040 + random(6759));
4: Wait(20400 + random(2549));
end;
end;

procedure ClickChick;
begin
repeat
repeat
wait(1200);
until (FindColor(x, y, greenLifeBar, 206, 127, 298, 196) = false) P07_MakeCompassNorth;
if P07_FindObjCustom(x, y, ['Chicken'], [chicCOLOR1, chicCOLOR2], 5) then
begin
x := x - 20;
y := y - 20;
if x < 0 then
begin
x := 0;
end;
if y < 0 then
begin
y := 0;
end;
if FindColor(x1, y1, greenLifeBar, x, y, x + 40, y + 40) = false then
begin
x := x + 20;
y := y + 20;
MMouse(x, y, 3, 3);
Writeln('Detected a chicken, lets kill it!');
ClickMouse2(mouse_left);
PickUp();
end
else
begin
case Random(4) of
0: PickUp();
1: Antiban();
2: MiniBreaker();
3: PickUp();

end;
end;
end;
wait(2000);
if (not P07_LoggedIn) then
begin
P07_LogInPlayer;
P07_MakeCameraAngleHigh;
P07_MakeCompassNorth;
end;
until (false)
end;

begin
SetupSRL;
P07_DeclarePlayer;
SetupP07Include;
ActivateClient;
Wait(2000);
ClickChick;
end.

[ATTACH]20252[/ATTACH]

Sjoe

2013-03-27 02:54:44

Lovely first script :) Keep it up.

I'd suggest u to use SRL-OSR instead of 07Include though. Since that's the official include now. (way more features)
Also has most randoms support

deathcrow

2013-03-27 02:58:04

I agree with Sjoekeloe.

It is refreshing to see a first post by a new member be a first script as well. You are doing very well. Stay motivated and it will take you a long way.

Ghandi

2013-03-27 04:54:54

resolved