Results 1 to 13 of 13

Thread: So, I have a bunch of custom SPS maps...

  1. #1
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default So, I have a bunch of custom SPS maps...

    How would I get my script to intelligently detect which SPS map it is standing in, and move to a point? (The points would be different for each SPS map and for the sake of argument let's say the player just appears in the middle of a random map)

    edit: would I be able to combine all the small SPS images onto one large canvas (similiar to essence_mine.png or stronghold_of_security.png)?
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Bad™ before everyone gets laser pistols

  2. #2
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    Just wrote this off the top of my head.

    Simba Code:
    function CurrentMap(maps: TStringArray): String;
    var
      TempMap: String;
      i: Integer
    begin
      for i := 0 to length(maps-1) do
      begin
        TempMap := maps[i];
        SetupSPS(3, TempMap);
        if not(SPS_GetMyPos = Point(-1, -1)) then
        begin
          result := TempMap;
          Exit;
        end;
      end;
    end;

    like a boss.

    ofc there's probably a compiling error or two in there you'll have to fix.


    E:
    Quote Originally Posted by KeepBotting View Post
    edit: would I be able to combine all the small SPS images onto one large canvas (similiar to essence_mine.png or stronghold_of_security.png)?
    Yes. I did all that work for nothing.
    Last edited by Nebula; 08-06-2012 at 11:58 PM.

  3. #3
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Quote Originally Posted by Nebula View Post
    Just wrote this off the top of my head.

    Simba Code:
    function CurrentMap(maps: TStringArray): String;
    var
      TempMap: String;
      i: Integer
    begin
      for i := 0 to length(maps-1) do
      begin
        TempMap := maps[i];
        SetupSPS(3, TempMap);
        if not(SPS_GetMyPos = Point(-1, -1)) then
        begin
          result := TempMap;
          Exit;
        end;
      end;

    like a boss.

    ofc there's probably a compiling error or two in there you'll have to fix.


    E:


    Yes. I did all that work for nothing.
    I'll try both ways, but I'm a bit confused--I can't completely wrap my head around the idea I had about combining them into one canvas.
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Bad™ before everyone gets laser pistols

  4. #4
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    Just throw them all into one map. Use MS Paint like a boss. just make sure they're far enough apart from eachother so that they don't interfere with eachother.

  5. #5
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Use photoshop and merge them into one picture. A bit of basic Photoshop knowledge should be enough to do this.
    @Nebula
    I would put them all into one big picture by using photoshop and carefully placing them in the correct spot. Then it could be used in SPS properly.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  6. #6
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Quote Originally Posted by Nebula View Post
    Just throw them all into one map. Use MS Paint like a boss. just make sure they're far enough apart from eachother so that they don't interfere with eachother.
    Then how do I detect which one I am in? And how would I walk in them if they're all in one image?
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Bad™ before everyone gets laser pistols

  7. #7
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    Okay yes I can see where you would have issues with that. So What I posted would probably work best. I just fixed it for you. Should compile + work file.

    Simba Code:
    function CurrentMap(maps: TStringArray): String;
    var
      TempMap: TStringArray;
      i: Integer;
    begin
      for i := 0 to length(maps)-1 do
      begin
        SetLength(TempMap, 1);
        TempMap[0] := maps[i];
        SPS_Setup(3, TempMap);
        if not(SPS_GetMyPos = Point(-1, -1)) then
        begin
          result := TempMap[0];
          Exit;
        end;
      end;
    end;

  8. #8
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Quote Originally Posted by Nebula View Post
    Okay yes I can see where you would have issues with that. So What I posted would probably work best. I just fixed it for you. Should compile + work file.

    Simba Code:
    function CurrentMap(maps: TStringArray): String;
    var
      TempMap: TStringArray;
      i: Integer;
    begin
      for i := 0 to length(maps)-1 do
      begin
        SetLength(TempMap, 1);
        TempMap[1] := maps[i];
        SPS_Setup(3, TempMap);
        if not(SPS_GetMyPos = Point(-1, -1)) then
        begin
          result := TempMap[1];
          Exit;
        end;
      end;
    end;
    I still don't get it <.> what does that do?

    EDIT: Sorry, I'm a very visual learner. You have to spoonfeed me once, then I can strike out on my own rather proficiently. I need to understand what that function does, where to put my maps/what params to change, where to put the function itself, and how to call it.
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Bad™ before everyone gets laser pistols

  9. #9
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    CurrentMap('map1', 'map2', 'map3') would return the map you are currently in. So you could just do SPS_Setup(#, [CurrentMap]) and it would work fine. I hope.

  10. #10
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Quote Originally Posted by Nebula View Post
    CurrentMap('map1', 'map2', 'map3') would return the map you are currently in. So you could just do SPS_Setup(#, [CurrentMap]) and it would work fine. I hope.
    I edited the above post.


    So:

    Simba Code:
    function CurrentMap(MY MAPS GO HERE?): String;
    var
      TempMap: TStringArray;
      i: Integer;
    begin
      for i := 0 to length(maps)-1 do
      begin
        SetLength(TempMap, 1);
        TempMap[1] := maps[i];
        SPS_Setup(3, TempMap);
        if not(SPS_GetMyPos = Point(-1, -1)) then
        begin
          result := TempMap[1];
          Exit;
        end;
      end;
    end;
    Do I change anything else?
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Bad™ before everyone gets laser pistols

  11. #11
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Help?
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Bad™ before everyone gets laser pistols

  12. #12
    Join Date
    Oct 2011
    Location
    UK
    Posts
    1,322
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Simba Code:
    function CurrentMap(maps: TStringArray): String;
    var
      TempMap: TStringArray;
      i: Integer;
    begin
      for i := 0 to length(maps)-1 do
      begin
        SetLength(TempMap, 1);
        TempMap[1] := maps[i];
        SPS_Setup(3, TempMap);
        if(SPS_GetMyPos <> Point(-1, -1)) then
        begin
          result := TempMap[1];
          Exit;
        end;
      end;
    end;

    Put that in your script with the other functions, then when put somewhere in your script:
    Simba Code:
    WriteLn(CurrentMap(['2_3', '4_4', '3_293']));//put whatever maps you are checking

    See if it gets the right one

  13. #13
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    Why did you change around some of the numbers in it KeepBotting?
    Just throw this between one of your functions:
    Simba Code:
    function CurrentMap(maps: TStringArray): String;
    var
      TempMap: TStringArray;
      i: Integer;
    begin
      for i := 0 to length(maps)-1 do
      begin
        SetLength(TempMap, 1);
        TempMap[0] := maps[i];
        SPS_Setup(0, TempMap);
        if not(SPS_GetMyPos = Point(-1, -1)) then
        begin
          result := TempMap[0];
          Exit;
        end;
      end;
    end;

    Then call SPS_Setup(0, [CurrentMap]) in your mainloop and it will detect which map you are in. Then just use SPS_BlindWalk to walk to wherever it is you want to go.
    Last edited by Nebula; 08-07-2012 at 02:44 AM.

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
  •