Results 1 to 15 of 15

Thread: How can I know if player is standing in a tile, and how can I walk to that tile..

  1. #1
    Join Date
    Feb 2012
    Location
    Portugal
    Posts
    91
    Mentioned
    3 Post(s)
    Quoted
    41 Post(s)

    Question How can I know if player is standing in a tile, and how can I walk to that tile..

    I wanna be able to check if I am, imagige in the tile with the coordinates of 1092, 2091, 0.
    How would be the best way to do this in RS3? If its is through reflection I would like if someone could help me with the hook and multiplier I have to search for

    And another question, is this the best way to walk in a screen tile?
    Like I wanna get to a tile that is on screen by click it, can I click this point?
    NMPD4HQ.png

    Thank you very much,
    PatriqDesigns

  2. #2
    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 PatriqDesigns View Post
    I wanna be able to check if I am, imagige in the tile with the coordinates of 1092, 2091, 0.
    How would be the best way to do this in RS3? If its is through reflection I would like if someone could help me with the hook and multiplier I have to search for

    And another question, is this the best way to walk in a screen tile?
    Like I wanna get to a tile that is on screen by click it, can I click this point?
    NMPD4HQ.png

    Thank you very much,
    PatriqDesigns
    There is currently no way to walk to MM 'tiles' in SRL6. There is no reflection.

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

    Default

    SRL-6 doesn't use reflection. You'll have to use SPS-RS3 for walking.
    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
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

    Default

    MM to MS projection is the best way, you could search for player dots, form a search box on the mainscreen around the dot's location, check for certain colors, make a decision whether to walk or not.

  5. #5
    Join Date
    Feb 2012
    Location
    Portugal
    Posts
    91
    Mentioned
    3 Post(s)
    Quoted
    41 Post(s)

    Default

    Quote Originally Posted by Clarity View Post
    MM to MS projection is the best way, you could search for player dots, form a search box on the mainscreen around the dot's location, check for certain colors, make a decision whether to walk or not.
    And how would I know in which tile my player is standing in?

  6. #6
    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 PatriqDesigns View Post
    And how would I know in which tile my player is standing in?
    It is possible to check that your player is on a (x, y) point using SPS. The x or y coordinates might be accurate to +/- 3 pixels so it probably better to check that your player is inside a box.

    Say I had a SPS map already setup. If I wanted to check that my player was inside this mine, I could get the coordinates to make the box (from my SPS map). Let's say the top left and bottom right points of the box were:



    If I wanted to check that my player was inside this box, I could use SPS.getPlayerPos() which returns a TPoint of where your player currently is on your SPS map. You can then check if that point is inside your box.

    Simba Code:
    function isInsideBox(): boolean;
    var
      pos: TPoint;
      mineBox: Tbox;
    begin
      mineBox := intToBox(100, 100, 200 200);
      pos := SPS.getPlayerPos();

      result := pointInBox(pos, mineBox);
    end;

  7. #7
    Join Date
    Feb 2012
    Location
    Portugal
    Posts
    91
    Mentioned
    3 Post(s)
    Quoted
    41 Post(s)

    Default

    I need an exact tile and not an area, that point is not an exact world point right? Is a point relative to the top left corner, which is not what im looking for ;(

  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 PatriqDesigns View Post
    I need an exact tile and not an area, that point is not an exact world point right? Is a point relative to the top left corner, which is not what im looking for ;(
    It's going to be really, really hard to walk to an exact tile in RS3 without using reflection (which doesn't exist).

    I suppose you could just make a really small box, but I'm not sure how SPS would handle that.

    Maybe if you post the general process your script is trying to accomplish, we can help you think of other ways
    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
    Feb 2012
    Location
    Portugal
    Posts
    91
    Mentioned
    3 Post(s)
    Quoted
    41 Post(s)

    Default

    The problem isnt walking since I can get a point to click with the TRSMinimap.pointToMainscreen function. What im struggling to know is how do i know if my player is standing on her. Well if I dont ever change the camera angle I dont know if I could use dtm's. Damm this is so hard.

  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 PatriqDesigns View Post
    The problem isnt walking since I can get a point to click with the TRSMinimap.pointToMainscreen function. What im struggling to know is how do i know if my player is standing on her. Well if I dont ever change the camera angle I dont know if I could use dtm's. Damm this is so hard.
    Look into DDTMS, never used them myself but they might work.
    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
    Feb 2012
    Location
    Portugal
    Posts
    91
    Mentioned
    3 Post(s)
    Quoted
    41 Post(s)

    Default

    Quote Originally Posted by KeepBotting View Post
    Look into DDTMS, never used them myself but they might work.
    Are they different than normal DTM's? They just seem to be more user friendly, so later you can change colours and tolerance..

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

    Default

    Quote Originally Posted by PatriqDesigns View Post
    Are they different than normal DTM's? They just seem to be more user friendly, so later you can change colours and tolerance..
    They're a bit different. Where DTMs are deformable template models, DDTMs are dynamic deformable template models. They can autocolor themselves, among other things

    check this out http://garrettlongonline.com/tutorial it has a DDTM section
    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

  13. #13
    Join Date
    Feb 2012
    Location
    Portugal
    Posts
    91
    Mentioned
    3 Post(s)
    Quoted
    41 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    It is possible to check that your player is on a (x, y) point using SPS. The x or y coordinates might be accurate to +/- 3 pixels so it probably better to check that your player is inside a box.

    Say I had a SPS map already setup. If I wanted to check that my player was inside this mine, I could get the coordinates to make the box (from my SPS map). Let's say the top left and bottom right points of the box were:



    If I wanted to check that my player was inside this box, I could use SPS.getPlayerPos() which returns a TPoint of where your player currently is on your SPS map. You can then check if that point is inside your box.

    Simba Code:
    function isInsideBox(): boolean;
    var
      pos: TPoint;
      mineBox: Tbox;
    begin
      mineBox := intToBox(100, 100, 200 200);
      pos := SPS.getPlayerPos();

      result := pointInBox(pos, mineBox);
    end;
    Does sps has a function like MM to MS? So I can get the point on the screen, opr maybe a fucntion to turn the point im looking in sps, to minimap coordinates?

  14. #14
    Join Date
    Feb 2012
    Location
    Portugal
    Posts
    91
    Mentioned
    3 Post(s)
    Quoted
    41 Post(s)

    Default

    Well since no one replied I try my hardest to find a solution and here it is. With this snippet people will be able to walk to tiles using screen points and will be able to check if they are in a tile, that is in a sps map. In other words, if you have the sps point of your tile you can check if you are standing on her or walk to her if she is on screen!

    Simba Code:
    program Test;

    {$DEFINE SMART}
    {$i srl-6/srl.simba}
    {$i sps\lib\sps-rs3.simba}

    var
      t : TPoint;


    function spsToMainscreen(spsPoint : TPoint) : TPoint;
    var
      minimapPoint, p, vector : TPoint;
      box : TBox;
    begin
      vector.X := minimap.getCenterPoint.X-sps.getPlayerPos.X;
      vector.Y := minimap.getCenterPoint.Y-sps.getPlayerPos.Y;

      minimapPoint.X := spsPoint.X+vector.X;
      minimapPoint.Y := spsPoint.Y+vector.Y;

      result := minimap.pointToMainscreen(minimapPoint);
      result.Y := result.Y+8;
    end;

    function inTile(spsPoint : TPoint) : boolean;
    var
      box : TBox;
    begin
      box := mainscreen.playerBox;
      box.edit(0,10 ,0 ,-10);
      result := box.isPointInside(spsToMainscreen(spsPoint));
    end;

    function walkTile(spsPoint : Tpoint) : boolean;
    var
      p : TPoint;
      //box : TBox;
    begin
      if not(inTile(spsPoint)) then
      begin
        p := spsToMainscreen(spsPoint);
        if mainScreen.getBounds().isPointInside(p) then
        begin
          //box.setBounds(p.X-3, p.Y, p.X+3, p.Y+3);
          //mouseBox(box);
          mouse(p);
          fastClick(MOUSE_LEFT);
          repeat
            wait(250);
          until not(minimap.isPlayerMoving);
        end;
      end;
      result := inTile(spsPoint);
    end;

    procedure start();
    begin
      sps.setup('MAP_01', RUNESCAPE_SURFACE);
      t := Point(298, 302);
      smartImage.clear;
    end;

    procedure loop();
    begin
      writeln(walkTile(t));
    end;

    procedure poll();
    var
      minimapPoint, p, vector : TPoint;
      box, b : TBox;
    begin
      vector.X := minimap.getCenterPoint.X-sps.getPlayerPos.X;
      vector.Y := minimap.getCenterPoint.Y-sps.getPlayerPos.Y;

      minimapPoint.X := t.X+vector.X;
      minimapPoint.Y := t.Y+vector.Y;

      p := minimap.pointToMainscreen(minimapPoint);
      box.setBounds(p.X-3, p.Y-3, p.X+3, p.Y+3);

      smartImage.drawBox(box, false, clRed);
      b := mainscreen.playerBox;
      B.edit(0, 15, 0, -10);
      smartImage.drawBox(b, false, clRed);
    end;

    procedure stop();
    begin
    end;

    begin
      smartEnableDrawing := true;
      setupSRL();

      start();

      while true do
      begin
        //poll();
        loop;
      end;
    end.

  15. #15
    Join Date
    Feb 2012
    Location
    Portugal
    Posts
    91
    Mentioned
    3 Post(s)
    Quoted
    41 Post(s)

    Default

    I need a better walk method, I would love if someone could join forces with me and help doing the dream come true, pm me

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
  •