Results 1 to 7 of 7

Thread: Need help with a function?

  1. #1
    Join Date
    Feb 2012
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Red face Need help with a function?

    How would I write a function that would check to see if an npc is currently in combat or not? Please help because for the life of me can not seem to figure it out.



  2. #2
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    When you found the coordinates of the npc, check if the colors of a health bar can be found above it.
    Working on: Tithe Farmer

  3. #3
    Join Date
    Feb 2012
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

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

    Default

    This function returns the location of all the HP bars on screen, you could use it to find an NPC without one...
    Simba Code:
    Function ReturnHPBars : array of TPoint;
    Var
      P1, P2 : array of TPoint;
      RedOnRight, AllGreen : integer;
    begin

      RedOnRight := DTMFromString('m6wAAAHic42ZgYDgHxJux4FdYcA0QVwFxNZRdC8R1OMSs2ZkYGDQYMDBIHB3/ZyAeMJKAkQAATQ0RqQ==');
      AllGreen := DTMFromString('m6wAAAHic42ZgYDgHxJux4FdYcA0QVwFxNZRdC8R1OMSs2ZkYGDQYiML/GYgHjCRgJAAAD8gRHQ==');
      FindDTMs(RedOnRight, P1, MSX1, MSY1, MSX2, MSY2);
      FindDTMs(AllGreen, P2, MSX1, MSY1, MSX2, MSY2);
      CombineTPAWrap(P1, P2, Result);
      FreeDTM(RedOnRight);
      FreeDTM(AllGreen);

    end;

  5. #5
    Join Date
    Feb 2012
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you so much, do I have permission to add this to my script?

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

    Default

    Quote Originally Posted by Joepetey View Post
    Thank you so much, do I have permission to add this to my script?
    Of course if you want to credit me then feel free but it's quite simple so I won't be bothered, if you apply for SRL members with it some people might be bothered if you don't credit it

  7. #7
    Join Date
    Feb 2012
    Posts
    61
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

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
  •