SRL Archive - First Scripts

auto woodcutter


faster789

2007-09-30 19:14:37

I got most of information from tuts..is there anything i need to add plz tell me…this my first script..;) :spot:

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

const
LoadsPerPlayer = 10; //Amounts of loads per player before switching.
TreeColor = 411969; //Fill in the treecolor here.
WaitPerTree = 5000; //the time to wait while we are chopping the tree in Miliseconds.

function FindFastRandoms: Boolean; // WT-Fakawi
var
i: Integer;
begin
for i:=1 to 10 do
begin
case I of
1: If FindDead then
Result := True;
2: If FindMod then
Result := True;
3: If FindMime then
Result := True;
4: If FindMaze then
Result := True;
5: If FindQuiz then
Result := True;
6: If FindDemon then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;
8: if FindTalk then result:= true;
end;
wait(1);
end;
end;
Procedure AntiBanActions;
var
Ban: Integer;
begin
Ban:= Random(10);
case Ban of
0: Almostlogout;
1: SayCurrentLevels('woodcutting');
2: PickUpMouse;
3: RandomMovement;
4: BoredHuman;

end;
end;

procedure ChopTree;
var
x, y, MyMark : integer;
begin
if not Loggedin then Exit;
MarkTime(MyMark);
repeat
if FindObj(x, y, 'hop', TreeColor, 50) then
begin
Mouse(x, y, 0, 0, False);
if ChooseOption('hop') then
begin

Wait(WaitPerTree);
Exit;
end;
end;
if TimeFromMark(MyMark) > (1 * 60 * 100) then
begin
Logout;
Exit;
end;
until false
end;

begin
SetupSRL;
SRLPlayerForm(True, [], [], [], []);
if LoggedIn then Logout;
LoginPlayer;
repeat
ChopTree;
if InvFull then
begin
DropToPosition(2, 28);
Inc(Players[CurrentPlayer].Banked);
if Players[CurrentPlayer].Banked mod LoadsPerPlayer = 0 then
begin
NextPlayer(True);
end;
end;
if not Loggedin then NextPlayer(False);
until false

end.

JNCR

2007-09-30 19:54:20

You should make your waits randomized. Ex: Wait(WaitPerTree + Random(1000));.

Also, I dont see anywhere where you call your antirandom and antiban procedures. You should probably do the antiban after every couple of trees cut, after every level gained, ect. Also, you should call the antirandom procedure if you cannot cut the tree or if you cannot see any game tabs.

Also, when posting your script, you should encase your script with the
 tags.  It just makes it easier to read. (In the advanced menu you highlight the script and press the SCAR logo).  

~JNCR

faster789

2007-09-30 20:30:53

thanks a lot! ill make it beter…

Smartzkid

2007-09-30 20:59:10

Put [noparse]
[/noparse] around your script; it makes it look all pretty :)

You have a lot to learn, but you are quite talented.

HyperSecret

2007-10-01 01:50:46

yes like smartz said put scar tags around…makes alot easier for us to read and be able to help