Results 1 to 13 of 13

Thread: Method to detect if fighting.

  1. #1
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default Method to detect if fighting.

    At the moment i use InFight, but it gives false results when there are others fighting near me. Should i use PixelShift?

    Any other ideas how to detect if in fight? Thanks in advance
    There used to be something meaningful here.

  2. #2
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

  3. #3
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by TRiLeZ View Post
    Check for hp bar right above your head.
    I have not checked what InFight does but i thought it does that. Well thanks for the idea
    There used to be something meaningful here.

  4. #4
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    I have not checked what InFight does but i thought it does that. Well thanks for the idea
    InFight looks for the hp bar in a big area. What I'm saying to do is look for the hp bar in a really small area. Hmm.. I may make a new InFight function...

  5. #5
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by TRiLeZ View Post
    InFight looks for the hp bar in a big area. What I'm saying to do is look for the hp bar in a really small area. Hmm.. I may make a new InFight function...
    I just checked and my area only differs few pixels.

    The box i got just now: (225, 120, 290, 145)
    And the box in InFight: (200, 130, 280, 180)
    There used to be something meaningful here.

  6. #6
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    It seems odd that SRL's current InFight wouldn't just search a box above your char's head. Hmmm..


    You could try out some Animation.scar functions though
    Last edited by NCDS; 02-07-2010 at 09:30 AM.

  7. #7
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by NCDS View Post
    It seems odd that SRL's current InFight wouldn't just search a box above your char's head. Hmmm..


    You could try out some Animation.scar functions though
    Yes, pixelshift is my next thing to try out. If i dont get out a working function from the HP bar. I cant seem to get my CountColor to work properly, and CountColorTolerance doesnt either. Returns 0 even if i check with the colorpicker that theres that color.
    There used to be something meaningful here.

  8. #8
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    Yes, pixelshift is my next thing to try out. If i dont get out a working function from the HP bar. I cant seem to get my CountColor to work properly, and CountColorTolerance doesnt either. Returns 0 even if i check with the colorpicker that theres that color.
    That's odd..assuming you have everything up to date, try restarting everything.

    Color counting is usually my "go to" method as well

  9. #9
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Still wont work properly, here are the colors im using:
    SCAR Code:
    9984 //Green outline 1
    10496 //Green outline 2
    198716 //Red outline 1
    All counts combined should result in 90+.
    There used to be something meaningful here.

  10. #10
    Join Date
    Feb 2009
    Posts
    1,447
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

  11. #11
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by TRiLeZ View Post


    Search for hp bar colors in that box. Don't count colors though.
    Yeah great idea, this is what i came up with:
    SCAR Code:
    function F_InFight: Boolean;
    var x, y: Integer;
    begin
    Result := False;
      if ( FindColorTolerance( x, y, 49499, 258, 137, 272, 164, 2 ) ) then
        Result := True;
    end;
    Works 100%

    EDIT: Restarted scar etc and now it stopped working. Whats going on with my color finding functions
    EDIT2: The search area must be wider because the hits get on the way.

    EDIT3: This is the final function, works good (now that my color finding works lol).
    SCAR Code:
    function F_InFight: Boolean;
    var x, y: Integer;
    begin
      Result := FindColorTolerance( x, y, 49499, 226, 118, 262, 147, 40 );
    end;
    Last edited by Frement; 02-07-2010 at 02:59 PM.
    There used to be something meaningful here.

  12. #12
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    By "color counting" findcolor... Is what I meant. Just seemed easier to explain then the feared TPA . Also
    you may want to have an amount to compare it to. Currently it will return true if it finds that color at all. Where as if you put result := findcolor() > 30;
    that would mean that if it finds the color on more than 30 pixels in your search box it will result true. It's just sort of a failsafe. Play with that a bit.
    Last edited by NCDS; 02-07-2010 at 03:15 PM.

  13. #13
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by NCDS View Post
    By "color counting" findcolor... Is what I meant. Just seemed easier to explain then the feared TPA . Also
    you may want to have an amount to compare it to. Currently it will return true if it finds that color at all. Where as if you put result := findcolor() > 30;
    that would mean that if it finds the color on more than 30 pixels in your search box it will result true. It's just sort of a failsafe. Play with that a bit.
    Yeah did that, works flawlessly

    SCAR Code:
    function F_InFight: Boolean;
    var GTPA, RTPA: TPointArray;
    begin
      FindColorsTolerance( GTPA, 49499, 226, 118, 262, 147, 20 );
      FindColorsTolerance( RTPA, 590010, 226, 118, 262, 147, 20 );
      Result := ( ( GetArrayLength( GTPA ) + GetArrayLength( RTPA ) ) >= 20 );
    end;
    Last edited by Frement; 02-07-2010 at 06:00 PM.
    There used to be something meaningful here.

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
  •