Results 1 to 13 of 13

Thread: Cant get SPS.walk to work

  1. #1
    Join Date
    Dec 2016
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Unhappy Cant get SPS.walk to work

    I'm trying to make my character run from the Port Sarim Lodestone to the Rimmington mines. I have the points and the sps map but I still can't get it to work. To me it seems like the script doesn't wait during the teleport so it tries to walk the path then it terminates the script. Can anyone spot anything wrong here? I've run out of ideas.

    Code:
    program RimmingtonMiner;
    {$DEFINE SMART} 
    {$i srl-6/srl.simba}
    {$I SPS/lib/SPS-RS3.Simba}
    
    procedure DeclarePlayers;
    begin
      setLength(players, 1);
      with players[0] do
      begin
        loginName := '';
        password := '';
        isActive := true;
        isMember := true;
      end
      currentPlayer := 0;
    end;
    
    procedure loginProcedure();
    begin
      if not isLoggedin() then
      begin
        players[currentPlayer].login(); 
        wait(gaussRangeInt(1000,1500));
      end;
      closePollWindow();
      exitTreasure();            
      minimap.clickCompass();
    end;
    
    procedure teleToPortSarim();
    var
      pathToMine: TPointArray;
    begin
      if not isLoggedIn() then
        exit;
    
        lodestoneScreen.teleportTo(LOCATION_PORT_SARIM);
        wait(randomRange(17000, 19000));
    
        pathToMine := [Point(228, 333), Point(169, 329), Point(127, 313), Point(78, 312), Point(66, 293), Point(84, 266)];
    
        SPS.walkPath(pathToMine);
        minimap.waitPlayerMoving();
    end;
    
    begin
      SetupSRL();
      declarePlayers();
      loginProcedure();
      SPS.setup('RIMM_MINE', RUNESCAPE_OTHER);
      teleToPortSarim();
    end.

  2. #2
    Join Date
    Sep 2014
    Posts
    447
    Mentioned
    10 Post(s)
    Quoted
    203 Post(s)

    Default

    Could be a variety of reasons. Can you post the debug info? The image could be failing, or it could be something with how you call walkPath. Not entirely sure, I try not to use SPS too much but the debug should have some useful info.

  3. #3
    Join Date
    Dec 2016
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Oh forgot about the debug logs. Here ya go.

    Code:
    Compiled successfully in 5250 ms.
    SRL: Logfile = C:\Simba\Includes\SRL-6/logs/SRL log (29-12-16 at 01.44.50 AM).txt
    -- setupSRL()
    ---- Setting up SRL...
    ---- attempting to spawn smart, attempt #: 1
    ---- initSmart():
    ------ Attempting to pair to a previously spawned client
    ------ smartPairToExistingClient():
    -------- Found 1 free client(s), attempting to pair to one...
    ---------- smartSetAsTarget(): Succesfully set SMART[20260] as Simba's target
    -------- Succesfully paired to a existing client, SMART[20260]
    ------ smartPairToExistingClient(): result = true
    ------ Succesfully initialized via pairing to a previously spawned client
    ---- initSmart()
    ---- Waiting up to 5 minutes for RS to load...
    ---- TRSActionBar.__find(): EOC bar height = 75
    ------ Dynamic interfaces have been set.
    ---- Client is ready.
    ---- Setup SRL in 0 Seconds
    -- setupSRL(): True
    -- exitTreasure()
    -- exitTreasure(): result = False
    -- TRSChooseOption.__select():
    ---- Options found: [Face NoMh, Face South, Cancel]
    ---- Found option "Face No" in "Face NoMh"
    -- TRSChooseOption.__select() result = True
    ---- minimap.mouseOffCompass(): Succesfully moved mouse off of compass
    ---- TRSMinimap.clickCompass(): Clicked compass
    -- sps.init()
    ---- Path exists (C:\Simba\Includes\SPS\img\runescape_other\RIMM_MINE.png)
    ---- Setup area "RIMM_MINE" in 47ms
    -- sps.init()
    ---- TRSLodestoneScreen.teleportTo(): result = true
    ---- TRSMinimap.findSymbol(): Found symbol 7 at accuracy 0.94
    -- sps.getPlayerPos(): result = {X = 110, Y = 138}, took 125 ms
    -- sps.getPlayerPos(): result = {X = 110, Y = 138}, took 109 ms
    -- sps.getPlayerPos(): result = {X = 110, Y = 138}, took 125 ms
    -- sps.getPlayerPos(): result = {X = 110, Y = 138}, took 125 ms
    -- sps.getPlayerPos(): result = {X = 110, Y = 138}, took 125 ms
    -- sps.getPlayerPos(): result = {X = 110, Y = 138}, took 125 ms
    -- sps.getPlayerPos(): result = {X = 110, Y = 138}, took 141 ms
    ---- Waiting while the player is moving...
    -- sps.walkPath(): result = False
    ---- Waiting while the player is moving...
    -- Succesfully freed SMART[20260]
    Successfully executed.
    I've also edited the script in attempt to make it work to no avail. Here's the new version.

    Code:
    program RimmingtonMiner;
    {$DEFINE SMART} // This is how we include SMART; it HAS to be called BEFORE SRL!
    {$i srl-6/srl.simba}
    {$I SPS/lib/SPS-RS3.Simba}
    
    procedure DeclarePlayers;
    begin
      setLength(players, 1);
      with players[0] do
      begin
        loginName := '';
        password := '';
        isActive := true;
        isMember := true;
      end
      currentPlayer := 0;
    end;
    
    //once logged in, closes relevant windows and sets compass facing south
    procedure loginProcedure();
    begin
      if not isLoggedin() then
      begin
        players[currentPlayer].login();   // Log them in
        wait(gaussRangeInt(1000,1500));
      end;
      closePollWindow();
      exitTreasure();            // Exit treasure hunter
      minimap.clickCompass();
    end;
    
    procedure teleToPortSarim();
    var
      pathToMine: TPointArray;
      p: TPoint;
    begin
      if not isLoggedIn() then
        exit;
    
        repeat
    
        lodestoneScreen.teleportTo(LOCATION_PORT_SARIM);
    
        until (not isLoggedIn()) or minimap.findSymbol(p, MM_SYMBOL_SHOP_FISHING, minimap.getBounds()); // This is all I added.
    
        pathToMine := [Point(228, 333), Point(169, 329), Point(127, 313), Point(78, 312), Point(66, 293), Point(84, 266)];
        wait(randomRange(16000, 16500));
        SPS.walkPath(pathToMine);
        minimap.waitPlayerMoving();
    end;
    
    begin
      SetupSRL();
      declarePlayers();
      loginProcedure();
      SPS.setup('RIMM_MINE', RUNESCAPE_OTHER);
      teleToPortSarim();
    end.
    Last edited by guitarafro; 12-29-2016 at 07:49 AM.

  4. #4
    Join Date
    Sep 2014
    Posts
    447
    Mentioned
    10 Post(s)
    Quoted
    203 Post(s)

    Default

    Hmmm not sure entirely whats wrong. It doesn't seem like the teleporting is wrong. I'd honestly just remake your sps path and experiment with how the image is processed. Odds are, that is the problem.

    Also not sure it'd actually help, but try
    Simba Code:
    if SPS.walkPath(pathToMine) then minimap.waitplayermoving()

  5. #5
    Join Date
    Dec 2016
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Okay, I've added your line of code and it walks now. But it goes in the wrong direction. I made a script to tell me my coordinates and it always says I'm at {X = -1, Y = -1} no matter where I walk. Do I need some more arguments after SPS.setup? I've seem some scripts have 3 numbers after calling the procedure.

  6. #6
    Join Date
    Sep 2014
    Posts
    447
    Mentioned
    10 Post(s)
    Quoted
    203 Post(s)

    Default

    No that just means it can't determine your position. SPS uses color matching to find out where you are. Likely you need a bigger SPS map.

  7. #7
    Join Date
    Dec 2016
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Tried a big sps map and still not working. Starting to think this scripting thing isn't for me. Is this map big enough? I just need it for walking to the Rimmington mines and the bank chest to the north of the mines.
    RIMM_MINE.PNG

  8. #8
    Join Date
    Dec 2013
    Location
    Pitcairn Island
    Posts
    288
    Mentioned
    20 Post(s)
    Quoted
    166 Post(s)

    Default

    Quote Originally Posted by guitarafro View Post
    Tried a big sps map and still not working. Starting to think this scripting thing isn't for me. Is this map big enough? I just need it for walking to the Rimmington mines and the bank chest to the north of the mines.
    RIMM_MINE.PNG
    It might just be me as I'm on my phone, but is that image you posted really low res? 300x300 for an area that big doesn't seem right. How did you make that map? I hope it's not the world map.

  9. #9
    Join Date
    Dec 2016
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    I used a site that had the world map. Now that I think about it that makes sense that using it wouldn't work. The zoom isn't universal. But even when I use the minimap my script doesn't work.

    Edit: Made a new map with the minimap and updated my coords. Still not working.
    RIMM_MINE.PNG
    Last edited by guitarafro; 12-29-2016 at 09:00 PM.

  10. #10
    Join Date
    Sep 2014
    Posts
    447
    Mentioned
    10 Post(s)
    Quoted
    203 Post(s)

    Default

    You should be using the minimap ingame, not the world map. It does still seem a little low-res though, not sure what you are using. Also try and cut out the areas that you don't need in order to eliminate false positives when doing color comparisons. I'll upload an example in a few minutes.

  11. #11
    Join Date
    Mar 2013
    Location
    Argentina
    Posts
    758
    Mentioned
    27 Post(s)
    Quoted
    365 Post(s)

    Default

    Quote Originally Posted by guitarafro View Post
    I used a site that had the world map. Now that I think about it that makes sense that using it wouldn't work. The zoom isn't universal. But even when I use the minimap my script doesn't work.

    Edit: Made a new map with the minimap and updated my coords. Still not working.
    RIMM_MINE.PNG
    https://villavu.com/forum/showthread.php?t=107757

    this tutorial will surely help you. You can skip to the part: "Sub-Tutorial 1 – Creating SPS maps and using them to walk anywhere"

    The problem you are having is with the map, once you learn how to make them correctly, SPS will work as it should. If im not mistaken there is world map in good resolution around the forums i used to cut chunks out of and they would work, it even doesnt have any symbols.

    PD: Scripting takes a lot of hard work to learn when doing it alone. Be sure to ask anything though, people here are very willing to help. Dont give up!
    Formerly known as Undorak7

  12. #12
    Join Date
    Dec 2016
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Okay. Thanks for the tips, I'll mess around with the map and figure it out.

  13. #13
    Join Date
    Sep 2014
    Posts
    447
    Mentioned
    10 Post(s)
    Quoted
    203 Post(s)

    Default

    Yup follow the guide that Lipcot posted. I think you must've use a different map, but if you follow the exact instructions in that tutorial, it'll work fine. If you're having trouble comprehending what SPS does or what it is, pretend that it's a dumb player who gets confused with maps.

    For that player, it'd be hard to ask them to find out what location you are present if the map is too big because then there's suddenly too many places where you could be. If the map is incomplete or lacks enough identifying features, then he can't walk the path or will get lost. In your case, if you hand them a blurry incorrect map, then they won't be able to do anything at all. Hope that helps, but feel free to ask more questions.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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