Results 1 to 8 of 8

Thread: Need some ideas...

  1. #1
    Join Date
    Jan 2010
    Posts
    90
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Need some ideas...

    - I'm in the making of a chicken killer and its coming along like magic... But I'm at a dillema, my chicken finder is almost flawless except it clicks on a lot of chickens that are already under attack... And I need some ideas of how to check if theres a hp bar over the head of the chicken.

    I was trying
    SCAR Code:
    if(not(FindColorTolerance(x, y, 50027, (TPAs[i][ii].x - 10), (TPAs[i][ii].y - 10), (TPAs[i][ii].x + 10), (TPAs[i][ii].y + 10), 10)))then

    But I'm getting a type mismatch and I don't know why.
    + EDIT: I'm an idiot I had FindColorsTolerance instead of FindColorTolerance I think I got it now
    Last edited by YoHoJo; 02-08-2010 at 05:34 AM.

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Take a gander at Tarajunky's chicken killer.
    His non-members version is outdated, but the code is still beautiful, and I'm pretty sure I had a fail safe against attacking already in-combat chickens:

    http://www.villavu.com/forum/showthread.php?t=4082

    Sorry I cant find the EXACT code where he did it. You can shoot him a PM and though, he's very helpful.
    Basically what you are doing is just fine though. Find the chicken, and GetMousePos(x,y) then search for an HP bar color in x-10,y-10,x+10,y+10. Would be a simple way of going about doing that. I believe there is also GetFightAt(x,y) (or something similar to that) in SRL which you can also use and basically does what you are trying to do in one line.
    Last edited by YoHoJo; 02-08-2010 at 01:31 AM.

  3. #3
    Join Date
    Jan 2010
    Posts
    90
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    Take a gander at Tarajunky's chicken killer.
    His non-members version is outdated, but the code is still beautiful, and I'm pretty sure I had a fail safe against attacking already in-combat chickens:

    http://www.villavu.com/forum/showthread.php?t=4082
    Thanks I think I got it but I'll deffinatly take a look.

  4. #4
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Ah, I hate when people do that (edit the original post out when they solved the problem).
    Keep it in for archival purposes and if somebody else has the same problem!
    I want to see it so can you please edit it back.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  5. #5
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    I did it :]
    Also, I agree, great attitude sex!

  6. #6
    Join Date
    Jan 2010
    Posts
    90
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sex View Post
    Ah, I hate when people do that (edit the original post out when they solved the problem).
    Keep it in for archival purposes and if somebody else has the same problem!
    I want to see it so can you please edit it back.
    Sorry about that, but it was a dumb mistake.

    Quote Originally Posted by YoHoJo View Post
    I did it :]
    Also, I agree, great attitude sex!
    Thanks savin' me time

  7. #7
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You can steal it from my Feathers!
    The whole script is still fully functional.
    EDIT:
    SCAR Code:
    function UnderAttack(fx, fy: Integer): Boolean;
    var
      Nom: TPointArray;
      CTS: Integer;
    begin
      if (not LoggedIn) then
        Exit;
      FindNormalRandoms;
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(2.60, 0.27);
      FindColorsSpiralTolerance(MSCX, MSCY, Nom, 8420611, fx - 25, fy - 25, fx + 25, fy, 19);
      ColorToleranceSpeed(CTS);
      SetColorSpeed2Modifiers(0.2, 0.2);
      Result := Length(Nom) > 20;
    end;
    There.. Should work.. use ie..
    if (not UnderAttack(MiddleTPA of chicken x, Middle TPA of chicken y)) then
    ...
    else
    Continue;/NextChickenCode

  8. #8
    Join Date
    Jan 2010
    Posts
    90
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Timer View Post
    You can steal it from my Feathers!
    The whole script is still fully functional.
    EDIT:
    SCAR Code:
    function UnderAttack(fx, fy: Integer): Boolean;
    var
      Nom: TPointArray;
      CTS: Integer;
    begin
      if (not LoggedIn) then
        Exit;
      FindNormalRandoms;
      CTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(2.60, 0.27);
      FindColorsSpiralTolerance(MSCX, MSCY, Nom, 8420611, fx - 25, fy - 25, fx + 25, fy, 19);
      ColorToleranceSpeed(CTS);
      SetColorSpeed2Modifiers(0.2, 0.2);
      Result := Length(Nom) > 20;
    end;
    There.. Should work.. use ie..
    if (not UnderAttack(MiddleTPA of chicken x, Middle TPA of chicken y)) then
    ...
    else
    Continue;/NextChickenCode
    Thanks! I'll totally look into this, but right now I'm to tired and am off to bed. So thanks.

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
  •