SRL Archive - First Scripts

Wood Cutter


Jacob

2007-09-25 20:40:59

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

const
LoadsPerPlayer = 10;

procedure DeclarePlayers;
begin
SetupPlayers;

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

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

LoadPlayerArray;
end;
var
x, y, Mymark : integer;
begin
if not Loggedin then Exit;
MarkTime (MyMark);
Repeat
if FindObj (x, y, 'hop', TreeColor, 30) then
begin
Mouse(x, y, 0,0, False);
if ChooseOption ('hop') then
begin
Wait (WaitPerTree)
Exit;
end;
end;
if TimeFromMark (MyMark) > (2 * 60 * 100) then
begin
Logout
Exit;
end;
until false
end;

The guy who made the tutorial was great!
I learned a lot from it. Well heres my first script.

pirates850

2007-10-15 17:25:07

dosent work :mad:

grbr101

2007-10-15 21:51:45

um its small and there are no instructions do not get how to use it

pie ownage0

2007-10-17 22:21:37

I dont know too much about scripting yet, but this I know is wrong

procedure DeclarePlayers;
begin
SetupPlayers;

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

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

LoadPlayerArray;
end;


you cant have two player 0's and you forgot to put a number of players line
in there.

Pancakes

2007-10-17 22:30:45

Use standards my friend. Also you have all the things to do in the main procedure which is a bad idea.

Just go like:

procedure ChopTrees;
begin
//Procedure for chopping a single tree in here.
end;
procedure DropLogs;
begin
//Procedure for a full inventory of logs in here.
end;

//Then this is your main loop.
begin
repeat
repeat
ChopLogs;
until(InvCount = 28) or (Not(LoggedIn));
DropLogs;
until(false);
end.

Mind you, that is just psuedo-code, youll have to actually script it yourself.