Results 1 to 15 of 15

Thread: Need help with the Grid System

  1. #1
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default Need help with the Grid System

    Fist I'm wanting to know if anyone knows of a detailed tut on the Grid System and MMToMS?

    What I'm trying to do is, first find multiple points on the MS using a standard colorTPA finding function. The points it finds, I want to transfer to the middle of each grid box it's found in. How accurate are the grid boxes in accordance with the landscape grid. For example lets say I'm standing at point, and I want to click the middle of the landscape square exactly 4 squares over to my right. Can I do this and it will click the exact spot every time.

    I'm basically wanting to build a grid on the rs main screen , then search for fishing spots and put each spot it finds into a single grid box. I can then tell it to move the mouse to the middle of each grid box it found a fishing spot in and check it's uptext, etc.

    Any help with learning the use of the grid system would be greatly appreciated. I do believe I know the Grid system was made for comparing MM objects to the main screen, but can it also be used to separate the actual runescape floor tiles accurately?
    Not scripting for RS anymore, sorry. Banned too many times.
    MY SCRIPTS

  2. #2
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    I'd be interested on a Tut for this as well :P I believe we are waiting on a update for MMToMS right?

  3. #3
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    Quote Originally Posted by SRLKing View Post
    I'd be interested on a Tut for this as well :P I believe we are waiting on a update for MMToMS right?
    I've read some posts it works fine and others saying it's bugged so I'm not sure. But what I'm trying to do will pull nothing from the MM. I will just build a grid in accordance with the actual runescape floor tiles. Using the MM and/or the compass to get it's bearing.(Facing true north or east, etc.)
    Not scripting for RS anymore, sorry. Banned too many times.
    MY SCRIPTS

  4. #4
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    You won't get accurate tiles with just color unless you implement something to find the screen angle (don't confuse with compass angle). Nonetheless, MMToMS is still fairly accurate when implemented correctly and probably results in a max of approx. 1 tile off the one you want, so pretty decent still at worst.

  5. #5
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    How would I build a grid like this then? I used paint to do this. I have no idea how, lol. I'm not asking to do it for me but I don't even know were to begin. And the boxes would move in accordance to my angle. So at a 45 degree angle The boxes would be diamonds instead. I figured it could use the color of the pier to set the outline of the grid. For example we know the pier to be:


    Simba Code:
    // pier
                box - box - box - box - box - box
                box - box - box - box - box - box
                box - box
                box - box
    box - box - box - box - box - box - box - box
    box - box - box - box - box - box - box - box



    Would it be something like finding a DTM? but instead of points it looks for the boxes. And in the boxes it looks for maybe so many pixels to match for it to be confirmed as an actual part of the pier.
    Last edited by bud_wis_er_420; 02-16-2013 at 04:04 AM.
    Not scripting for RS anymore, sorry. Banned too many times.
    MY SCRIPTS

  6. #6
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Well, in color, you'd be preforming a lot more (in my opinion) actions than need be. If you use ACA and grab some nice col's for the fish spots, you could combine those with some strong object finding/filtering functions, in turn accomplishing what you want at a fraction of the work. What would be the purpose of boxing the immediate dock and the first tile away from each dock tile?

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

    Default

    you would never get good tiles, the rs screen rotates/zooms alot more than you think

  8. #8
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    Quote Originally Posted by Le Jingle View Post
    Well, in color, you'd be preforming a lot more (in my opinion) actions than need be. If you use ACA and grab some nice col's for the fish spots, you could combine those with some strong object finding/filtering functions, in turn accomplishing what you want at a fraction of the work. What would be the purpose of boxing the immediate dock and the first tile away from each dock tile?
    Already doing this, Was trying to make things more accurate.

    Quote Originally Posted by Ollybest View Post
    you would never get good tiles, the rs screen rotates/zooms alot more than you think
    What if we made the tiles adjustable. Like with a range limit. For example, just look at the first row there are 6 boxes. I don't know the actual pixel length of each box but lets say it around 50, with a plus/minus of 5. So each box it approximately 50 by 50 pixels but can be a bit smaller or bigger depending on the zoom. The rotation shouldn't matter. Thats the point of the function. The boxes would follow the rotation. Like the pic below.

    Anyways the boxes are 50 X 50 with a range or 5. So if I find, 6 boxes in a row or one solid strip(like using find color area) around the range of
    6 * 50 = 300 pixes
    +/- 5 * 6 = 30
    total 270 - 330. if found it ould get the width of found strip of collor, lets say it came out as 312. We would divide this by 6 to get the actual box size.

    Now you do this for all row just like finding a DTM. If all boxes match we can use this info to build a grid

    the pier is a fixed structure. It should be easy to build a grid around it. I'm just learning how to even print a grid let alone alining one up to color pts.

    Last edited by bud_wis_er_420; 02-16-2013 at 04:57 AM.
    Not scripting for RS anymore, sorry. Banned too many times.
    MY SCRIPTS

  9. #9
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    it's not as simple as adding a range to the box sizes... It's more a case of knowing the camera depth, camera angle, and the easy part of compass direction (found easily via the compass). Without accurate functionality with all three of those components, you won't be able to achieve near accurate (more so generalized approximates via MMToMs) results. I iterate again, however, to create an object function to detect desired MainScreen objects. Unless you're trying to pick up items from the floor, or find nearby npc's/players, or looking for MMToMS specific search related influential objects, I'd avoid trying to implement MMToMS as it won't generate as much as a tile system would in other bot clients.

    Edit, Also, to help point you into my intended direction as described earlier about object finding, I'd suggest looking into some of Runaway's old object search functions, or perhaps looking through popular scripts (I think superuser has a quality object finding method in his miner), and learning from what those have to offer. There are also nifty scripts that detect fish spots (perhaps @Flight; might be able to offer insight too :] ), so learning from what these other scripts look for, and breaking down what logic resides behind the code for object finding, can result in desired precision object finding such as detecting fish spots.

    Pardoning myself, I indeed wish you success, granted I'm still somewhat hazy on what you're trying to accomplish aside from charting the RS main screen into boxes.
    Also, I'd still love to help in any way I can granted your further request.

    Ciao,
    Lj
    Last edited by Le Jingle; 02-16-2013 at 05:37 AM.

  10. #10
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    Quote Originally Posted by Le Jingle View Post
    it's not as simple as adding a range to the box sizes... It's more a case of knowing the camera depth, camera angle, and the easy part of compass direction (found easily via the compass). Without accurate functionality with all three of those components, you won't be able to achieve near accurate (more so generalized approximates via MMToMs) results. I iterate again, however, to create an object function to detect desired MainScreen objects. Unless you're trying to pick up items from the floor, or find nearby npc's/players, or looking for MMToMS specific search related influential objects, I'd avoid trying to implement MMToMS as it won't generate as much as a tile system would in other bot clients.

    Edit, Also, to help point you into my intended direction as described earlier about object finding, I'd suggest looking into some of Runaway's old object search functions, or perhaps looking through popular scripts (I think superuser has a quality object finding method in his miner), and learning from what those have to offer. There are also nifty scripts that detect fish spots (perhaps @Flight; might be able to offer insight too :] ), so learning from what these other scripts look for, and breaking down what logic resides behind the code for object finding, can result in desired precision object finding such as detecting fish spots.

    Pardoning myself, I indeed wish you success, granted I'm still somewhat hazy on what you're trying to accomplish aside from charting the RS main screen into boxes.
    Also, I'd still love to help in any way I can granted your further request.

    Ciao,
    Lj
    Thx for the info. But that's it I was just experimenting. Seeing if it was at all possible to chart, as you say, the rs screen using something large and easily defined against the area around it. Like the pier I used as an example with brown colors and the water that surrounds it as blue. I thought it would be an easy thing to build a grid on it and be able to tell exactly what tile I'm on on the rs screen.

    I'll get a pic of something I saw similar in another script. Gimme just a sec...

    This is from the PreemptibleRuneSpan.4.1.43 script it outlines the borader of the island on the MM. I'm trying to do kinda the same thing but with bigger boxes and on the Main screen.
    Last edited by bud_wis_er_420; 02-16-2013 at 06:03 AM.
    Not scripting for RS anymore, sorry. Banned too many times.
    MY SCRIPTS

  11. #11
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    I still wondering if this is possible?

    Also I have another question.

    How would I search in a TBox area for colors but I want to disregard TP's within one square of my char. So I search for colors and get a TPA then I go through the array and remove points within a certain point range.
    Not scripting for RS anymore, sorry. Banned too many times.
    MY SCRIPTS

  12. #12
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Simba Code:
    var
      playerTPAtoClear : TPointArray;
    begin
      // ... stuff
      playerTPAtoClear := TPAFromBox(IntToBox(242, 152, 268, 239-50)); // box of our player on the MainScreen

      // this will take theGatheredTPA, delete from it the playerTPAtoClear, and then give back the theGatheredTPA minus the (if any) playerTPAtoClear that we wanted removed
      ClearTPAFromTPAWrap(theGatheredTPA, playerTPAtoClear, theGatheredTPA);

  13. #13
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    Quote Originally Posted by Le Jingle View Post
    Simba Code:
    var
      playerTPAtoClear : TPointArray;
    begin
      // ... stuff
      playerTPAtoClear := TPAFromBox(IntToBox(242, 152, 268, 239-50)); // box of our player on the MainScreen

      // this will take theGatheredTPA, delete from it the playerTPAtoClear, and then give back the theGatheredTPA minus the (if any) playerTPAtoClear that we wanted removed
      ClearTPAFromTPAWrap(theGatheredTPA, playerTPAtoClear, theGatheredTPA);

    Thx alot M8!!
    Not scripting for RS anymore, sorry. Banned too many times.
    MY SCRIPTS

  14. #14
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    Ok one more. Same as before but now I need to remove a string from an array?

    Is there a list of the array functions somewhere?


    Edir:

    I think I figured it out. But I know there is got to be a shorter way?
    Simba Code:
    ItemsToKeep := ['cod', 'bass'];

      ItemList := ['shark', 'lobster', 'swordfish', 'cod', 'bass', 'mackerel',
      'boots', 'gloves', 'seaweed', 'casket', 'oyster'];
      c := 0;
      for i := 0 to High(ItemList) do
      begin
        add := false;
        for j := 0 to High(ItemsToKeep) do
        begin
          if (ItemsToKeep[j] = ItemList[i]) then
            add := true;
        end;
        if (add = true) then
          DropList[c] := ItemList[i];
          inc(c)
      end;
    Last edited by bud_wis_er_420; 02-16-2013 at 11:32 PM.
    Not scripting for RS anymore, sorry. Banned too many times.
    MY SCRIPTS

  15. #15
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    We'll, when dropping, you could compare the found text against the itemsToKeep, and say, if the found text during runtime does not match elements in your itemstokeep string array, then to drop w/e item that is found. This may or may not be ideal for what you are writing, but it would offer less checking to be carried out while still accomplishing the goal of keeping the wanted items and disposing of the unwanted items.

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
  •