Results 1 to 23 of 23

Thread: Ent Finding

  1. #1
    Join Date
    Apr 2007
    Location
    The Buckeye State
    Posts
    482
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Ent Finding

    Well, in hope of improving my pretty much non-working Ent finding procedure. The basic idea of how i would like this to work (along with some suggestions from SmartzKid) is this:

    1. The script selects a group of pixels from a tree (3x3, doesnt really matter).
    2. The script waits a time.
    3. The script checks to see if the a certain percentage (for an example, 70%) of pixels have moved from their original position the script stored them at. If 100% of the pixels have moved, the script concludes that it was the compass that moved.
    4. It waits another amount of time.
    5. If the pixels have moved a third time, the script will conclude that the moving pixels are those of an ent.

    Obviously, this is complicated, and i'm going to need some walking through this as i put it all together. Is anyone willing to guide me through making this procedure?

    -Esteban
    I like my coffee black just like my metal.

  2. #2
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Lorax and Sumilion's VYC (pay script) does this. You might want to talk to Lorax about this.

    Oh, and use a TPointArray and a TIntegerArray for the colors and points.

  3. #3
    Join Date
    Oct 2006
    Location
    Ireland
    Posts
    855
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Would it not just be easier to check the color of the uptext on the tree?

  4. #4
    Join Date
    Apr 2007
    Location
    The Buckeye State
    Posts
    482
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thats what i have done, it doesn't really work all too well for me =\.
    I like my coffee black just like my metal.

  5. #5
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well, when you move your mouse to an ent, the uptext is yellow. This is how FindEnt; in SRL does. If your mouse wasn't on the tree, you get screwed.

    Your idea is pretty cool. Perhaps, try something with DDTM's? Make the parent point somewhere where the arm doesn't swing on it, and omit the correct pixels.. :S

  6. #6
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    what if the tree got chopped down though then all of the colors would change

  7. #7
    Join Date
    Apr 2007
    Location
    The Buckeye State
    Posts
    482
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    like i said, if 100% of the pixel move(the being chopped down), the script would recognize that the compass moved (or the tree is gone) and would continue chopping.
    I like my coffee black just like my metal.

  8. #8
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by jhildy View Post
    what if the tree got chopped down though then all of the colors would change
    For that part you could also have a no tree detection. Track the tree while the Flag is up save the color pixel, check every second if the pixel is still there in a small box. If not then tree is gone.

  9. #9
    Join Date
    Apr 2007
    Location
    The Buckeye State
    Posts
    482
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Could you explain that a bit more, Shadow? I was planning of having a Is-The-Tree-Gone checker anyways, might as well have an understanding of how one works now anyways.
    I like my coffee black just like my metal.

  10. #10
    Join Date
    Apr 2007
    Location
    Laguna Beach, California
    Posts
    231
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That's kind of like what i'm doing for my find ent procedure. First I track the tree while a flag is present:

    SCAR Code:
    function UpdateXY:boolean;
    begin
      while (FlagPresent) do
        begin
          if (FindColorSpiralTolerance(x, y, TreeColor[0], x - 10, y - 10, x + 10, y + 10, 3))
          or (FindColorSpiralTolerance(x, y, TreeColor[1], x - 10, y - 10, x + 10, y + 10, 3))
          or (FindColorSpiralTolerance(x, y, TreeColor[2], x - 10, y - 10, x + 10, y + 10, 3)) then
            Wait(50+random(10)) else
            result := false;
        end;
      Wait(50);
      if (FindColorSpiralTolerance(x, y, TreeColor[0], x - 15, y - 15, x + 15, y + 15, 3))
      or (FindColorSpiralTolerance(x, y, TreeColor[1], x - 15, y - 15, x + 15, y + 15, 3))
      or (FindColorSpiralTolerance(x, y, TreeColor[2], x - 15, y - 15, x + 15, y + 15, 3)) then
        begin
          result := true;
        end else
        if (FindColorSpiralTolerance(x, y, TreeColor[0], x - 30, y - 30, x + 30, y + 30, 3))
        or (FindColorSpiralTolerance(x, y, TreeColor[1], x - 30, y - 30, x + 30, y + 30, 3))
        or (FindColorSpiralTolerance(x, y, TreeColor[2], x - 30, y - 30, x + 30, y + 30, 3)) then
        begin
          result := true;
        end else
          result := false;
    end;

    Then my find ent procedure has coordinates to go off of to look for the tree colors. Except my find ent is triggered by a yellow npc dot showing up on the mm. (ents count as monsters therefore they show up on the mm as yellow dots) Then it moves to the x, y coordinates that were updated in the above function. If the up text is not the tree up text then it searches in a box around the x, y coords for the trees color moves the mouse to that point and checks the up text. With the correct up text it then searches for the yellow text and avoids the ent.

    Here is the function, it is still not done:
    SCAR Code:
    function MyFindEnt:boolean; //looks for yellow npc dot color close to player
    var                         //  indicating an ent then searches for yellow text
      I:integer;
    begin
      if (not (FindColor(x, y, 195836, MMCX - 12, MMCY - 12, MMCX + 12, MMCY + 12))) then
        Result := False;
      if (FindColor(x, y, 195836, MMCX - 12, MMCY - 12, MMCX + 12, MMCY + 12)) then
        begin
          if (FindNormalRandoms) then
            Exit;
          WriteLn('Found a yellow dot next to us...It might be an ent.');
          MMouse(x, y, 2, 2);
          if (not(IsUpText(TreeText))) then
            begin
              for I := 0 to 2 do
                begin
                  if (FindColorSpiralTolerance(x, y, TreeColor[I], x-30, y-30, x+30, y+30, 7)) then
                    begin
                      MMouse(x, y, 1, 1);
                      if (IsUpText(TreeText)) then
                        Break;
                    end;
                end;
            end;
          if (FindColorTolerance(x, y, 55769, 85, 15, 115, 15, 15)) then
            begin
              WriteLn('Found ENT!!! Avoiding it now.');
              Mouse(MSCX, MSCY, 2, 2, true);
              EntsAvoided := EntsAvoided + 1;
              Result := True;
              repeat
                MarkTime(Mark);
                Wait(500+random(500));
              until (not (FindColor(x, y, 195836, MMCX-12, MMCY-12, MMCX+12, MMCY+12)))
                or (TimeFromMark(Mark) > 25000);
            end else
            begin
              WriteLn('Did not find an ent. It might have been an impling or ' +
                'another players random. Worst case: we have a broken axe. :(');    // <---- Add in procedure to find broken axe dtm
            end;
        end;
    end;

  11. #11
    Join Date
    Apr 2007
    Location
    The Buckeye State
    Posts
    482
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    why do you track the tree?
    I like my coffee black just like my metal.

  12. #12
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Esteban View Post
    why do you track the tree?
    The tree on the mainscreen moves after you click it. Like you click, and then as you move towards it the tree coords are changing from the original click position.

    Think of it, as Updating the coordinates, until the Flag is no longer present (which means the tree will no longer move...).

    Hope that helps?

  13. #13
    Join Date
    Apr 2007
    Location
    The Buckeye State
    Posts
    482
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I think i understand how everything of yours works, mark. But i think there is a problem in it, the x and y coords used to track the tree, aren't those overwritten in finding the ent?
    I like my coffee black just like my metal.

  14. #14
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Esteban View Post
    I think i understand how everything of yours works, mark. But i think there is a problem in it, the x and y coords used to track the tree, aren't those overwritten in finding the ent?
    Use different variables then.. ? ;}

  15. #15
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by ~alex~ View Post
    Would it not just be easier to check the color of the uptext on the tree?
    Thats what i do, and it works for me..

  16. #16
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by itschris917 View Post
    Thats what i do, and it works for me..
    In order to check the uptext of the tree, you'd have to know where the tree is so you could move your mouse there? Unless of course you plan to just check once before clicking the tree and risking your axe whilst chopping.

    That is why you update coords. :]

  17. #17
    Join Date
    Apr 2007
    Location
    Laguna Beach, California
    Posts
    231
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I use the same variables but when i call for the ent finding procedure i exit my tree cutting loop and restart it from the beginning.

  18. #18
    ronny.m.p Guest

    Default

    Nice idea. I will see about putting some functions together for it. However, this ent function is made by me and works perfect everytime sp maybe you should check it out?

    FindEnt :
    SCAR Code:
    function FindTreeEnt : boolean;
    begin
      if Isuptext('own')then
        begin
          If FindColorSpiralTolerance(x, y, 55769, 85, 15, 115, 15, 20)then
            begin
              Result:= True;
              Writeln('Found Ent');
              EntsAvoided:= EntsAvoided + 1;
            end;
        end;
    end;

    And evade it with this (function not orrigionaly by me) :
    SCAR Code:
    Procedure EvadeEnt;
    Var
      First : Integer;
    Begin
      First := MouseSpeed;
      MouseSpeed := 3;
      Mouse(647,131,5,5,true)
      Flag;
      MouseSpeed := First;
    End;

  19. #19
    Join Date
    Jan 2007
    Posts
    117
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    There is a good ent finding procedure by Fourscape and YoHoJo... It uses findobjmultitext (then findcolortollerance for the yellow text), so there is a chance that it will not check the tree you are chopping.. very unlikely though. Seems to have worked well in the script ive made.

  20. #20
    Join Date
    Apr 2007
    Location
    The Buckeye State
    Posts
    482
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Heh, well ronny, that's pretty much (i believe) what SRL's FindEnt does, and pretty much what i have, but who knows, maybe yours special
    I like my coffee black just like my metal.

  21. #21
    Join Date
    Jan 2007
    Posts
    117
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I think fourscape's is slightly different to srl's and certainly seems to work. I edited it for use in my own script by using:
    SCAR Code:
    FindObjEx(EX, EY, 'illow', Ax - 50, Ay -50, Ax + 50, Ay + 50, Colour1, 4, 0, 0, 0, true

    where Ax and Ay are the coordinates of the tree which has been found- seems to work really well, incase u havnt already come up with a solution.

  22. #22
    Join Date
    Feb 2006
    Location
    London, England
    Posts
    2,045
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    I quite like your idea actually, and it could easily be done by comparing canvases.

    Take a snapshot of a certain part of the tree, wait a bit, and then take another snapshot, then compare how much the colors have changed.

    Problems include: Random map rotations from Jagex, the tree being cut down and all colors changing.
    SRL Wiki | SRL Rules | SRL Stats
    Ultimate SCAR Scripting Tutorial | Starblaster100's Auth System | Join the official SRL IRC now!


    Help Keep SRL Alive! Please disable Advert Blockers on SRL! Help Keep SRL Alive!


  23. #23
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    sorry for grave digging:
    http://www.villavu.com/forum/showthread.php?t=14503

    just created this

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Finding an NPC... I Need Help!
    By mormonman in forum OSR Help
    Replies: 9
    Last Post: 12-06-2008, 05:36 AM
  2. Replies: 3
    Last Post: 09-23-2008, 03:37 AM
  3. Gas finding help
    By Lancelot074 in forum OSR Help
    Replies: 9
    Last Post: 03-01-2008, 10:00 PM
  4. I need help with ENT finding
    By TravisV10 in forum OSR Help
    Replies: 23
    Last Post: 07-05-2007, 08:27 AM
  5. help with ent finding
    By Adamb_135 in forum OSR Help
    Replies: 4
    Last Post: 04-18-2007, 02:14 AM

Posting Permissions

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