DTM's not working for me :(
So I'm working on a script and anytime I try to use a DTM it can't find the object on the screen:
This is what I've finished so far (Can't find tree):
Simba Code:
program MapleChopAndBurn;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}
const
SRLStats_User = ''; // Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
SERVER = 0; // Enter "0" to pick a random server.
MEMBERS = True;
NumbOfPlayers = 1;
StartPlayer = 0;
var
StartXP, MapleTree, x, y: integer;
procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['XP'];
With Players[0] do
begin
Name := ''; //Username.
Pass := ''; //Password.
Active := True;
end;
end;
procedure XP;
begin
StartXp := GetXpBar(1);
end;
function CheckAndClick (UpText, Option:String; x, y:Integer; RClick:Boolean):Boolean;
begin
MMouse(x, y, 6, 6);
If WaitUpText(UpText, 1000+Random(200)) Then
begin
Result:=True;
GetMousePos(x, y);
If RClick Then
begin
Mouse(x, y, 0, 0, False);
Result:= WaitOption(Option, 2000);
If Result Then FFlag(0);
end Else
Begin
Mouse(x, y, 0, 0, True);
Wait(150+Random(100));
FFlag(0);
end;
end;
end;
Function Cutting: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(250, 132, 279, 193);
Result := (AveragePixelShift(PBox, 500, 800) > 425);
end;
procedure AntiBan;
begin
if(not(LoggedIn))then
exit;
FindNormalRandoms;
case Random(160) of
0..40:
begin
WriteLn('AntiBan Is Being Performed');
GameTab(Tab_Stats);
HoverSkill('Woodcutting', false);
wait(2500 + Random(1000));
Mouse(659, 189, 0, 0, True);
end;
41..90:
begin
WriteLn('Bored')
If (Cutting) then
BoredHuman;
end;
91..122:
begin
WriteLn('AFK')
wait (400 + Random(5000));
end;
123..160:
begin
WriteLn('Looking Around')
GameTab(Tab_Stats);
wait (400 + Random(8000));
end;
end;
end;
procedure FailSafe (Reason:String);
begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
TerminateScript;
end;
procedure DTM;
begin
MapleTree := DTMFromString('mFQEAAHic42VgYHgCxI+A+D0QfwbiZ0B8HoivAvFNIP4AxF+A+A5U3Ucg3gLES4B4HhDvAOJzQLwVKnYEiI8C8WogngXEU4B4KhB3Rxsx2CoIMZhI8zP4a0kwdMUYM9Q4aTB4qYsxdIYbMITrSjPEGMoy1PpoMzSF6zOEGckwkAMYycAoAAC9jB56');
end;
procedure FreDTM;
begin
FreeDTM(MapleTree);
end;
procedure MapleChopp;
begin
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
wait(200+random(400));
if (FindDTM(MapleTree, x, y, MSX1, MSY1, MSX2, MSY2)) then
begin
Writeln('Tree Has Been Found');
Wait(10+random(20));
Mouse(x,y,4,4,true)
Wait(10+random(45));
if (Cutting) then
Antiban;
end else Writeln('Cannot find Tree');
repeat
wait(50+random(100));
Until(Not Cutting);
end;
begin
Smart_Signed := TRUE;
Smart_Members := MEMBERS;
Smart_SuperDetail := FALSE;
ActivateClient;
Smart_Server := 99;
SetupSRL;
DeclarePlayers;
if not (LoggedIn) then
LoginPlayer;
wait(1000+random(400));
Repeat
MapleChopp;
Until(False)
FreDTM;
end.
Any ideas?
Thanks for any help and guidance.