Results 1 to 8 of 8

Thread: Search zone help

  1. #1
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default Search zone help

    Hello hello!

    So I've been trying to solve a little problem with my red salamander script. There is a tree right next to the spot where the traps are laid that changes colors to mimic one of the shades of colors the ropes make when they are dropped. I've tried using TPA's, DTM's, and Bitmaps, but I can't ever get it to completely ignore the tree. An easy solution would be to just exclude the tree from the search area. The only problem with that is my character moves enough so that a static box would only ignore the tree when I'm in the far west spot. I then tried to vary the size of my box determined by where I was standing w/ ObjDTM in area, but this wasn't very accurate and would eventually stop working all together (I had it print the size of the box on the smart screen so I could see when it switched back and forth).

    I hope my problem makes sense. What I really need is to be able to recognize when I'm in the far east and when I'm in the far west and to change the search zone accordingly. Or to make it search within a circle instead as this would cut out a big trunk and/or all of the tree (it's in the corner so a box always picks it up)

    approx. West pic

    approx. East pic


    Any ideas? If you need more explanation please ask! The first version of the code is here: http://villavu.com/forum/showthread.php?t=75070

  2. #2
    Join Date
    Sep 2010
    Location
    Azeroth
    Posts
    395
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Default

    wait yor saying the color of that tree interfeers with the color of your traps? wouldent FilterPointsDist work as to recognizing the size of your traps, along with splittpa? im just guessing

  3. #3
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    Tough one ay. Well what I would do is probably run couple of tests with DDTMs.
    Although, the 'West pic' you uploaded Mini Map is cut off, so it is hard to tell if the white border is still showing or not.
    Maybe if you upload the MM for East/West, I can advice/suggest you how to use the DDTM.

  4. #4
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Quote Originally Posted by wantonman View Post
    wait yor saying the color of that tree interfeers with the color of your traps? wouldent FilterPointsDist work as to recognizing the size of your traps, along with splittpa? im just guessing
    Only the failed traps (ie when the ropes fall to the ground).
    The only problem is that sometimes the ropes get covered up by other traps and/or the tree. So only a small part of it on random sides is visible, making harder for it to find. I haven't tried filterpointsdist, but splittpa didn't work for me :/ could have done it wrong though


    Quote Originally Posted by P1nky View Post
    Tough one ay. Well what I would do is probably run couple of tests with DDTMs.
    Although, the 'West pic' you uploaded Mini Map is cut off, so it is hard to tell if the white border is still showing or not.
    Maybe if you upload the MM for East/West, I can advice/suggest you how to use the DDTM.
    Here are the minimaps
    Absolute farthest west pic:


    Absolute farthest east pic:


    I haven't tried messing with DDTM's yet! Thanks for both of yalls help though!

  5. #5
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Any ideas?

  6. #6
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    CountColor.. if the # of colours of the object found is bigger than the max colours of the little trees then it's the big tree, so remove it from the TPA.

    OR

    Use RaASTPA to leave one point for every object found.. once that done, just iterate through each point and check the uptext, if it doesn't say trap or whatever, then it's not the right one.. if it says the right uptext, do whatever.

    Code:
    Function FindTrees: boolean;
    begin
       FindColorsSpiralTolerance(......);
       if Length(TPA) < 1 then exit;
    
      RAaSTPAEx(TPA, W, H);  //width and height of the trap trees.
      for I:= 0 To High(TPA) do
      begin
         MMouse(TPA[I].X, TPA[I].Y, 0, 0);
         if waitUptext('whatever', 600) then
           ClickMouse2(MOUSE_LEFT);
      end;
    end;
    Meh.. can do the same with CountColors.. if the colours > around 100? then it's the big tree.. so ignore it.

    Or use those Minimap points.. yes the three light brown points. Do mmtoms with them, make a polygon shape with the MS points and search within that.
    I am Ggzz..
    Hackintosher

  7. #7
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Quote Originally Posted by ggzz View Post
    CountColor.. if the # of colours of the object found is bigger than the max colours of the little trees then it's the big tree, so remove it from the TPA.

    OR

    Use RaASTPA to leave one point for every object found.. once that done, just iterate through each point and check the uptext, if it doesn't say trap or whatever, then it's not the right one.. if it says the right uptext, do whatever.

    Code:
    Function FindTrees: boolean;
    begin
       FindColorsSpiralTolerance(......);
       if Length(TPA) < 1 then exit;
    
      RAaSTPAEx(TPA, W, H);  //width and height of the trap trees.
      for I:= 0 To High(TPA) do
      begin
         MMouse(TPA[I].X, TPA[I].Y, 0, 0);
         if waitUptext('whatever', 600) then
           ClickMouse2(MOUSE_LEFT);
      end;
    end;
    Meh.. can do the same with CountColors.. if the colours > around 100? then it's the big tree.. so ignore it.

    Or use those Minimap points.. yes the three light brown points. Do mmtoms with them, make a polygon shape with the MS points and search within that.
    Sorry I never responded, but I got it fixed! I ended up using 2 DTM's in the minimap (with the white dot in relation to the three brown points) for the two locations where I would want a bigger search zone. That seems to have done the trick. Thanks for pointing me in the right direction!

  8. #8
    Join Date
    Dec 2011
    Posts
    193
    Mentioned
    5 Post(s)
    Quoted
    51 Post(s)

    Default

    Quote Originally Posted by ashaman88 View Post
    Sorry I never responded, but I got it fixed! I ended up using 2 DTM's in the minimap (with the white dot in relation to the three brown points) for the two locations where I would want a bigger search zone. That seems to have done the trick. Thanks for pointing me in the right direction!
    I made a red salamander script for the same location there. I believe I just sorted the TPA into ATPA's, then filtered out any ATPA that weren't between 2 lengths, those 2 lengths would be found by checking the lengths of the Tree ATPA's from all angles, then using the lowest and highest lengths, with say 10% added either way.

    Got 90 hunter off it for effigies.

    OSRS Color Scripts: Borland_Salamanders | Borland_Iron_Ores
    Utilities & Snippets: [Color] OSBuddy Item Looting

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
  •