Results 1 to 5 of 5

Thread: AttackMonster

  1. #1
    Join Date
    Feb 2006
    Location
    Pennsylvania
    Posts
    1,524
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default AttackMonster

    Code:
    {*****************************************************************************
    Procedure AttackMonster (Color1, color2, color3 : Integer; MonsterName :String; Tolerence :integer);
    By: Bebemycat2
    Description: Finds the monster specifyed by color1,color2,color2 and MonsterName and clickss to fight it.
                 If it doesn't find the 3 colors then it will try for 2 out of the 3 colors 3 times
                 If that doesn't work then it will exit out of the procedure
    *****************************************************************************}
    
    Procedure AttackMonster (Color1, color2, color3 : Integer; MonsterName :String; Tolerence :integer);
    begin
     if(FindColorTolerance(x,y, color1, 79, 95, 592, 429, Tolerence))and
       (FindColorTolerance(x,y, color2, 79, 95, 592, 429, Tolerence))and
       (FindColorTolerance(x,y, color3, 79, 95, 592, 429, Tolerence))and
       (Option2('Attack '+MonsterName+''))then
        Mouse(x, y, 5, 5, true)
      else
       if(FindColorTolerance(x,y, color1, 79, 95, 592, 429, Tolerence))and
         (FindColorTolerance(x,y, color2, 79, 95, 592, 429, Tolerence))and
         (Option2('Attack '+MonsterName+''))then
         Mouse(x, y, 5, 5, true)
     else
      if(FindColorTolerance(x,y, color2, 79, 95, 592, 429, Tolerence))and
       (FindColorTolerance(x,y, color3, 79, 95, 592, 429, Tolerence))and
       (Option2('Attack '+MonsterName+''))then
       Mouse(x, y, 5, 5, true)
     else
      if(FindColorTolerance(x,y, color1, 79, 95, 592, 429, Tolerence))and
        (FindColorTolerance(x,y, color3, 79, 95, 592, 429, Tolerence))and
        (Option2('Attack '+MonsterName+''))then
         Mouse(x, y, 5, 5, true)
      else
       exit;
    end;
    Undated.

    Untested though, but seems like it should work.

  2. #2
    Join Date
    Feb 2006
    Location
    Sunshine Coast, Qld. Australia
    Posts
    412
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What happens if the first color match does not have the right name. Will it keep searching at the same spot or go on to next spot?

  3. #3
    Join Date
    Feb 2006
    Location
    California-Foster City
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    errmm dont we have one in fighting.scar? good job!
    The Welcoming Party
    Don't be a Fakawi! Get 25 hours of sleep a day!

  4. #4
    Join Date
    Feb 2006
    Location
    Sunshine Coast, Qld. Australia
    Posts
    412
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sdcit
    errmm dont we have one in fighting.scar? good job!
    we have:
    Function FightNPC(Color1, Color2, Color3, Color4, Color5, Color6, tol, TimeOut: integer): Boolean;

    It only does a color search, having it check for text is a great idea. If I were you I would start with what Fakawi started and mod it from there.

    Once you perfect it, you could also make one similar that would search for a bitmap or dtm.

    Keep the ideas flowing!!! great start.

  5. #5
    Join Date
    Feb 2006
    Location
    Pennsylvania
    Posts
    1,524
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Ok I updated it a little, have a look, I'll make a few more changes latter.

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
  •