Results 1 to 7 of 7

Thread: DTM pathing

  1. #1
    Join Date
    Mar 2013
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default DTM pathing

    In the script I am making, I am trying to use the icons that are on the minimap to navigate to and from the General Store, but the problem is that when I find the first icon , Tele, the script ends on the way to the destination. I have added in wait timers. For instance Wait(RandomRange(10000, 11000)); but this just waits and then terminates the script there. Should I make a seperate procedure for each DTM? I feel like this is too much work. If anyone could give me advice that would be much appreciated.


    Code:
    program VialBuyer;
    {$I SRL/SRL.Simba}
    {$I P07Include.Simba}
    
    var
      Tele,Store, x, y: Integer;
    
    
    Procedure P07_DeclarePlayer;
    begin
      P07_PlayerName :='';
      P07_PlayerPass :='';
    end;
    
    Procedure GoToStore;
    begin
    
    P07_MakeCompassNorth;
    Store := DTMFromString('mlwAAAHicY2dgYHjOxMDwEIifAfErIH4KxI+gbAFGBgZ+IOaC0sJALATEIkDc5SXIsH3teobpvf0M8WosDJviFMFiuSmpDLiACBAz4sFQAAAywQ9y');
    Tele := DTMFromString('mlwAAAHicY2dgYOAEYmYgZgdiViDmAWI2BggA8bmRxJDFDdytGbavXQ/GIPblEB4wG0TLAeVFkDAyYMSDoQAAT18Kww==');
      if FindDTM(Tele, x, y, MMX1, MMY1, MMX2, MMY2) Then
      Begin
        Writeln('Found Tele Icon');
        Mouse(x, y, 7, 7, True);
      end
      else
      begin
        WriteLn('I need to fix the minimap');
      end;
      FreeDTM(Tele);
     //Script abruptly ends here
    P07_FFlag;
    
       if FindDTM(Store, x, y, MMX1, MMY1, MMX2, MMY2) Then
       Begin
        WriteLn('Found General Store Icon');
        Mouse(x, y, 5, 5, True);
       end;
    
      FreeDTM(Store);
    
    end;
    
    begin
      P07_DeclarePlayer;
      SetupP07Include;
      SetupSRL;
      ActivateClient;
      GoToStore;
    
    end.

  2. #2
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    I suggest you don't put DTMs in the procedures you use them in, instead you can call them at the start of the script. For example:

    Simba Code:
    procedure LoadDTMs;
    begin
      Store := DTMFromString('mlwAAAHicY2dgYHjOxMDwEIifAfErIH4KxI+gbAFGBgZ+IOaC0sJALATEIkDc5SXIsH3teobpvf0M8WosDJviFMFiuSmpDLiACBAz4sFQAAAywQ9y');
      Tele := DTMFromString('mlwAAAHicY2dgYOAEYmYgZgdiViDmAWI2BggA8bmRxJDFDdytGbavXQ/GIPblEB4wG0TLAeVFkDAyYMSDoQAAT18Kww==');;
    end;

    procedure Freee;
    begin
      FreeDTM(Store);
      FreeDTM(Tele);
    end;

    You can set Store and Tele as global variables so you can call them wherever. So in the main part of your script you could put:

    Simba Code:
    begin
      P07_DeclarePlayer;
      SetupP07Include;
      SetupSRL;
      ActivateClient;
      LoadDTMs;
      AddOnTerminate('Freee');
      GoToStore;
    end.

    AddOnTerminate will just run that procedure whenever you end the script.

    Also, the official SRL-OSR include has a built in procedure to find symbols(FindSymbol) so you might want to consider using SRL-OSR instead.

  3. #3
    Join Date
    Mar 2013
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    That is great information, but it still doesn't tell me why the script just abruptly ends..

  4. #4
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    I'm guessing that P07_FFlag is not working or its not able to find the store DTM. You could try doing this to check if its finding the DTM or not:

    Simba Code:
    if FindDTM(Store, x, y, MMX1, MMY1, MMX2, MMY2) Then
       Begin
        WriteLn('Found General Store Icon');
        Mouse(x, y, 5, 5, True);
       end else
         Writeln('Didnt find general store icon');

  5. #5
    Join Date
    Mar 2013
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Total View Post
    I'm guessing that P07_FFlag is not working or its not able to find the store DTM. You could try doing this to check if its finding the DTM or not:

    Simba Code:
    if FindDTM(Store, x, y, MMX1, MMY1, MMX2, MMY2) Then
       Begin
        WriteLn('Found General Store Icon');
        Mouse(x, y, 5, 5, True);
       end else
         Writeln('Didnt find general store icon');
    I tested and I could find the store DTM so I don't think that this is the problem. Is the 07Include working or not, because I added a Wait procedure to take the place of the FFlag and that fixed it. Should I be using SLR-OSR then? Thanks

  6. #6
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Most of SRL-OSR is working and I would suggest using it over the 07 include mainly for the use of antirandoms. I also know that Flag is working in SRL-OSR because I use it.

  7. #7
    Join Date
    Mar 2013
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    If you must use the P07_Include, then download the OSR-SRL but delete the P07_GetUpChar function in P07_Include since they share the same name in both libraries/includes but function identically. Then you can use SRL alongside with P07_Include.

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
  •