Pupp3tMast3r
09-24-2006, 10:05 PM
After all the help i got after posting my first little script i managed to improve alot on it.
to some extent it can be left woodcutting and will drop all logs after its got a full invent. works anywere that there are a group of trees.
btw it only has little anti randoms, i would like some help there, so i wouldn't leave it unattended or anything yet cansider it a beta test :)
//----------------------------------------------------------------------------//
// Simple WoodCutter //
// By Pupp3tMast3r //
//----------------------------------------------------------------------------//
program WoodCutter;
{.include SRL\SRL.scar}
{.include SRL\SRL\Extended\xMapWalk.scar}
{.include SRL\SRL\Skill\Woodcutting.scar}
Var
xx, yy, LogsCut: Integer;
Var
TreeChk1, TreeChk2: String;
//-------------------------------:Set up begin:-------------------------------//
Const
TreeColor1 = 2908240;
TreeColor2 = 793110;
TreeColor3 = 5079160;
//--------------------------------:Setup end:---------------------------------//
Procedure AntiIdle; //Avoids idle status
begin
Case (Random(7)) of
0: AntiBan;
1: RandomRClick;
2: PickUpMouse;
3: HoverSkill('WoodCutting', False);
4: PickUpMouse;
5: RandomRClick;
6: BoredHuman;
7: BoredHuman;
end;
end;
//----------------------------------------------------------------------------//
Procedure AntiRand; //Basic anti random procedure
begin
FindNormalRandoms;
If (FindFight) Then
begin
RunAwayDirection('N');
Wait2(9000 + Random(2001), True);
RunBack;
end;
end;
//----------------------------------------------------------------------------//
Function FindTree(Var xx, yy: Integer; TColor1, TColor2, TColor3: Integer): Boolean; //Finds and checks for tree with increasing tolerance.
Var
Tol, Times: Integer;
begin
Tol:= 0;
Times:= 0;
For Times:= 1 to 4 do
begin
If (FindColorSpiralTolerance(xx, yy, TColor1, 5, 5, 514, 337, Tol))
or (FindColorSpiralTolerance(xx, yy, TColor2, 5, 5, 514, 337, Tol))
or (FindColorSpiralTolerance(xx, yy, TColor3, 5, 5, 514, 337, Tol)) Then
begin
Wait(400 + random(601));
MMouse(xx, yy, 1, 1);
If (IsUpText(TreeChk1) or IsUpText(TreeChk2)) Then
begin
Result:= True;
Exit;
end;
end;
Tol:= Tol + 5;
Times:= Times + 1;
Wait(300 + Random(301));
end;
end;
//----------------------------------------------------------------------------//
Function ChopTree: Boolean;
Var
StartTime, StopTime: integer;
begin
If (FindTree(xx, yy, TreeColor1, TreeColor2, TreeColor3)) Then
begin
Mouse(xx, yy, 0, 0, True);
MarkTime(StartTime);
Repeat
AntiRand;
Wait2(1500 + Random(1501), True);
AntiIdle;
MarkTime(StopTime);
If (StartTime + 35000 < StopTime) Then Break;
Until (InChatMulti('get', 'log', 'ogs'));
If (InChatMulti('get', 'log', 'ogs')) Then
begin
Result:= True;
LogsCut:= LogsCut + 1;
Writeln('You have cut ' + IntToStr(LogsCut) + ' Logs!');
end;
end;
end;
//----------------------------------------------------------------------------//
//-------------------------------Main Loop------------------------------------//
begin
SetupSRL;
DisguiseScar('My Documents');
ActivateClient;
TreeChk1:= 'tre';
TreeChk2:= 'ree';
LogsCut:= 0;
SetChat('off', 1);
Wait(500 + Random(1001)
SetChat('friends', 2);
Wait(500 + Random(1001)
SetChat('off', 3);
Wait(500 + Random(1001)
PerfectNorth;
Repeat
Repeat
ChopTree;
until(InventoryFull);
DropAllLogs;
Until(False);
end.
please help with naything you see needs improving on. im going to turn this into a proper SRL script(with logging in and out etc) when i know i have the cutting sorted.
thanx to any one who helps or who helped me last time:)
to some extent it can be left woodcutting and will drop all logs after its got a full invent. works anywere that there are a group of trees.
btw it only has little anti randoms, i would like some help there, so i wouldn't leave it unattended or anything yet cansider it a beta test :)
//----------------------------------------------------------------------------//
// Simple WoodCutter //
// By Pupp3tMast3r //
//----------------------------------------------------------------------------//
program WoodCutter;
{.include SRL\SRL.scar}
{.include SRL\SRL\Extended\xMapWalk.scar}
{.include SRL\SRL\Skill\Woodcutting.scar}
Var
xx, yy, LogsCut: Integer;
Var
TreeChk1, TreeChk2: String;
//-------------------------------:Set up begin:-------------------------------//
Const
TreeColor1 = 2908240;
TreeColor2 = 793110;
TreeColor3 = 5079160;
//--------------------------------:Setup end:---------------------------------//
Procedure AntiIdle; //Avoids idle status
begin
Case (Random(7)) of
0: AntiBan;
1: RandomRClick;
2: PickUpMouse;
3: HoverSkill('WoodCutting', False);
4: PickUpMouse;
5: RandomRClick;
6: BoredHuman;
7: BoredHuman;
end;
end;
//----------------------------------------------------------------------------//
Procedure AntiRand; //Basic anti random procedure
begin
FindNormalRandoms;
If (FindFight) Then
begin
RunAwayDirection('N');
Wait2(9000 + Random(2001), True);
RunBack;
end;
end;
//----------------------------------------------------------------------------//
Function FindTree(Var xx, yy: Integer; TColor1, TColor2, TColor3: Integer): Boolean; //Finds and checks for tree with increasing tolerance.
Var
Tol, Times: Integer;
begin
Tol:= 0;
Times:= 0;
For Times:= 1 to 4 do
begin
If (FindColorSpiralTolerance(xx, yy, TColor1, 5, 5, 514, 337, Tol))
or (FindColorSpiralTolerance(xx, yy, TColor2, 5, 5, 514, 337, Tol))
or (FindColorSpiralTolerance(xx, yy, TColor3, 5, 5, 514, 337, Tol)) Then
begin
Wait(400 + random(601));
MMouse(xx, yy, 1, 1);
If (IsUpText(TreeChk1) or IsUpText(TreeChk2)) Then
begin
Result:= True;
Exit;
end;
end;
Tol:= Tol + 5;
Times:= Times + 1;
Wait(300 + Random(301));
end;
end;
//----------------------------------------------------------------------------//
Function ChopTree: Boolean;
Var
StartTime, StopTime: integer;
begin
If (FindTree(xx, yy, TreeColor1, TreeColor2, TreeColor3)) Then
begin
Mouse(xx, yy, 0, 0, True);
MarkTime(StartTime);
Repeat
AntiRand;
Wait2(1500 + Random(1501), True);
AntiIdle;
MarkTime(StopTime);
If (StartTime + 35000 < StopTime) Then Break;
Until (InChatMulti('get', 'log', 'ogs'));
If (InChatMulti('get', 'log', 'ogs')) Then
begin
Result:= True;
LogsCut:= LogsCut + 1;
Writeln('You have cut ' + IntToStr(LogsCut) + ' Logs!');
end;
end;
end;
//----------------------------------------------------------------------------//
//-------------------------------Main Loop------------------------------------//
begin
SetupSRL;
DisguiseScar('My Documents');
ActivateClient;
TreeChk1:= 'tre';
TreeChk2:= 'ree';
LogsCut:= 0;
SetChat('off', 1);
Wait(500 + Random(1001)
SetChat('friends', 2);
Wait(500 + Random(1001)
SetChat('off', 3);
Wait(500 + Random(1001)
PerfectNorth;
Repeat
Repeat
ChopTree;
until(InventoryFull);
DropAllLogs;
Until(False);
end.
please help with naything you see needs improving on. im going to turn this into a proper SRL script(with logging in and out etc) when i know i have the cutting sorted.
thanx to any one who helps or who helped me last time:)