Results 1 to 3 of 3

Thread: DTM's not working for me :(

  1. #1
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Question 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.
    Current Project: Retired

  2. #2
    Join Date
    Feb 2012
    Location
    Florida
    Posts
    193
    Mentioned
    1 Post(s)
    Quoted
    6 Post(s)

    Default

    CurrentPlayer := StartPlayer;
    Some of your WriteLn's need semi colons too. Also you didn't even declare your DTM. You made a procedure called DTM you need to call that procedure to load the DTM before you go trying to find it.

    Simba Code:
    procedure DTM;
    begin
      MapleTree := DTMFromString('mFQEAAHic42VgYHgCxI+A+D0QfwbiZ0B8HoivAvFNIP4AxF+A+A5U3Ucg3gLES4B4HhDvAOJzQLwVKnYEiI8C8WogngXEU4B4KhB3Rxsx2CoIMZhI8zP4a0kwdMUYM9Q4aTB4qYsxdIYbMITrSjPEGMoy1PpoMzSF6zOEGckwkAMYycAoAAC9jB56');
    end;

    So

    Simba Code:
    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));
      DTM;    // Add this
        Repeat
          MapleChopp;
        Until(False)
      FreDTM;
    end.

  3. #3
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default

    ahhhh okay thanks
    Current Project: Retired

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •