SRL Archive - First Scripts

First "Good" Script


souppy

2007-12-06 22:42:34

This is truthfully my 3rd script, but this is my largest and most diverse one yet.

PLEASE DON'T POST ON MY OTHER THREAD.



//Souppy's First Autowoodcutter\\



program SimplePowerChopper;
{.include SRL/SRL.scar}


var
i,x,y:Integer;
Loads : Integer;
Dropped : Integer;
Prog : Integer;

const
TreeColor1 = Insert Color Here;//Insert tree color here
TreeColor2 = Insert Color Here;//Insert 2nd tree color here
TotalLoads = 10;//How many loads you want to cut

Procedure DeclarePlayers;

Players[0].Name := ''; // Name of your player
Players[0].Pass := ''; // Password of player
Players[0].Nick := ''; // 3 Letters of Name, No Spaces
Players[0].Active := True; // Leave this

end;

procedure CutTree; //Cuts the tree you specified
begin

Disguise ('Norton Anti-Virus')
i:= 0;
repeat
i:=i + 1;
if(FindColor(x,y,TreeColor1,0,0,700,700)) or
(FindColor(x,y,TreeColor2,0,0,700,700)) and
IsUpText('Cut') then
begin
Wait(1000 +random(500))
Mouse(x, y, 3, 3, True);
Wait(5000 +random(500));
end;
Wait(700);
until(InvFull);
end;

procedure AntiBan;
begin
case random(30) of
1: Boredhuman
3: hoverskill('Random',false)
5: begin
RandomRClick
clickoption('Cancel',1)
end;

procedure Drop;
begin
If (InvFull) then
begin
DropTo(2,28);
end else
end;

procedure DoAntiRandoms;
begin
FindTalk;
FindNormalRandoms;
if (FindFight = true) then
begin
RunAwayDirection('N');
Wait(1000+random(2000));
RunBack;
end;
end;

begin

SetupSRL;
Drop;
end.

How does this look ?
It may have some errors/bugs, I'm trying to tweak them as we type.

XRaye

2007-12-06 22:45:41

i would say that looks pretty good!

souppy

2007-12-06 22:46:27

Thanks Xraye. I just created it, I'm trying to make things that are gradually getting harder.

P1nky

2007-12-06 23:12:52

not bad =S

no anti-randoms/ent finding

HEY ITS GOOD STILL WORKS =)
btw go ahead check mine to get ideas not copy =)

souppy

2007-12-06 23:19:22

Thanks P1nky. It does have antirandom.

I have not yet added ent finder, but I will soon enough.

RobinHood

2007-12-07 03:51:48

Add some tolerance to the colors so it can find similair colors and click on semi-different spots. Other than that it looks like a decent first (or third =p) script.

Try looking at what others use to randomize their procedures and use that to inspire you to incorporate your own.

ss23

2007-12-07 06:31:31

Wtf? Is it just me or is the CutTree procedure not included in the main loop?

Santa_Clause

2007-12-07 06:43:25

 
procedure CutTree; //Cuts the tree you specified
begin

Disguise (Norton Anti-Virus)
i:= 0;
repeat
i:=i + 1;
if(FindColor(x,y,TreeColor1,0,0,700,700)) or
(FindColor(x,y,TreeColor2,0,0,700,700)) and
IsUpText('Cut') then
begin
Wait(1000 +random(500))
Mouse(x, y, 3, 3, True);
Wait(5000 +random(500));
end;
Wait(700);
until(InvFull);
end;

Should be:

Disguise('Norton AntiVirus');

gerauchert

2007-12-07 08:14:20

procedure CutTree; //Cuts the tree you specified
begin

Disguise (Norton Anti-Virus)
i:= 0;
repeat
i:=i + 1;
if(FindColor(x,y,TreeColor1,0,0,700,700)) or
(FindColor(x,y,TreeColor2,0,0,700,700)) and
IsUpText('Cut') then
begin
Wait(1000 +random(500))
Mouse(x, y, 3, 3, True);
Wait(5000 +random(500));
end;
Wait(700);
until(InvFull);
end;

you should put a failsafe where you have the i variable used. So like something similar this:

if(i = 20)then
break;

// or you could have it like this

until(InvFull) or (i = 20);

just an idea, but you need to remember to reset i to 0 after each succesful click on the tree…otherwise after the first 20 total searches the script would totaly stop ;)

souppy

2007-12-07 08:25:02

Thanks for all the posts guys.

I will work on add some randomizing and some failsafes.

n3ss3s

2007-12-07 09:24:57

Add CutTree to the mainloop.

Gj.

Markus

2007-12-07 10:33:47


begin

SetupSRL;
Drop;
end.

Where's the tree cutting stuff ^^

gerauchert

2007-12-07 10:40:42

From: n3ss3s
Add CutTree to the mainloop.

Gj.


n33s3s beat you :D

:ontopic: i think that your cutting would improve dramaticallly if you use findobj or findobjcustom instead of your regular color searching. Try it out and see if you like it ;)