SRL Archive - SRL Archives

AttackMonster


Bebe

2006-03-12 23:47:31

{*****************************************************************************
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.

Flyboy

2006-03-12 23:54:43

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?

Sdcit

2006-03-12 23:58:59

errmm dont we have one in fighting.scar? :p good job!

Flyboy

2006-03-13 00:04:10

From: Sdcit
errmm dont we have one in fighting.scar? :p 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.

Bebe

2006-03-13 00:17:06

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