Page 2 of 3 FirstFirst 123 LastLast
Results 26 to 50 of 51

Thread: Custom map switching

  1. #26
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    I tried to do exactly what you did for the print out, but it was WalkPath not writeln, so a real world attempt like, setup(varrock) walkpath(etc) setup(altars) walkpath(etc), but if I remember I was always trying to load from Runescape_Other folder, could that cause something? The map never switched, and the second points never worked, but after the path timed out, the first points would still work, seemed from the first call of Sps setup, you couldent change the map

    Tried it with several different maps and etc too, still never worked
    You can't always load from the RUNESCAPE_OTHER folder. That only works if the map you want to load is in that folder. For Runecrafting, your initial call would be SPS_Setup(RUNESCAPE_SURFACE, []) and your second call (when you want to switch areas) would be SPS_Setup(RUNESCAPE_OTHER, []) - you need to switch surface constants.

  2. #27
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    You can't always load from the RUNESCAPE_OTHER folder. That only works if the map you want to load is in that folder. For Runecrafting, your initial call would be SPS_Setup(RUNESCAPE_SURFACE, []) and your second call (when you want to switch areas) would be SPS_Setup(RUNESCAPE_OTHER, []) - you need to switch surface constants.
    Yea ofcourse, i used other in both calls, both custom made maps, tripple checked everything duno why it never works


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  3. #28
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    Yea ofcourse, i used other in both calls, both custom made maps, tripple checked everything duno why it never works
    Hm, that doesn't make sense. Any chance you can write out the code, test that it doesn't work, then post it here? Like I said, it works for me, so I'd like to see the code that doesn't work for you.

  4. #29
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Hm, that doesn't make sense. Any chance you can write out the code, test that it doesn't work, then post it here? Like I said, it works for me, so I'd like to see the code that doesn't work for you.
    I'll try and edit this with result when I can, haven't tried it in a few weeks tho


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  5. #30
    Join Date
    May 2012
    Location
    Moscow, Russia
    Posts
    661
    Mentioned
    35 Post(s)
    Quoted
    102 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Hm, that doesn't make sense. Any chance you can write out the code, test that it doesn't work, then post it here? Like I said, it works for me, so I'd like to see the code that doesn't work for you.
    Simba Code:
    program Walker;
       //The code was generated with the path generator for SPS version 2 by Cynic
       {$DEFINE SMART}
       {$i SRL/srl.simba}
       {$i sps/sps.simba}



       var
         //place your variables here
         Status: string;
         EnterMine, MineLadders: integer;
         mode: boolean;//high level or low level??



      procedure DeclarePlayers;
       begin
          HowManyPlayers:=1;
          NumberOfPlayers(HowManyPlayers);
          CurrentPlayer:=0;
          with Players[0] do
          begin
             Name:='';
             Pass:='';
             LampSkill:=SKILL_ATTACK;
             Pin:='';
             Active:=true;
          end;
     end;
    //***LADDERS ROUTINE***

    function LadderDown(x, y: Integer): Boolean;
    var
      CTS, i: Integer;
      MyTPA: TPointArray;
      ATPA: T2DPointArray;
    begin
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.06, 1.87);

      FindColorsSpiralTolerance(MSCX, MSCY, MyTPA, 3367290, MSX1, MSY1, MSX2, MSY2, 7);
      ColorToleranceSpeed(CTS);
      ATPA := TPAToATPAEx(MyTPA, 30, 30);
      SortATPASize(ATPA, True);

      for i := 0 to Min(High(ATPA), 5) do
      begin
        MiddleTPAEx(ATPA[i], x, y);
        MMouse(x, y, 0, 0);

        if WaitUpTextMulti(['add', 'der'], RandomRange(500, 1000)) then
        begin
          ClickMouse2(mouse_Left);
          Result := WaitFunc(@DidRedClick, 1, 150);
          Break;
        end else
        WriteLn('Ladder was not found @LadderDown');
      end;
    end;

    procedure ClimbDown;
    var
      x, y: Integer;
      v: TVariantArray;
    begin
      v := ['mineladders'];
      Status:='ClimbDown';
      WriteLn(Status);
      if not LoggedIn then
        Exit;

      if LadderDown(x, y) then
      begin
        WaitFunc(@IsMoving, 10, 1000);
        while IsMoving do
          Wait(5);

        if not WaitFuncEx('Location', v, 350, 6500) then
          exit;
      end else
      WriteLn('No ladder @ClimbDown');
    end;

    Procedure Loads();
    begin
      EnterMine := DTMFromString('mbQAAAHicY2VgYChmYmDIBuIOIE4B4nAgbgeKZwNxFhDPAOISIP7//z/DZ6AcMv4PFJdEw4xAzIKGwQAAXHAM3g==');
      MineLadders := DTMFromString('mWAAAAHicY2FgYChlYmCoAuJCJgh7GlBsChBPAuJuIA434ELBYkAxZMyEhkEAAJKHBs0=');
    end;
    //***WALKING ROUTINE***
      // 2 map sps setup
     procedure InitMap;
     begin
     if mode then
     begin
      ClickNorth(SRL_ANGLE_HIGH);
      SPS_Setup(RUNESCAPE_OTHER,['mg_highlevel']);
      WriteLn(toStr(SPS_Areas));
     end
      else
      begin
      ClickNorth(SRL_ANGLE_HIGH);
      SPS_Setup(RUNESCAPE_OTHER,['mg_lowlevel']);
      WriteLn(toStr(SPS_Areas));
      end;
     end;
     procedure  ToMine;
       var
         ToMinePath: TPointArray;
       begin
         ToMinePath:=[Point(139,276),Point(159,279),Point(180,282),Point(208,283)];
         if SPS_WalkPath(ToMinePath) then
          Status := 'ToMine'
           else begin
            Status :='Failed ToMine';
            WriteLn(status + '#Time Running:' +TimeRunning);
            Logout;
            TerminateScript;
           end;
          WriteLn(status + '#Time Running:' +TimeRunning);
          WriteLn(toStr(SPS_GetMyPos));
         end;

      procedure  ToGuild;
       var
         ToGuildPath: TPointArray;
       begin
         ToGuildPath:=[Point(242,205),Point(247,187),Point(262,186),Point(283,189),Point(293,202),Point(292,223),Point(312,238),Point(317,256),Point(319,280),Point(313,294),Point(274,280)];
         if SPS_WalkPath(ToGuildPath) then
          Status := 'ToGuild'
           else begin
            Status :='Failed ToGuild';
            WriteLn(status + '#Time Running:' +TimeRunning);
            Logout;
            TerminateScript;
           end;
          WriteLn(status + '#Time Running:' +TimeRunning);
          WriteLn('Im in point: '+toStr(SPS_GetMyPos));
          mode:= false;
          wait(5000);
          InitMap;
          wait(1000);
          ToMine;
         end;

      procedure  fromGuild;
       var
         fromGuildPath: TPointArray;
       begin
         fromGuildPath:=[Point(273,279),Point(319,289),Point(319,263),Point(311,239),Point(297,224),Point(284,194),Point(259,186),Point(251,211)];
         if SPS_WalkPath(fromGuildPath) then
          Status := 'fromGuild'
           else begin
            Status :='Failed fromGuild';
            WriteLn(status + '#Time Running:' +TimeRunning);
            Logout;
            TerminateScript;
           end;
          WriteLn(status + '#Time Running:' +TimeRunning);
         end;

      procedure  OutMine;
       var
         OutMinePath: TPointArray;
       begin
         OutMinePath:=[Point(214,282),Point(187,282),Point(167,281),Point(141,276)];
         if SPS_WalkPath(OutMinePath) then
          Status := 'OutMine'
           else begin
            Status :='Failed OutMine';
            WriteLn(status + '#Time Running:' +TimeRunning);
            Logout;
            TerminateScript;
           end;
          WriteLn(status + '#Time Running:' +TimeRunning);
         end;
      procedure SetupWalker;
       begin
         SRL_SIXHOURFIX := TRUE;
         SMART_FIXSPEED := TRUE;
         SetupSRL;
         DeclarePlayers;
         LoginPlayer;
          Wait(567+ Random(120));
         ClickNorth(SRL_ANGLE_HIGH);
         SPS_Setup(RUNESCAPE_OTHER,['mg_highlevel']);
         WriteLn(toStr(SPS_Areas));
         Mode:=true;
      end;
      begin
      SetupWalker;
      toGuild;
      Wait(2000+random(100));

    Suppose that's a code does not work, although showing the correct names SPS_Areas. With Single map that work fine.
    Per aspera ad Astra!
    ----------------------------------------
    Slow and steady wins the race.

  6. #31
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Can you post the rest of your mainloop?

  7. #32
    Join Date
    May 2012
    Location
    Moscow, Russia
    Posts
    661
    Mentioned
    35 Post(s)
    Quoted
    102 Post(s)

    Default

    The script is a full, change maps should be a function of the path. Juast add 'end;'.
    Per aspera ad Astra!
    ----------------------------------------
    Slow and steady wins the race.

  8. #33
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    No, I mean at the end you have:
    Simba Code:
    begin
      SetupWalker;
      toGuild;
      Wait(2000+random(100));
    You're saying that's the end of the script? I need to know what else you call to make sure everything is called properly.

  9. #34
    Join Date
    May 2012
    Location
    Moscow, Russia
    Posts
    661
    Mentioned
    35 Post(s)
    Quoted
    102 Post(s)

    Default

    If you look to guild function:

    Simba Code:
    ***
     procedure  ToGuild;
       var
         ToGuildPath: TPointArray;
       begin
         ToGuildPath:=[Point(242,205),Point(247,187),Point(262,186),Point(283,189),Point(293,202),Point(292,223),Point(312,238),Point(317,256),Point(319,280),Point(313,294),Point(274,280)];
         if SPS_WalkPath(ToGuildPath) then
          Status := 'ToGuild'
           else begin
            Status :='Failed ToGuild';
            WriteLn(status + '#Time Running:' +TimeRunning);
            Logout;
            TerminateScript;
           end;
          WriteLn(status + '#Time Running:' +TimeRunning);
          WriteLn('Im in point: '+toStr(SPS_GetMyPos));
          mode:= false;
          wait(5000);
          InitMap;
          wait(1000);
          ToMine;
         end;
    - look last 5 lines. This is just map switching test anyway.
    Per aspera ad Astra!
    ----------------------------------------
    Slow and steady wins the race.

  10. #35
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Okay, well from what I can see, you don't have any code that climbs down the ladders, so it makes sense that it wouldn't walk in the lower level when you're not in the lower level.

    Maybe you can send me your custom maps and I can test it myself.

  11. #36
    Join Date
    May 2012
    Location
    Moscow, Russia
    Posts
    661
    Mentioned
    35 Post(s)
    Quoted
    102 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Okay, well from what I can see, you don't have any code that climbs down the ladders, so it makes sense that it wouldn't walk in the lower level when you're not in the lower level.

    Maybe you can send me your custom maps and I can test it myself.
    They are listed in first post
    Per aspera ad Astra!
    ----------------------------------------
    Slow and steady wins the race.

  12. #37
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    I haven't tested yet, but I was looking at your SwitchMap function and SPS_Setup. You know that the only difference is you took out an if statement that wouldn't do anything if the surface is set to RUNESCAPE_OTHER. So, in your case (using 2 custom maps), your function is exactly the same as SPS_Setup.

    E: Tested the script you posted above (I added in climbDown in the toMine procedure, and had to comment out lines 182-183 because 'Location' isn't a valid procedure name), and it worked perfectly. Walked from the bank to the ladders, climbed down, and walked to the center of the mine.

    So I'm not sure what your issue was/is.

    Here's the script with the small changes if you want to see it:
    Simba Code:
    program Walker;
       //The code was generated with the path generator for SPS version 2 by Cynic
       {$DEFINE SMART8}
       {$i SRL/srl.simba}
       {$i sps/sps.simba}



       var
         //place your variables here
         Status: string;
         EnterMine, MineLadders: integer;
         mode: boolean;//high level or low level??



      procedure DeclarePlayers;
       begin
          HowManyPlayers:=1;
          NumberOfPlayers(HowManyPlayers);
          CurrentPlayer:=0;
          with Players[0] do
          begin
             Name:='';
             Pass:='';
             LampSkill:=SKILL_ATTACK;
             Pin:='';
             Active:=true;
          end;
     end;
    //***LADDERS ROUTINE***

    function LadderDown(x, y: Integer): Boolean;
    var
      CTS, i: Integer;
      MyTPA: TPointArray;
      ATPA: T2DPointArray;
    begin
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.06, 1.87);

      FindColorsSpiralTolerance(MSCX, MSCY, MyTPA, 3367290, MSX1, MSY1, MSX2, MSY2, 7);
      ColorToleranceSpeed(CTS);
      ATPA := TPAToATPAEx(MyTPA, 30, 30);
      SortATPASize(ATPA, True);

      for i := 0 to Min(High(ATPA), 5) do
      begin
        MiddleTPAEx(ATPA[i], x, y);
        MMouse(x, y, 0, 0);

        if WaitUpTextMulti(['add', 'der'], RandomRange(500, 1000)) then
        begin
          ClickMouse2(mouse_Left);
          Result := WaitFunc(@DidRedClick, 1, 150);
          Break;
        end else
        WriteLn('Ladder was not found @LadderDown');
      end;
    end;

    procedure ClimbDown;
    var
      x, y: Integer;
      v: TVariantArray;
    begin
      v := ['mineladders'];
      Status:='ClimbDown';
      WriteLn(Status);
      if not LoggedIn then
        Exit;

      if LadderDown(x, y) then
      begin
        WaitFunc(@IsMoving, 10, 1000);
        while IsMoving do
          Wait(5);

        wait(3000);

        //if not WaitFuncEx('Location', v, 350, 6500) then
          //exit;
      end else
      WriteLn('No ladder @ClimbDown');
    end;

    Procedure Loads();
    begin
      EnterMine := DTMFromString('mbQAAAHicY2VgYChmYmDIBuIOIE4B4nAgbgeKZwNxFhDPAOISIP7//z/DZ6AcMv4PFJdEw4xAzIKGwQAAXHAM3g==');
      MineLadders := DTMFromString('mWAAAAHicY2FgYChlYmCoAuJCJgh7GlBsChBPAuJuIA434ELBYkAxZMyEhkEAAJKHBs0=');
    end;
    //***WALKING ROUTINE***
      // 2 map sps setup
     procedure InitMap;
     begin
     if mode then
     begin
      ClickNorth(SRL_ANGLE_HIGH);
      SPS_Setup(RUNESCAPE_OTHER,['mg_highlevel']);
      WriteLn(toStr(SPS_Areas));
     end
      else
      begin
      ClickNorth(SRL_ANGLE_HIGH);
      SPS_Setup(RUNESCAPE_OTHER,['mg_lowlevel']);
      WriteLn(toStr(SPS_Areas));
      end;
     end;
     procedure  ToMine;
       var
         ToMinePath: TPointArray;
       begin
         ToMinePath:=[Point(139,276),Point(159,279),Point(180,282),Point(208,283)];
         if SPS_WalkPath(ToMinePath) then
          Status := 'ToMine'
           else begin
            Status :='Failed ToMine';
            WriteLn(status + '#Time Running:' +TimeRunning);
            Logout;
            TerminateScript;
           end;
          WriteLn(status + '#Time Running:' +TimeRunning);
          WriteLn(toStr(SPS_GetMyPos));
         end;

      procedure  ToGuild;
       var
         ToGuildPath: TPointArray;
       begin
         ToGuildPath:=[Point(242,205),Point(247,187),Point(262,186),Point(283,189),Point(293,202),Point(292,223),Point(312,238),Point(317,256),Point(319,280),Point(313,294),Point(274,280)];
         if SPS_WalkPath(ToGuildPath) then
          Status := 'ToGuild'
           else begin
            Status :='Failed ToGuild';
            WriteLn(status + '#Time Running:' +TimeRunning);
            Logout;
            TerminateScript;
           end;
          WriteLn(status + '#Time Running:' +TimeRunning);
          WriteLn('Im in point: '+toStr(SPS_GetMyPos));
          climbDown();
          mode:= false;
          wait(5000);
          InitMap;
          wait(1000);
          ToMine;
         end;

      procedure  fromGuild;
       var
         fromGuildPath: TPointArray;
       begin
         fromGuildPath:=[Point(273,279),Point(319,289),Point(319,263),Point(311,239),Point(297,224),Point(284,194),Point(259,186),Point(251,211)];
         if SPS_WalkPath(fromGuildPath) then
          Status := 'fromGuild'
           else begin
            Status :='Failed fromGuild';
            WriteLn(status + '#Time Running:' +TimeRunning);
            Logout;
            TerminateScript;
           end;
          WriteLn(status + '#Time Running:' +TimeRunning);
         end;

      procedure  OutMine;
       var
         OutMinePath: TPointArray;
       begin
         OutMinePath:=[Point(214,282),Point(187,282),Point(167,281),Point(141,276)];
         if SPS_WalkPath(OutMinePath) then
          Status := 'OutMine'
           else begin
            Status :='Failed OutMine';
            WriteLn(status + '#Time Running:' +TimeRunning);
            Logout;
            TerminateScript;
           end;
          WriteLn(status + '#Time Running:' +TimeRunning);
         end;
      procedure SetupWalker;
       begin
         SRL_SIXHOURFIX := TRUE;
         SMART_FIXSPEED := TRUE;
         SetupSRL;
         DeclarePlayers;
         LoginPlayer;
          Wait(567+ Random(120));
         ClickNorth(SRL_ANGLE_HIGH);
         SPS_Setup(RUNESCAPE_OTHER,['mg_highlevel']);
         WriteLn(toStr(SPS_Areas));
         Mode:=true;
      end;
      begin
      SetupWalker;
      toGuild;
      Wait(2000+random(100));
      end.
    Last edited by Coh3n; 01-23-2013 at 05:04 PM.

  13. #38
    Join Date
    May 2012
    Location
    Moscow, Russia
    Posts
    661
    Mentioned
    35 Post(s)
    Quoted
    102 Post(s)

    Default

    Wow!
    Per aspera ad Astra!
    ----------------------------------------
    Slow and steady wins the race.

  14. #39
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by CynicRus View Post
    Wow!
    Lol, I'm assuming that means it also works for you?

  15. #40
    Join Date
    May 2012
    Location
    Moscow, Russia
    Posts
    661
    Mentioned
    35 Post(s)
    Quoted
    102 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Lol, I'm assuming that means it also works for you?
    Yep. But I dont have any idea, why this approach has not worked before.
    Per aspera ad Astra!
    ----------------------------------------
    Slow and steady wins the race.

  16. #41
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    I want to say sps.simba in the updater wasn't updated to the version I've been using. I've been using the version in the repo. for months and months. It wasn't until last week that it came to my attention that the code in the updater was very outdated.

    That could have been the issue.

  17. #42
    Join Date
    May 2012
    Location
    Moscow, Russia
    Posts
    661
    Mentioned
    35 Post(s)
    Quoted
    102 Post(s)

    Default

    Thank you!
    Per aspera ad Astra!
    ----------------------------------------
    Slow and steady wins the race.

  18. #43
    Join Date
    Oct 2012
    Location
    Italy
    Posts
    145
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Lightbulb SPS Walkpath stops working after teleport..

    Quote Originally Posted by VastlySuperior View Post
    This will come in handy as sps setup has a problem when you try to access different map areas. I t walk the first path with the current map but the moment you call another map it just stand there doing nothing.
    Hey guys, I have the same problem.. But slightly different.. To avoid the map switching problem I've made a custom map with the two pieces from the world map that I needed, but it only works for the first path, and not the next ones..
    Maybe the problem is after I'm teleporting??

    Attachment 18928 After I teleport to barbarian outpost it stops there.. If I start from the Barbarian outpost it works with the same code -.-' The map is saved in RUNESCAPE_OTHER.

    Quote Originally Posted by CynicRus View Post
    I think if anyone is interested, it will include in the SPS. If not, anyone in need can use it independently.
    Please do it! I've found about three other people with the same problem

    http://villavu.com/forum/showthread.php?t=95950 , http://villavu.com/forum/showthread.php?t=95984 , And me -> http://villavu.com/forum/showthread.php?t=95934

    Maybe I should enable the SPS rotated minimap thing? I've also tried to load all the pieces that I need from the RUNESCAPE_SURFACE, all in one SPS_Setup call, and it did not work..

    Thanks guys..
    Last edited by Zorgatone; 02-02-2013 at 01:55 PM.

  19. #44
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by Zorgatone View Post
    Hey guys, I have the same problem.. But slightly different.. To avoid the map switching problem I've made a custom map with the two pieces from the world map that I needed, but it only works for the first path, and not the next ones..
    Maybe the problem is after I'm teleporting??

    Please do it! I've found about three other people with the same problem
    Like I said earlier in the thread, the function in the first post is EXACTLY the same as SPS_Setup, so adding it to the rep

    Quote Originally Posted by Zorgatone View Post
    Maybe I should enable the SPS rotated minimap thing? I've also tried to load all the pieces that I need from the RUNESCAPE_SURFACE, all in one SPS_Setup call, and it did not work..
    That has nothing to do with your problem. You can enable it if you want, but it likely won't make a difference.

    Can you please post the code that doesn't work? Or a test file that simulates what you're doing, and also doesn't work? If you post your script, I would prefer it with the SPS areas as opposed to your custom map.

    E: You could also set SPS_Debug := true; to see if anything is printed when your problem occurs.

    E2: Also, could you run this little script please? It saves the SPS maps you load to a file so you can see for sure if the map is changing. Just paste it in Simba and hit run. You can also change up the map areas to test different combinations.
    Simba Code:
    program new;
    {$i srl/srl.simba}
    {$i sps/sps.simba}

    var
      counter: integer;

    function SPS_SetupEx(surface: integer; areas: TStringArray): boolean;
    var
      t: integer;
      tmp: TMufasaBitmap;
    begin
      t := getSystemTime;

      SPS_MultiMouse := true;
      SPS_Accuracy := 4;

      if (length(areas) > 0) then
      begin
        if (surface = RUNESCAPE_SURFACE) then
          tmp := SPS_MergeAreas(areas) // combine the SPS areas into 1; makes for a more accurate read
        else
          if (surface = RUNESCAPE_OTHER) then
            if (length(areas) = 1) then
              tmp := SPS_GetArea(areas[0], surface)
            else begin
              writeln('SPS_Setup(): Invalid dungeon areas. You can only select one!');
              exit;
            end;

        SPS_IsSetup := true;
        result := true;
        tmp.SaveToFile(appPath+toStr(counter)+'.png');
        inc(counter);

        {$IFDEF SIMBAMAJOR990}
        SPS_BitmapToMap(tmp, SPS_Accuracy, SPS_AreaMaps);
        {$ELSE}
        SPS_AreaMaps := SPS_BitmapToMap(tmp, SPS_Accuracy);
        {$ENDIF}

        if (surface = RUNESCAPE_SURFACE) then
          SPS_Areas := SPS_SortAreas(areas)
        else
          if (surface = RUNESCAPE_OTHER) then
            SPS_Areas := areas;

        tmp.free();

      end else
        writeln('SPS_Setup(): ERROR: SPS areas are not set!');

      t := (getSystemTime - t);

      if (SPS_Debug) and (result) then
        writeln('[SPS] SPS_Setup() took '+toStr(t)+' ms. Areas: '+toStr(SPS_Areas));
    end;

    begin
      ClearDebug();
      SPS_SetupEx(RUNESCAPE_SURFACE, ['11_7']);
      SPS_SetupEx(RUNESCAPE_OTHER, ['dwarven_mine']);
    end.
    Last edited by Coh3n; 02-02-2013 at 10:45 PM.

  20. #45
    Join Date
    Oct 2012
    Location
    Italy
    Posts
    145
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Like I said earlier in the thread, the function in the first post is EXACTLY the same as SPS_Setup, so adding it to the rep

    That has nothing to do with your problem. You can enable it if you want, but it likely won't make a difference.

    Can you please post the code that doesn't work? Or a test file that simulates what you're doing, and also doesn't work? If you post your script, I would prefer it with the SPS areas as opposed to your custom map.

    E: You could also set SPS_Debug := true; to see if anything is printed when your problem occurs.

    E2: Also, could you run this little script please? It saves the SPS maps you load to a file so you can see for sure if the map is changing. Just paste it in Simba and hit run. You can also change up the map areas to test different combinations.
    Simba Code:
    program new;
    {$i srl/srl.simba}
    {$i sps/sps.simba}

    var
      counter: integer;

    function SPS_SetupEx(surface: integer; areas: TStringArray): boolean;
    var
      t: integer;
      tmp: TMufasaBitmap;
    begin
      t := getSystemTime;

      SPS_MultiMouse := true;
      SPS_Accuracy := 4;

      if (length(areas) > 0) then
      begin
        if (surface = RUNESCAPE_SURFACE) then
          tmp := SPS_MergeAreas(areas) // combine the SPS areas into 1; makes for a more accurate read
        else
          if (surface = RUNESCAPE_OTHER) then
            if (length(areas) = 1) then
              tmp := SPS_GetArea(areas[0], surface)
            else begin
              writeln('SPS_Setup(): Invalid dungeon areas. You can only select one!');
              exit;
            end;

        SPS_IsSetup := true;
        result := true;
        tmp.SaveToFile(appPath+toStr(counter)+'.png');
        inc(counter);

        {$IFDEF SIMBAMAJOR990}
        SPS_BitmapToMap(tmp, SPS_Accuracy, SPS_AreaMaps);
        {$ELSE}
        SPS_AreaMaps := SPS_BitmapToMap(tmp, SPS_Accuracy);
        {$ENDIF}

        if (surface = RUNESCAPE_SURFACE) then
          SPS_Areas := SPS_SortAreas(areas)
        else
          if (surface = RUNESCAPE_OTHER) then
            SPS_Areas := areas;

        tmp.free();

      end else
        writeln('SPS_Setup(): ERROR: SPS areas are not set!');

      t := (getSystemTime - t);

      if (SPS_Debug) and (result) then
        writeln('[SPS] SPS_Setup() took '+toStr(t)+' ms. Areas: '+toStr(SPS_Areas));
    end;

    begin
      ClearDebug();
      SPS_SetupEx(RUNESCAPE_SURFACE, ['11_7']);
      SPS_SetupEx(RUNESCAPE_OTHER, ['dwarven_mine']);
    end.
    0.png1.png

    Well, here are the maps that your script saved... And here the code of my test script that doesn't work: http://pastebin.com/DKDXTe2g


    EDIT: Even trying new scripts and paths, with custom map either it will always run only the first path..
    If I test the paths individually they work.. If I put them all in the same script and I run the script, It'll walk only the first one. After that I teleport and I get this messages:
    SPS_GetMyPos: Finished in 670 ms. Result = (-1, -1)
    SPS_GetMyPos: Finished in 686 ms. Result = (-1, -1)

    SPS_GetMyPos: Finished in 670 ms. Result = (-1, -1)
    SPS_GetMyPos: Finished in 686 ms. Result = (-1, -1)

    SPS_GetMyPos: Finished in 670 ms. Result = (-1, -1)
    SPS_GetMyPos: Finished in 686 ms. Result = (-1, -1)
    And so on... (infinite loop?)

    I don't know what I'm doing wrong..

    New code: http://pastebin.com/NKx0nrwY

    Maps: minivarrock.pngminitoads.png

    I've commented out the first path to test the second one.. Just remove the comment from pastebin

    E2: Similar problem Here > http://villavu.com/forum/showthread.php?t=95984

    E3: Anyway Even with one map only.. I'm trying jumping into the barbarian outpost's whirlpool and after that It doesn't walk the second path (the map is the same), even if I'm calling sps_setup again..
    This issue happens everytime I teleport somewhere and the paths I made are correct.. Same happens using games necklace
    Last edited by Zorgatone; 02-03-2013 at 07:18 AM.

  21. #46
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Okay, so good and bad news.

    Bad news: I haven't solved the problem yet.

    Good news: I was finally able to recreate the problem (I was unable to before; I'm not sure why yet), so that's the first step to solving the problem.

    I'll keep you guys updated.

  22. #47
    Join Date
    Oct 2012
    Location
    Italy
    Posts
    145
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Okay, so good and bad news.

    Bad news: I haven't solved the problem yet.

    Good news: I was finally able to recreate the problem (I was unable to before; I'm not sure why yet), so that's the first step to solving the problem.

    I'll keep you guys updated.
    Thanks! I'm happy to hear that you'll work to fix that problem to everyone!
    I appreciate your help, keep us updated.

    Zorgatone.


    E1: I think you never tried 3 different paths with two teleports like I did :P It might be the problem.
    E2: You might also check the official SPS maps to be sure they're updated, but this is not the cause of this issue.
    Last edited by Zorgatone; 02-03-2013 at 08:47 PM. Reason: More informations

  23. #48
    Join Date
    May 2012
    Location
    Moscow, Russia
    Posts
    661
    Mentioned
    35 Post(s)
    Quoted
    102 Post(s)

    Default

    I believe that it is necessary to clean the SPS variables in memory. Completely. Maybe then all the work. Need function like SPS_Reset.

    Simba Code:
    Procedure Reset;
     begin
       SetLEngth(SPS_Areas,0);
       SetLengthSPS_AreaMaps,0);
     end;
    or something like this.
    Per aspera ad Astra!
    ----------------------------------------
    Slow and steady wins the race.

  24. #49
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by CynicRus View Post
    I believe that it is necessary to clean the SPS variables in memory. Completely. Maybe then all the work. Need function like SPS_Reset.

    Simba Code:
    Procedure Reset;
     begin
       SetLEngth(SPS_Areas,0);
       SetLengthSPS_AreaMaps,0);
     end;
    or something like this.
    Hehe you're right. I found and fixed this issue a few minutes ago. I'm about to make the update thread now.

    E: http://villavu.com/forum/showthread.php?t=96051
    Last edited by Coh3n; 02-03-2013 at 09:34 PM.

  25. #50
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

Page 2 of 3 FirstFirst 123 LastLast

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
  •