Simba Code:
program PowerChop;
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I P07Include.Simba}
var
ChopWaitT,invcount1, invcount2,ChopWaitTime,OakColor1,TreeColor1,YewColor1, TreeColor,WillowColor,WillowColor1,MapleColor, YewColor, OakColor,Lagg: integer;
DsgnForm:TForm;
StartTime:Integer;
LogCombo,AxeCombo: TComboBox;
WieldAxe:Boolean;
TLabel0,TLabel1,TLabel3,TLabel4,TLabel2: TLabel;
TButton10: TButton;
Username,Password: TEdit;
const
default = 'Times new roman';
FONT = 9;
Version = '1.0';
procedure DTM;
begin
Lagg := 750;
ChopWaitTime := 99999999999;
TreeColor := 4162679;
TreeColor1 := 2645590;
OakColor := 1589301;
OakColor1 := 2184264;
WillowColor := 2506563;
WillowColor1 := 3565920;
MapleColor := 12910;
YewColor := 1986631;
YewColor1 := 1853512;
end;
procedure WaitHumanClick;
begin
case random(600) of
1..450: Wait(RandomRange(0, 100));
451..570: Wait(RandomRange(0, 200));
571..590: Wait(RandomRange(0, 600));
591..600: Wait(RandomRange(400, 1100));
end;
end;
Function IsWcing: Boolean;
var
PBox: TBox;
Begin
PBox := IntToBox(238, 149, 286, 186);
Result := (AveragePixelShift(PBox, 250, 350) > 150);
Writeln(IntToStr(AveragePixelShift(PBox, 500, 650)));
End;
Procedure DropLogs;
Begin
If (Not P07_LoggedIn) Then
Begin
P07_LogInPlayer;
End;
if (WieldAxe = True) then
Begin
P07_DropAll;
End;
if (WieldAxe = False) then
Begin
P07_DropAllExcept([1]);
End;
End;
Function AntiBan: Boolean;
begin
case random(300) of
0: P07_HoverSkill('woodcutting', random(5000));
end;
End;
Function isMoving1: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(237, 162, 282, 205);
Result := (AveragePixelShift(PBox, 250, 500) > 90);
Writeln(IntToStr(AveragePixelShift(PBox, 250, 500)));
end;
procedure SetAxe;
begin
case LogCombo.ITEMINDEX of
0:
Begin
WieldAxe := True;
End;
1:
Begin
WieldAxe := False;
End;
End;
End;
procedure Chop;
var x, y: integer;
begin
P07_MakeCameraAngleHigh;
P07_MakeCompassNorth;
If P07_FindObj(x, y, 'Tree', TreeColor, 5) or
P07_FindObj(x, y, 'Tree', TreeColor, 5) Then
begin
WaitHumanClick
//writeln( CountColorTolerance(13093380, 0, 0, 243, 20, 30));
if Random(2) = 1 then
begin
if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
begin
Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
end;
end
else
begin
if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
begin
Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
P07_ChooseOptionMulti(['hop']);
end;
end;
end
else
begin
P07_MakeCompassDegree(30);
end;
P07_FFlag;
wait (lagg);
end;
procedure Chop1;
var x, y: integer;
begin
P07_MakeCameraAngleHigh;
P07_MakeCompassNorth;
If P07_FindObj(x, y, 'Oak', OakColor1, 5) or
P07_FindObj(x, y, 'Oak', OakColor, 5) then
begin
WaitHumanClick
//writeln( CountColorTolerance(13093380, 0, 0, 243, 20, 30));
if Random(2) = 1 then
begin
if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
begin
Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
end;
end
else
begin
if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
begin
Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
P07_ChooseOptionMulti(['hop']);
end;
end;
end
else
begin
P07_MakeCompassDegree(30);
end;
P07_FFlag;
wait (lagg);
end;
procedure Chop2;
var x, y: integer;
begin
P07_MakeCameraAngleHigh;
P07_MakeCompassNorth;
If P07_FindObj(x, y, 'Willow', WillowColor1, 5) or
P07_FindObj(x, y, 'Willow', WillowColor, 5) Then
begin
WaitHumanClick
//writeln( CountColorTolerance(13093380, 0, 0, 243, 20, 30));
if Random(2) = 1 then
begin
if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
begin
Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
end;
end
else
begin
if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
begin
Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
P07_ChooseOptionMulti(['hop']);
end;
end;
end
else
begin
P07_MakeCompassDegree(30);
end;
P07_FFlag;
wait (lagg);
end;
procedure Chop3;
var x, y: integer;
begin
If not IsWcing then
P07_MakeCameraAngleHigh;
P07_MakeCompassNorth;
If P07_FindObj(x, y, 'Maple', MapleColor, 5) Then
begin
WaitHumanClick
//writeln( CountColorTolerance(13093380, 0, 0, 243, 20, 30));
if Random(2) = 1 then
begin
if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
begin
Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
end;
end
else
begin
if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
begin
Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
P07_ChooseOptionMulti(['hop']);
end;
end;
end
else
begin
P07_MakeCompassDegree(30);
end;
P07_FFlag;
wait (lagg);
end;
procedure Chop4;
var x, y: integer;
begin
If not IsWcing then
P07_MakeCameraAngleHigh;
P07_MakeCompassNorth;
If P07_FindObj(x, y, 'Yew', YewColor, 5) or
P07_FindObj(x, y, 'Yew', YewColor, 5) Then
begin
WaitHumanClick
//writeln( CountColorTolerance(13093380, 0, 0, 243, 20, 30));
if Random(2) = 1 then
begin
if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
begin
Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
end;
end
else
begin
if(CountColorTolerance(13093380, 70, 0, 146, 20, 50) > 10) then
begin
Mouse(RandomRange(X - 5, X + 5), RandomRange(Y - 5, Y + 5), random(3), random(3), false);
P07_ChooseOptionMulti(['hop']);
end;
end;
end
else
begin
P07_MakeCompassDegree(30);
end;
P07_FFlag;
wait (lagg);
end;
procedure ChopTree;
var x, y: integer;
begin
case LogCombo.ITEMINDEX of
0:
Begin
If P07_FindObj(x, y, 'Tree', TreeColor, 10) or
P07_FindObj(x, y, 'Tree', TreeColor1, 10) Then
Chop;
End;
1:
Begin
If P07_FindObj(x, y, 'Oak', OakColor, 10) or
P07_FindObj(x, y, 'Oak', OakColor1, 10) Then
Chop1;
End;
2:
Begin
If P07_FindObj(x, y, 'Willow', WillowColor, 10) or
P07_FindObj(x, y, 'Willow', WillowColor1, 10) Then
Chop2;
End;
3:
Begin
If P07_FindObj(x, y, 'Maple', MapleColor, 10) Then
Chop3;
End;
4:
Begin
If P07_FindObj(x, y, 'Yew', YewColor, 10) or
P07_FindObj(x, y, 'Yew', YewColor1, 10) Then
Chop4;
End;
End;
End;
procedure SaveFormInfo(Sender: TObject);
begin
DsgnForm.ModalResult := mrOk;
StartTime := GetSystemTime;
P07_PlayerName := Username.TEXT
P07_PlayerPass := Password.TEXT // Saving the text, before we close the form
DsgnForm.CLOSE;
SetAxe;
ChopTree;
end;
procedure InitForm;
begin
DsgnForm:=TForm.Create(nil);
with DsgnForm do
begin
Caption:='PowerChop From Grand01';
Left:=346;
Top:=419;
Width:=350;
Height:=140;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=9;
end;
TLabel0:=TLabel.Create(DsgnForm);
with TLabel0 do
begin
Parent:=DsgnForm;
Caption:='PowerChop 1.3';
Left:=50;
Top:=10;
Width:=41;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=13;
end;
TLabel1:=TLabel.Create(DsgnForm);
with TLabel1 do
begin
Parent:=DsgnForm;
Caption:='Tree';
Left:=40;
Top:=40;
Width:=41;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=9;
end;
TLabel2:=TLabel.Create(DsgnForm);
with TLabel2 do
begin
Parent:=DsgnForm;
Caption:='Wield Axe';
Left:=40;
Top:=80;
Width:=48;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=9;
end;
TLabel3:=TLabel.Create(DsgnForm);
with TLabel3 do
begin
Parent:=DsgnForm;
Caption:='Username';
Left:=206;
Top:=51;
Width:=49;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=9;
end;
TLabel4:=TLabel.Create(DsgnForm);
with TLabel4 do
begin
Parent:=DsgnForm;
Caption:='Password';
Left:=206;
Top:=80;
Width:=47;
Height:=14;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=9;
end;
Username:=TEdit.Create(DsgnForm);
with Username do
begin
Parent:=DsgnForm;
Text:='Username';
Left:=257;
Top:=48;
Width:=80;
Height:=21;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=9;
Username.MaxLength:=12;
end;
Password:=TEdit.Create(DsgnForm);
with Password do
begin
Parent:=DsgnForm;
Text:='Password';
Left:=257;
Top:=80;
Width:=80;
Height:=21;
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=9;
Password.MaxLength:=21;
Password.PasswordChar:=#;
end;
TButton10:=TButton.Create(DsgnForm);
with TButton10 do
begin
Parent:=DsgnForm;
Caption:='Start';
Left:=50;
Top:=110;
Width:=75;
Height:=25;
OnClick:=@SaveFormInfo;
end;
LogCombo:=TComboBox.Create(DsgnForm);
with LogCombo do
begin
Parent:=DsgnForm;
Left:=100;
Top:=40;
Width:=80;
Height:=21;
Items.Add('Tree');
Items.Add('Oak');
Items.Add('Willow');
Items.Add('Maple');
Items.Add('Yew');
Text := Items[0];
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=9;
end;
AxeCombo:=TComboBox.Create(DsgnForm);
with AxeCombo do
begin
Parent:=DsgnForm;
Left:=100;
Top:=80;
Width:=80;
Height:=21;
Items.Add('Yes');
Items.Add('No');
Text := Items[0];
Font.Name:=default;
Font.Color:=clDefault;
Font.Size:=9;
end;
end;
procedure SafeInitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowFormModal;
begin
DsgnForm.ShowModal;
end;
procedure SafeShowFormModal;
var
v: TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
begin
SafeInitForm;
SafeShowFormModal;
SetupP07Include;
ActivateClient;
SetAxe;
Wait(100);
If (Not P07_LoggedIn) Then
begin
P07_LogInPlayer;
end;
P07_MakeCameraAngleHigh;
P07_MakeCompassNorth;
DTM;
AddOnTerminate('FreeDTMss')
MarkTime(ChopWaitT);
invcount2 := 28;
AntiBan;
repeat
if(P07_InvFull) then
begin
DropLogs;
end;
begin
if((invcount2 >= invcount1) or not isMoving1) then
begin
ChopTree;
invcount2 := 0;
end;
begin
if(random(10) = 1) then
begin
MMouse(random(800), random(550), 0, 0);
end;
end;
end;
until (Not P07_LoggedIn)
TerminateScript;
end.