Zach1188
2007-10-27 19:20:37
This is my first attempt on a practical script. It is near complete, I would just like some feedback thus far.
Features:
Rotates map if tree cannot be found.
Randomly rotated map.
Effective ent detection.
Detects first free inv slot (see below).
Fast tree detection.
Decent anti-randoms (detects talking randoms quickly =P)
Logs out of unsolvable random is found
Basic (incomplete) report
Lacking (Coming soon):
Decent anti-ban
Detect all axes broken/lost
Multiplayer
Instructions:
Put all items in the first inventory slots. If you skip any slots, some logs will be skipped and/or other items will be dropped. I recommend getting 5 steel axes, wielding one and putting 4 on the top 4 inventory slots. It detects the last used slot, and drops everything after that. Don't start with logs in your inventory, they will be skipped. Always have at least one axe in your inventory. If you have one axe, dont wield it (this doesn't apply yet, but it will when I make axe detection).
Start Runescape with Low Detail, Unsigned client. Set your computer to 32-bit colors. Scar 3.12c and SRL 4 required.
Features:
Rotates map if tree cannot be found.
Randomly rotated map.
Effective ent detection.
Detects first free inv slot (see below).
Fast tree detection.
Decent anti-randoms (detects talking randoms quickly =P)
Logs out of unsolvable random is found
Basic (incomplete) report
Lacking (Coming soon):
Decent anti-ban
Detect all axes broken/lost
Multiplayer
Instructions:
Put all items in the first inventory slots. If you skip any slots, some logs will be skipped and/or other items will be dropped. I recommend getting 5 steel axes, wielding one and putting 4 on the top 4 inventory slots. It detects the last used slot, and drops everything after that. Don't start with logs in your inventory, they will be skipped. Always have at least one axe in your inventory. If you have one axe, dont wield it (this doesn't apply yet, but it will when I make axe detection).
Start Runescape with Low Detail, Unsigned client. Set your computer to 32-bit colors. Scar 3.12c and SRL 4 required.
program SimplePowerChopper;
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\WoodCutting.scar}
const
TreeType = 2; //0 = Tree/Dead tree, 1 = Oak, 2 = Willow
//Yews are NOT recommended for training, use Willow.
//If you insist on cutting Yews however, enter 3.
TreeColor = 3307371; //Works for me, only change if necessary or if cutting dead trees
TreeTol = 4; //Tolerance. If you don't know what this means, procede to press Alt - F4
RunDirection = 'E'; //Direction to run if attacked
RunDefault = False; //Run under normal circumstances
var
TreeName: string;
LogsChopped, Loads, i, InvUsed, InvUsedReport: integer;
TreePTS: TPointArray;
procedure DeclarePlayers;
begin
Disguise('Norton Anti-Virus');
//No multiplayer yet!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
HowManyPlayers:=1; //DONT CHANGE UNTIL I MAKE MULTIPLAYER
NumberOfPlayers(HowManyPlayers); //DONT CHANGE UNTIL I MAKE MULTIPLAYER
CurrentPlayer := 0; //DONT CHANGE UNTIL I MAKE MULTIPLAYER
Players[0].Name :='Runescape'; //Your username
Players[0].Pass :='password'; //Your password
Players[0].Nick :='esca'; //3 - 4 letters of username. ie "Runescape" could be "esca"
Players[0].Active := True; //Is the Player used?
SetScreenName(Players[0].Nick);
writeln(inttostr(HowManyPlayers)+' Players');
end;
procedure SetSettings;
begin
case TreeType of
0: TreeName:= 'Tree';
1: TreeName:= 'Oak';
2: TreeName:= 'Willow';
3: TreeName:= 'Yew';
end;
InvUsed:= InvCount + 1;
InvUsedReport:= InvCount;
writeLn('First free inventory slot: ' + IntToStr(InvUsed));
writeLn('Tree: ' + TreeName);
SetRun(RunDefault);
GameTab(4);
HighestAngle;
SendArrowWait(2, 400 + Random(100)); //Lowers cameras slightly
//Makes ent detection more accurate
end;
procedure Report;
begin
writeLn('//////////Simple PowerChopper by Zach1188\\\\\\\\\\\\');
writeLn('// \\');
writeLn(' Logs Chopped: ' + IntToStr(LogsChopped) + '. Loads: ' + IntToStr(Loads));
writeLn(' Complete report coming soon.... ');
writeLn(' ');
writeLn('\\ //');
writeLn('\\\\\\\\\-------------------------------/////////////');
end;
function FindFastRandoms: Boolean; //By WT-Fakawi, ALL credits to him.
var
i: Integer;
begin
for i := 1 to 8 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;
7: begin
if InBlack then
begin
Result := True;
Players[CurrentPlayer].loc := 'InBlack';
Logout;
Exit;
end;
end;
8: RC;
end;
wait(1);
end;
end;
procedure EndAuto;
begin
if LoggedIn then LogOut;
Report;
writeLn('Unsolvable random found, script unable to continue.');
TerminateScript;
end;
procedure AvoidFight;
begin
if FindFight then
begin
MakeCompass('N');
RunTo(RunDirection,True);
end;
end;
Procedure CheckForRandoms(FullCheck: boolean);
begin
if FindFastRandoms then EndAuto;
//FindInventoryRandoms;
AvoidFight;
FindTalk;
if FullCheck then FindNormalRandoms;
end;
procedure RotateCompass;
begin
CheckForRandoms(False);
case Random(3) of //Randomly chooses N, S, E, or W
0: MakeCompass('N');
1: MakeCompass('S');
2: MakeCompass('E');
3: MakeCompass('W');
end;
end;
Procedure DropLogs;
var ii: integer;
begin
CheckForRandoms(True);
if InvFull then
LogsChopped:= LogsChopped + 28 - InvUsedReport;
begin
for ii:= InvUsed to 28 do
begin
DropItem(ii);
CheckForRandoms(False);
case Random(14) of
0: begin
RotateCompass;
end; //1 in 15 chance of compass rotation
end;
end;
Loads:= Loads + 1;
end;
end;
Procedure WaitForTree;
begin
repeat
wait(50 + random(50));
case Random(19) of
0: Mouse(TreePTS[i].x, TreePTS[i].y, 3 - Random(2), 1, true);
end;
FindEnt(TreePTS[i].x, TreePTS[i].y, true);
CheckForRandoms(False);
GameTab(4);
until(Not(IsUpText(TreeName)) or (InvFull))
wait(1000 + random(500));
end;
Function FindTree(Tree: string; Color, Tol: integer): boolean;
begin
FindColorsSpiralTolerance(255, 166, TreePTS, Color, 5, 5, 515, 337, Tol);
if Length(TreePTS) <= 0 then RotateCompass
else for i:= 0 to Length(TreePTS) - 1 do
begin
CheckForRandoms(False);
MMouse(TreePTS[i].x, TreePTS[i].y, 3 - Random(2), 1)
If (IsUpText('down ' + Tree)) and (Length(TreePTS) > 0) then
begin
result:= true;
exit;
end
else if i = Length(TreePTS) - 1 then RotateCompass;
end;
result:= false;
end;
Procedure ChopTree;
begin
repeat
CheckForRandoms(False);
if FindTree(TreeName, TreeColor, TreeTol) then
begin
if Not(FindEnt(TreePTS[i].x, TreePTS[i].y, false)) then
begin
Mouse(TreePTS[i].x, TreePTS[i].y, 3 - Random(2), 1, true);
CheckForRandoms(False);
FindInventoryRandoms;
WaitForTree;
case Random(14) of
0: RotateCompass;
end;
end
end;
GameTab(4);
until(InvFull);
end;
begin
ActivateClient;
SetupSRL;
SetSettings;
DeclarePlayers;
repeat
CheckForRandoms(True);
ChopTree;
DropLogs;
Report;
until(false)
end.