Results 1 to 11 of 11

Thread: SPS help

  1. #1
    Join Date
    Oct 2010
    Posts
    93
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default SPS help

    So I use SPS for walking on one of my runecrafting scripts, I have the map in the correct location includes/sps/img/runescape_surface.

    I load it correctly Sps.Setup('0_0map', runescape_surface);
    I was using the script a couple of weeks ago but havent used it or changed it since then, today I tried to run it and got this error
    Simba Code:
    ---- FATAL ERROR: sps.setup(): Unable to load map or bitmap to map failed
    Successfully executed.

    Have updated my srl and sps, updated simba. I open the script from its file not threw simba's recently used. The map is a .png file which has worked for years.

    I really cant figure out why it will not work. Any help is much much appreciated. I am using sps-rs3 by the way.

    The procedure which is throwing up the error from sps-rs3 is the following.
    Simba Code:
    (*
      Loads and setups the TSPSArea.

      Example:
        sps.setup('my_map_name', RUNESCAPE_SURFACE, 4, 600.0, 0.40);
    *)

    procedure TSPSArea.setup(imgName, imgFolder: string; accuracy: integer; tolerance, minMatchPercent: extended);
    var
      bmp: TMufasaBitmap;
      t: integer;
      m: extended;
    begin
      print(self.getName()+'.init()', TDebug.HEADER);

      t := getSystemTime();

      if (fileExists(SPS_IMG_PATH + imgFolder + imgName + SPS_IMG_FMT)) then
      begin
        print('Path exists ('+SPS_IMG_PATH + imgFolder + imgName + SPS_IMG_FMT+')');

        self._accuracy := accuracy;
        self._tolerance := tolerance;
        self._minMatchPercent := minMatchPercent;
        self.__mapPath := SPS_IMG_PATH + imgFolder + imgName + SPS_IMG_FMT;

        if (spsAnyAngle) then
          self._minMatchPercent := 0.10;

        try
          bmp.init(client.getMBitmaps());
          bmp.loadFromFile(self.__mapPath);

          SPS_BitmapToMap(bmp, self._accuracy, self.__areaMap);
        except
          print(self.getName()+'.setup(): Unable to load map or bitmap to map failed', TDebug.FATAL);
        finally
          bmp.free();
        end;

        self.isSetup := true;
      end else
        print(self.getName()+'.setup(): Unable to find map, searched path '+ SPS_IMG_PATH + imgFolder + imgName + SPS_IMG_FMT, TDebug.FATAL);

      print('Setup area "' + imgName + '" in ' + intToStr(getSystemTime() - t) + 'ms');
      print(self.getName()+'.init()', TDebug.FOOTER);
    end;

  2. #2
    Join Date
    Oct 2010
    Posts
    93
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Simba Code:
    program new;
    {$DEFINE SMART}
    {$I SRL-6/SRL.simba}
    {$I sps/lib/sps-rs3.simba}
    begin
        smartPlugins := ['d3d9.dll'];
        SetUpSrl();
        Sps.Setup('0_0map', runescape_surface, 4, 600.0, 0.40);
    end.


    Just ran that to make sure it wasnt anything else in the script which was causing problems and got the same error so I am going to do some investigation on the size of the map and location, but it always worked fine in the past!

  3. #3
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Try force updating your plugins

  4. #4
    Join Date
    Oct 2010
    Posts
    93
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Thanks I completely uninstalled everything to do with Simba and reinstalled simba, srl and sps from scratch which did the trick. Another question if you dont mind. I am using this procedure to click on the altar
    Simba Code:
    procedure CraftRunes(WaitLonger: Boolean);
    var
      ColorsFound: TPointArray;
      MidPoint: TPoint;
      CR1: Integer;
      begin
        if FindColorsTolerance(ColorsFound, ColorAltar, MainScreen.GetBounds, ColorTolAltar) then
        begin
          writeLn('==============Found Altar Color Checking if Altar!===============');
          MidPoint := MedianTpa(ColorsFound);
          Mouse(MidPoint);
           if (isMouseOverText(['Craft', '-rune', 'Altar'], 500)) then
              begin
                Mouse(MidPoint, MOUSE_LEFT);
                writeLn('==============It was the Altar! Crafting Runes!===============');
                wait(1500 + randomrange(100,150));
              end

         else end;
      end;

    I was just wondering if this is safe to use. It clicks on the midpoint of the TPA, I suppose my worry is that that point may be the same everytime? IS that the case or is the TPA midpoint slightly different everytime? Thanks for your help.

  5. #5
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by kingob View Post
    Thanks I completely uninstalled everything to do with Simba and reinstalled simba, srl and sps from scratch which did the trick. Another question if you dont mind. I am using this procedure to click on the altar
    Simba Code:
    procedure CraftRunes(WaitLonger: Boolean);
    var
      ColorsFound: TPointArray;
      MidPoint: TPoint;
      CR1: Integer;
      begin
        if FindColorsTolerance(ColorsFound, ColorAltar, MainScreen.GetBounds, ColorTolAltar) then
        begin
          writeLn('==============Found Altar Color Checking if Altar!===============');
          MidPoint := MedianTpa(ColorsFound);
          Mouse(MidPoint);
           if (isMouseOverText(['Craft', '-rune', 'Altar'], 500)) then
              begin
                Mouse(MidPoint, MOUSE_LEFT);
                writeLn('==============It was the Altar! Crafting Runes!===============');
                wait(1500 + randomrange(100,150));
              end

         else end;
      end;

    I was just wondering if this is safe to use. It clicks on the midpoint of the TPA, I suppose my worry is that that point may be the same everytime? IS that the case or is the TPA midpoint slightly different everytime? Thanks for your help.
    I could swear I've seen this snippet of code before

  6. #6
    Join Date
    Oct 2010
    Posts
    93
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    I could swear I've seen this snippet of code before

    Haha ye for sure I ament even sure which script I took it from, think it was maybe from vwxz's astral crafter. I changed it to use the mouseover text as a fail safe as that wasnt in the procedure originally as far as I can remember. I used parts of peoples scripts when I was learning and I wasnt able to do something myself! Would you be able to answer my question? Also I use SPS to walk, I remember that when walking it used to not wait for the flag to disappear from the minimap before clicking the next point. Is there a way to do that again? I am currently using rs3 sps and just using the sps.walkpath. I have taken the walkpath function from the include and but in my script and am changing it around trying to reduce the wait times between clicking to points. Is there an easier way to do this? Thanks

  7. #7
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by kingob View Post
    Haha ye for sure I ament even sure which script I took it from, think it was maybe from vwxz's astral crafter. I changed it to use the mouseover text as a fail safe as that wasnt in the procedure originally as far as I can remember. I used parts of peoples scripts when I was learning and I wasnt able to do something myself! Would you be able to answer my question? Also I use SPS to walk, I remember that when walking it used to not wait for the flag to disappear from the minimap before clicking the next point. Is there a way to do that again? I am currently using rs3 sps and just using the sps.walkpath. I have taken the walkpath function from the include and but in my script and am changing it around trying to reduce the wait times between clicking to points. Is there an easier way to do this? Thanks
    Just follow the SPS guide in my tutorial.

  8. #8
    Join Date
    Oct 2010
    Posts
    93
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    I already know how to use sps, I was asking specifically about creating an sps function which does not wait for the minimap flag to disappear before clicking on the next point. I have already managed to create the function in the mean time. No wonder there are no new SRL scripters, I have asked three different questions and havent gotten more than a ten word reply without answering one of my questions.

  9. #9
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by kingob View Post
    I already know how to use sps, I was asking specifically about creating an sps function which does not wait for the minimap flag to disappear before clicking on the next point. I have already managed to create the function in the mean time. No wonder there are no new SRL scripters, I have asked three different questions and havent gotten more than a ten word reply without answering one of my questions.
    No need to lash out The reason I said that is because sps.walkpath doesn't wait for the flag to disappear, it waits until the flag is within a certain distance from the MM center (which is random each time). If the flag is always disappearing before each click, it might mean simba is taking a while to calculate your position from the SPS map after each click. Could be a massive map or a slow computer. Anyway, I'm glad you came up with a solution.

  10. #10
    Join Date
    Oct 2010
    Posts
    93
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    ok thank you

  11. #11
    Join Date
    Nov 2012
    Location
    N/A
    Posts
    185
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default

    @kingob, yeah their is a similar check:

    Simba Code:
    minimap.waitFlag(7);
    minimap.waitPlayerMoving();

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
  •