Results 1 to 6 of 6

Thread: Can't Find DTM

  1. #1
    Join Date
    Dec 2006
    Posts
    173
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Can't Find DTM

    Hey,

    Lately I have been working on an Edgeville clay softener. I've been testing the script for the past week and have noticed that when you open the bank to withdraw the clay, it sometimes doesn't find the clay and closes the bank. When I made the DTM of the clay, I made the mainpoint have a tolerance of 10.

    Anyone know how to fix this?

    Here's the script:

    SCAR Code:
    program EdgeClaySoft;
    {.Include SRL/SRL/Misc/SMART.Scar}
    {.Include SRL/SRL.Scar}
    {.Include SRL/SRL/Reflection/Reflection.Scar}

    Const
      Loads = 2;// How many loads to do before switching

     
    var
      RoadA, RoadB, RoadC, Clay, SoftClay, EmptyBucket, FullBucket, EdgeBank : Integer;
      Bankz : Integer;
      x, y, X, Y, i, z : Integer;
     

    Procedure DeclarePlayers;
    Begin
      CurrentPlayer := 0;
      HowManyPlayers  := 4;
      NumberOfPlayers( HowManyPlayers );

      Players[0].Name  := '';
      Players[0].Pass  := '';
      Players[0].Nick  := '';
      Players[0].Active:= True;
     
      Players[1].Name  := '';
      Players[1].Pass  := '';
      Players[1].Nick  := '';
      Players[1].Active:= True;
     
      Players[2].Name  := '';
      Players[2].Pass  := '';
      Players[2].Nick  := '';
      Players[2].Active:= True;
     
      Players[3].Name  := '';
      Players[3].Pass  := '';
      Players[3].Nick  := '';
      Players[3].Active:= True;
     
    End;

    procedure LoadDTMS;
    begin
      Clay := DTMFromString('78DA639461606010644001CB7BE318B880342' +
            '310FF0702465920839D010D302291405A154870115003B24B8480' +
            '1A903C3F7E3500A59F067A');
    end;

    function LoadDDTM(DDTMNumber: Integer): Integer;
    var
      dtmMainPoint: TDTMPointDef;
      dtmSubPoints: Array [0..3] of TDTMPointDef;
      TempTDTM: TDTM;

    begin
      case DDTMNumber of
        1: begin
             dtmMainPoint.x := 67;
             dtmMainPoint.y := 79;
             dtmMainPoint.AreaSize := 0;
             dtmMainPoint.AreaShape := 0;
             dtmMainPoint.Color := 8423562;
             dtmMainPoint.Tolerance := 0;

             dtmSubPoints[0].x := 67;
             dtmSubPoints[0].y := 79;
             dtmSubPoints[0].AreaSize := 0;
             dtmSubPoints[0].AreaShape := 0;
             dtmSubPoints[0].Color := FindVarrockRoadColor;
             dtmSubPoints[0].Tolerance := 0;

             dtmSubPoints[1].x := 66;
             dtmSubPoints[1].y := 86;
             dtmSubPoints[1].AreaSize := 0;
             dtmSubPoints[1].AreaShape := 0;
             dtmSubPoints[1].Color := FindVarrockRoadColor;
             dtmSubPoints[1].Tolerance := 0;

             dtmSubPoints[2].x := 65;
             dtmSubPoints[2].y := 69;
             dtmSubPoints[2].AreaSize := 0;
             dtmSubPoints[2].AreaShape := 0;
             dtmSubPoints[2].Color := FindVarrockRoadColor;
             dtmSubPoints[2].Tolerance := 0;

             dtmSubPoints[3].x := 74;
             dtmSubPoints[3].y := 79;
             dtmSubPoints[3].AreaSize := 0;
             dtmSubPoints[3].AreaShape := 0;
             dtmSubPoints[3].Color := FindVarrockRoadColor;
             dtmSubPoints[3].Tolerance := 0;

             TempTDTM.MainPoint := dtmMainPoint;
             TempTDTM.SubPoints := dtmSubPoints;
             Result := AddDTM(TempTDTM);
           end;

        2: begin
             dtmMainPoint.x := 64;
             dtmMainPoint.y := 37;
             dtmMainPoint.AreaSize := 0;
             dtmMainPoint.AreaShape := 0;
             dtmMainPoint.Color := FindVarrockRoadColor;
             dtmMainPoint.Tolerance := 0;

             dtmSubPoints[0].x := 64;
             dtmSubPoints[0].y := 37;
             dtmSubPoints[0].AreaSize := 0;
             dtmSubPoints[0].AreaShape := 0;
             dtmSubPoints[0].Color := FindVarrockRoadColor;
             dtmSubPoints[0].Tolerance := 0;

             dtmSubPoints[1].x := 70;
             dtmSubPoints[1].y := 29;
             dtmSubPoints[1].AreaSize := 0;
             dtmSubPoints[1].AreaShape := 0;
             dtmSubPoints[1].Color := FindVarrockRoadColor;
             dtmSubPoints[1].Tolerance := 0;

             dtmSubPoints[2].x := 63;
             dtmSubPoints[2].y := 46;
             dtmSubPoints[2].AreaSize := 0;
             dtmSubPoints[2].AreaShape := 0;
             dtmSubPoints[2].Color := FindVarrockRoadColor;
             dtmSubPoints[2].Tolerance := 0;

             dtmSubPoints[3].x := 63;
             dtmSubPoints[3].y := 31;
             dtmSubPoints[3].AreaSize := 0;
             dtmSubPoints[3].AreaShape := 0;
             dtmSubPoints[3].Color := FindVarrockRoadColor;
             dtmSubPoints[3].Tolerance := 0;

             TempTDTM.MainPoint := dtmMainPoint;
             TempTDTM.SubPoints := dtmSubPoints;
             Result := AddDTM(TempTDTM);
           end;

        3: begin
             dtmMainPoint.x := 62;
             dtmMainPoint.y := 54;
             dtmMainPoint.AreaSize := 0;
             dtmMainPoint.AreaShape := 0;
             dtmMainPoint.Color := FindVarrockRoadColor;
             dtmMainPoint.Tolerance := 0;

             dtmSubPoints[0].x := 62;
             dtmSubPoints[0].y := 54;
             dtmSubPoints[0].AreaSize := 0;
             dtmSubPoints[0].AreaShape := 0;
             dtmSubPoints[0].Color := FindVarrockRoadColor;
             dtmSubPoints[0].Tolerance := 0;

             dtmSubPoints[1].x := 62;
             dtmSubPoints[1].y := 70;
             dtmSubPoints[1].AreaSize := 0;
             dtmSubPoints[1].AreaShape := 0;
             dtmSubPoints[1].Color := FindVarrockRoadColor;
             dtmSubPoints[1].Tolerance := 0;

             dtmSubPoints[2].x := 64;
             dtmSubPoints[2].y := 73;
             dtmSubPoints[2].AreaSize := 0;
             dtmSubPoints[2].AreaShape := 0;
             dtmSubPoints[2].Color := FindVarrockRoadColor;
             dtmSubPoints[2].Tolerance := 0;

             dtmSubPoints[3].x := 63;
             dtmSubPoints[3].y := 41;
             dtmSubPoints[3].AreaSize := 0;
             dtmSubPoints[3].AreaShape := 0;
             dtmSubPoints[3].Color := FindVarrockRoadColor;
             dtmSubPoints[3].Tolerance := 0;

             TempTDTM.MainPoint := dtmMainPoint;
             TempTDTM.SubPoints := dtmSubPoints;
             Result := AddDTM(TempTDTM);
           end;
      end;
    end;

    procedure AntiRandoms;
    begin
      for z:= 1 to 3 do
      begin
        case z of
          1: FindNormalRandoms;
          2: FindInventoryRandoms;
          3: FindNonInventoryRandoms;
        end;
      end;
    end;

    procedure AntiBan;
    begin
      if not LoggedIn then Exit;
      case Random(100) of
        0: HoverSkill('Crafting', False);
       
        1: HoverSkill('random', False);
       
        2: BoredHuman;
       
        3: begin
             GameTab(1 + Random(12));
             wait(1000 + random(500));
             GameTab(4)
           end;

        4: begin
             GameTab(2);
             Wait(1000 + random(500));
             GameTab(4);
           end;

        5: RandomRClick;
       
      end;
    end;

    procedure WithdrawClay;
    begin
      if not LoggedIn then Exit;
      GameTab(4);
      repeat
        if (not(LoggedIn)) then Break;
        OpenBankFast('eb');
      until BankScreen
      FixBank;
      if FindDTM(Clay, x, y, msx1, msy1, msx2, msy2) then
      begin
        MMouse(x, y, 3, 3);
        if IsUpTextMultiCustom(['Clay', 'lay']) then
        begin
          Mouse(x, y, 3, 3, False);
          wait(1000 + random(500));
          ChooseOption('Withdraw-X');
          wait(1000 + random(50));
          TypeSend('14');
          wait(1000 + random(50));
        end;
        if BankScreen Then CloseBank;
        wait(1000 + random(200));
      end;
    end;

    procedure ToWell;
    var
      EdgeWalk: TPointArray;
      i : Integer;
    begin
      if not LoggedIn then Exit;
      MakeCompass('N');
      {RoadA := LoadDDTM(1); **** Still in development ****
      RoadB := LoadDDTM(2);
      if DTMRotated(RoadA, x, y, MMx1,MMy1,MMx2,MMy2) then
      begin
        Mouse(x, y, 2, 2, True);
        FFlag(0);
        Writeln('Walked using dtm');
        FindNormalRandoms;
        if DTMRotated(RoadB, x, y, MMx1,MMy1,MMx2,MMy2) then
        begin
          Mouse(x, y, 2, 2, True);
          FFlag(0);
        end else
        begin
          WalkToTile(Point(3087, 3500), 2, 6);
          Wait(1000 + random(500));
          Writeln('Walked to fountain');
        end;
        FreeDTM(RoadA);
        FreeDTM(RoadB);
      end;}

      EdgeWalk := [Point(3087, 3493), Point(3087, 3501)];
      For I:= 0 To High(EdgeWalk) Do
              WalkToTile(EdgeWalk[I], 2, 6);
    end;

    procedure FindWell;
    var
      WellTPA : TPointArray;
      WellP : TPoint;
      x, y, i : Integer;

    begin
      if not LoggedIn then Exit;
      x := MSCx;
      y := MSCy;
      FindColorsSpiralTolerance(x, y, WellTPA, 3230038, MSx1, MSy1, MSx2, MSy2, 10);
      if Length(WellTPA) = 0 then FindColorsSpiralTolerance(x, y, WellTPA, 4482166, MSx1, MSy1, MSx2, MSy2, 10);
      for i := 0 to High(WellTPA) do
      begin
        WellP := WellTPA[i]; { Will add SplitTPA, MiddleTPA, and SortTPAFromFirstPoint soon}
        MMouse(WellP.x, WellP.y, 4, 4);
        if IsUpTextMultiCustom(['ell']) then
        begin
          GetMousePos(x, y);
          Mouse(x, y, 2, 2, True);
          Wait(500 + random(500));
          Exit;
        end;
        Wait(500 + random(100));
      end;
    end;

    procedure FillBuckets;
    var
      BucketWait : Integer;
    begin
      EmptyBucket := DTMFromString('78DA63B46560601060400149DE920C5C409A1' +
                   '188FF0301A33590C1CA800618914820ED0624F809A831C6B40B43' +
                   '8D39905020A0C681B01A005A1B06BA');
                 
      if not LoggedIn then Exit;
      if (FindDTM(EmptyBucket, x, y, MIX1, MIY1, MIX2, MIY2)) then
      begin
        Mouse(x, y, 2, 2, True);
        wait(500 + random(500));
        FindWell;
        MarkTime(BucketWait);
        repeat
          AntiRandoms;
          AntiBan;
          if not (FindDTM(EmptyBucket, x, y, MIX1, MIY1, MIX2, MIY2)) then Break;
        until (TimeFromMark(BucketWait) > 12000);
      end;
      FreeDTM(EmptyBucket);
    end;
     
    procedure BucketToClay;
    begin
      FullBucket := DTMFromString('78DA634C6360601060400135B57318B880342' +
                  '310FF0702C654208395010D30229140BA0048F01350134B849A44' +
                  '20A140404D16613500713C0883');
      if not LoggedIn then Exit;
      if FindDTM(FullBucket, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
        Mouse(x, y, 3, 3, True);
        wait(1000 + random(500));
        if FindDTM(Clay, x, y, MIX1, MIY1, MIX2, MIY2) then
        begin
          Mouse(x, y, 2, 2, True);
          wait(500 + random(500));
        end;
      end;
      FreeDTM(FullBucket);
    end;

    procedure CreateClay;
    var
      Waitz : Integer;
    begin
      if not LoggedIn then Exit;
      MMouse(250,421,10,10);
      wait(750+random(350));
      Mouse(250,421,10,10,false);
      wait(500 + random(60));
      ChooseOption('All');
      repeat
        AntiRandoms;
        Wait(1000);
        Waitz := Waitz + 1;
        if not(FindDTM(Clay, x, y, MIX1, MIY1, MIX2, MIY2)) then Break;
      until Waitz > 13;
    end;

    procedure ToBank;
    begin
      EdgeBank := DTMFromString('78DA638C666060F0654001A9CABC0CFF81342' +
           '310FF0702C66420230455CD9F3F4C0C5C5035200056E34D841A17' +
           'FC6A009E8D0E59');
           
      if not LoggedIn then Exit;
      MakeCompass('N');
      {RoadC := LoadDDTM(3); **** Still in development ****
      {if DTMRotated(RoadC, X, Y, MMx1,MMy1,MMx2,MMy2) then
      begin
        Mouse(X, Y, 4, 4, True);}

        WalkToTile(Point(3087, 3494), 4, 6);
        wait(2000 + random(500));
        if DTMRotated(EdgeBank, X, Y, MMx1,MMy1,MMx2,MMy2) then
        begin
          Mouse(X, Y, 2, 2, True);
          FFlag(0);
          Wait(500 + random(500));
        end else
        begin
          WalkToTile(Point(3093, 3492), 4, 5);
        end;
      {end;}
    end;

    procedure DepositSoftClay;
    var
      Tryz : Integer;
     
    begin
      SoftClay := DTMFromString('78DA635462606010604001B941BC0C5C409A1' +
           '188FF0301A32690C1C68006189148206D08247809A80199234540' +
           '8D0C116AC48084300135D2408203BF1A0000FD064B');
      if not LoggedIn then Exit;
      GameTab(4);
      Tryz := 0;
      repeat
        if (not(LoggedIn)) then Break;
        OpenBankFast('eb');
        Tryz := Tryz + 1;
      until BankScreen or (Tryz > 5);
      FixBank;
      if FindDTM(SoftClay, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
        Mouse(x, y, 4, 4, False);
        wait(500 + random(50));
        ChooseOption('All');
      end;
      if BankScreen Then CloseBank;
      wait(500 + random(200));
      FreeDTM(SoftClay);
    end;

    procedure WithdrawClay2;
    var
      Tryz : Integer;
    begin
      SoftClay := DTMFromString('78DA635462606010604001B941BC0C5C409A1' +
           '188FF0301A32690C1C68006189148206D08247809A80199234540' +
           '8D0C116AC48084300135D2408203BF1A0000FD064B');
      if not LoggedIn then Exit;
      GameTab(4);
      Tryz := 0;
      repeat
        if (not(LoggedIn)) then Break;
        OpenBankFast('eb');
        Tryz := Tryz + 1;
      until BankScreen or (Tryz > 5);
      FixBank;
      if FindDTM(SoftClay, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
        Mouse(x, y, 4, 4, False);
        wait(500 + random(50));
        ChooseOption('All');
        FreeDTM(SoftClay);
        if FindDTM(Clay, x, y, msx1, msy1, msx2, msy2) then
        begin
          MMouse(x, y, 3, 3);
          if IsUpTextMultiCustom(['Withdraw-1', 'Clay', 'lay']) then
          begin
            Mouse(x, y, 3, 3, False);
            wait(1000 + random(500));
            ChooseOption('Withdraw-X');
            wait(1000 + random(50));
            TypeSend('14');
            wait(1000 + random(50));
          end;
        end;
        if BankScreen Then CloseBank;
        wait(500 + random(200));
        Bankz := Bankz + 1;
      end;
    end;

    procedure PlayerSetup;
    begin
      R_SetAngle(100);
      wait(1000 + random(100));
      R_MakeCompass('n');
    end;

    Procedure SetupSMART;
    Begin
      SmartSetupEx(90, True, True, False);
      SetTargetDC(SmartGetDC);
      If(Not LoggedIn) Then
        While(Not SmartGetColor(360, 172) = 13158) Do
          Wait(100);
    End;

    procedure MainLoop;
    begin
      repeat
        LoginPlayer;
        PlayerSetup;
        repeat
          wait(100);
          WithdrawClay;
          ToWell;
          wait(1000 + random(500));
          FillBuckets;
          BucketToClay;
          CreateClay;
          FillBuckets;
          ToBank;
          WithdrawClay2;
          BucketToClay;
          CreateClay;
          WithdrawClay2;
        until(Bankz >= Loads);
        if(AllPlayersInactive)then
        begin
          Writeln('All players active, Stopping script.');
          TerminateScript;
        end;
        Writeln('We did our loads');
        Nextplayer(True);
      until(False);
    end;

    begin
      SetupSMART;
      SetupSRL;
      SetupReflection;
      LoadDTMS;
      ActivateClient;
      DeclarePlayers;
      Wait(2000 + Random(500));
      MainLoop;
    end.

    Thanks in advance
    ~ Macho Man67
    Starting to merchant, if you know of any good clans, PM me please.

  2. #2
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    If the script correctly finds the DTM part of the time, but not all of the time, add more tolerance to the DTM. A tolerance of 15 or 20 would help quite a bit.
    :-)

  3. #3
    Join Date
    Dec 2006
    Posts
    173
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you for the help. I made a new DTM with a tolerance of 15. I also changed the uptext I was using, and it seems to be working fine now.
    Starting to merchant, if you know of any good clans, PM me please.

  4. #4
    Join Date
    Apr 2007
    Location
    Here
    Posts
    109
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Macho Man67 View Post
    Thank you for the help. I made a new DTM with a tolerance of 15. I also changed the uptext I was using, and it seems to be working fine now.
    Also, you probably already knew this but just incase, when making a DTM make sure that any of your points don't get covered up by the numbers in the bank. Not sure if that will help any or not :-)

  5. #5
    Join Date
    Aug 2008
    Location
    Serdia, Isla Prima
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thanx Method, I had the same problem, and after setting the tollerance to 25, it works like a charm

  6. #6
    Join Date
    Jul 2008
    Posts
    907
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yeah and just a quick thing was the dtm made when it was in the bank cos if its in the invoits bigger and wouldn't work


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. how did i ever find this...?
    By legendaryhero90 in forum Music, Movies and TV
    Replies: 9
    Last Post: 02-03-2008, 12:53 AM
  2. Find Gas
    By Lacky in forum Research & Development Lounge
    Replies: 4
    Last Post: 11-04-2007, 12:56 PM
  3. have to find out
    By the scar noob in forum OSR Help
    Replies: 5
    Last Post: 01-13-2007, 10:19 PM

Posting Permissions

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