SRL Archive - First Scripts

leeds tree destroyer -OSR


leeds4eva

2013-11-02 19:56:01

just a basic script i made while i was learning. decided to make public since all the low level scripts are broken/outdated.This script has very little anti ban and prob a high chance of a ban so babysit it!
this is my first script,i will update when i get better at scripting.

program mikeswc;
{$DEFINE SMART8}
{$i SRL-OSR/Srl.simba}

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;

procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
case Random(8) of
0:
begin
HoverSkill('Woodcutting', false);
wait(2453+Random(432));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(100+random(133));
MakeCompass('S');
wait(50+random(133));
MakeCompass('N');
end;
end;
end;

procedure ChopTree;
var x, y: integer;
begin
repeat
if FindObj(x, y, 'hop',2583407, 35) then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
end;
repeat
wait(400+random(250));
AntiBan;
Until not IsUpText('ew') or (InvFull);
until(InvFull);
end;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
ChopTree;
end.

enjoy

Sjoe

2013-11-02 19:59:18

hey nice first release :)

u can use simba tags btw to make your script easier to read. Put:
 (your script here) [/SlMBA] around the script.

[B]Scripting wise: [/B]

1)
u should pick your colors with AutocolorAid => tutorial by yohojo [URL="http://villavu.com/forum/showthread.php?t=71074"](click me)[/URL]
This'll give you way more [B]accurate results[/B]. Thus improving the script's stability!

2)
The following code is a potential infinite loop: meaning it could get stuck inside this loop.
To get rid of that u could use a timer (look below)
[simba]
repeat
wait(400+random(250));
AntiBan;
Until not IsUpText('ew') or (InvFull);



markTime(t);
repeat
wait(400+random(250));
AntiBan;
Until (not IsUpText('ew')) or (InvFull) or (TimeFromMark(t) > 10000);
This will exit the loop after 10 seconds (calculated in ms), preventing it to get stuck in the loop!

don't forget to declare t in your variables as an integer, or you'll get the 'unknown identifier' error.

var
t: Integer;

There is another potential infinite loop inside the same procedure, can u spot it? :)

3)
Next step is getting your script to drop all the logs and repeat the chopping process :p

leeds4eva

2013-11-03 03:05:29

tried addin ur code if fail's to compile

leeds4eva

2013-11-03 03:13:08

i made this script using guides im just getting used to this

leeds4eva

2013-11-03 03:33:22

anyone know why this wont drop?{$DEFINE SMART8}
{$i SRL-OSR/Srl.simba}

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;

procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
case Random(8) of
0:
begin
HoverSkill('Woodcutting', false);
wait(2453+Random(432));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(100+random(133));
MakeCompass('S');
wait(50+random(133));
MakeCompass('N');
end;
end;
end;

procedure ChopTree;
var x, y: integer;
begin
repeat
if FindObj(x, y, 'hop',2583407, 35) then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
end;
repeat
wait(400+random(250));
AntiBan;
Until not IsUpText('ew') or (InvFull);
until(InvFull);
end;
procedure Droplogs;
begin
If InvFull then
DropAllExcept([1]);
Wait(200+Random(100))
end;
begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
ChopTree;
end.

Sjoe

2013-11-03 05:03:07

use simba tags please,

droplogs isn't in your mainloop.