This is a great first script. Much better than my first 
A few suggestions:
Players strings 1 (the should axe be equipped) should use a boolean variable. A boolean variable can only hold two types of values: true and false. That sounds perfect in this case.
[scar]Players[0].Booleans[0] := true; //true to equip, false for in inventory[/csar]
For your random finding, maybe give the user an option for what to use the lamp on? You could this as a constant or you could add another string to the Players array.
Why is Text an array of string? A normal string would work just fine there.
In CutTree, there are a few problems near FindObjTPA:
1) FindObjTPA moves the mouse to the object already. You do not need to call another MMouse to move there again.
2) then, you click the mouse at a random spot around there too.
3) Both those things combined are very unhuman and could cause you to miss the tree. You should do:
SCAR Code:
FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text)
//MMouse(x, y, 4, 4); Get rid of this
GetMousePos(x,y); //Get the current mouse position, which is where
begin //the tree was found
case Random(2) of
0 : begin
Mouse(x, y, 0, 0, False); //Click where the tree was found,
Wait(1500 + Random(2000)); //not a random spot near there
ChooseOption('hop');
end;
1 : Mouse(x, y, 0, 0, True); //Click where the tree was found,
//not a random spot near there
end;
Some more adjustments to that (didn't want to cram too many comments into the above one):
SCAR Code:
FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text)
GetMousePos(x,y);
//begin //unnecessary begin/end
//Took out the case. With 2 cases or less it actually takes more lines
if(random(2) = 1)then
begin
Mouse(x, y, 0, 0, False);
Wait(1500 + Random(2000));
ChooseOption('hop');
end else
Mouse(x, y, 0, 0, True);
Wait(4500 + Random(3000));
AntiRandoms;
AntiBan;
//end; // unnecessary
In here:
SCAR Code:
until (Invfull) or not FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text);
while (not FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text)) do
Wait(1500 + Random(2000));
You may want to drop the logs if the inventory is full before waiting until finding the tree? Do like:
SCAR Code:
until (Invfull) or not FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text);
if(InvFull)then Drop; //You will need to put the drop procedure
//above CutTree
while (not FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text)) do
Wait(1500 + Random(2000));
I would also try some MarkTimes because you do have some possible infinite loops here. For the first one (example), what if the script is finding the obj tpa but not chopping because you lost your axe, and therefore the inventory isn't filling up either? Then this loop will go on forever.
Try creating an integer variable called Timer, and then:
SCAR Code:
MarkTime(Timer);
repeat
if(TimeFromMark(Timer) > 600000+random(100000))then
begin
//gone on for over 10 minutes
Writeln('Problem chopping the logs');
Exit; //Get out of this procedure
end;
SetTree;
FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text)
MMouse(x, y, 4, 4);
begin
case Random(2) of
0 : begin
Mouse(x, y, 4, 3, False);
Wait(1500 + Random(2000));
ChooseOption('hop');
end;
1 : begin
Mouse(x, y, 3, 4, True);
end;
end;
Wait(4500 + Random(3000));
AntiRandoms;
AntiBan;
end;
until (Invfull) or not FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text);
And also with your while:
SCAR Code:
MarkTime(Timer);
while (not FindObjTPA(x, y, Tree, 7, 2, 20, 20, 12, Text)) do
begin
Wait(1500 + Random(2000));
if(TimeFromMark(Timer) > 20000 + random(5000))then //over 20 seconds
break; //Get out of the loop
Your drop procedure could be shortened a good amount:
SCAR Code:
procedure Drop;
begin
Inc(LoadsDone);
if(lowercase(Players[CurrentPlayer].Strings[1]))then
begin
DropAll; //SRL function to drop everything in inventory
IncEx(LogsCut, 28);
end else
begin
for i:= 2 to 28 do
DropItem(i);
IncEx(LogsCut, 27);
end;
AntiRandoms; //Moved to bottom because you do it either way
AntiBan;
end;
You also were incrementing LogsCut if Players Strings[1] wasn't true 27 times because you had it in the for loop.
In your main loop:
SCAR Code:
if (not LoggedIn) then
NextPlayer(True);
Change NextPlayer(True); to NextPlayer(False);
I am really impressed by some of the advanced techniques you used. I don't mean to discourage you with everything I pointed out, but you still just have a few things to work on. Keep working at it, and I'm sure you will become an SRL member sometime in the future.
If you are interested in learning a little more advanced object finding than FindObjTPA, you may find some use in reading my tutorial: http://www.villavu.com/forum/showthread.php?t=48915
Cheers!
~JAD