
Originally Posted by
Da Der Der
Gimme an example please?
Well Kattackmonster is a procedure in SRL fighting
Code:
function KAttackMonster(Color1, Color2, Color3, Tolerance: Integer; MonsterName: String): Boolean;
var
i, x, y: Integer;
begin
Flag;
for i:= 1 to 5 do
begin
if(FindColorTolerance(x, y, Color1, MSX1, MSY1, MSX2, MSY2, Tolerance + i))and
(FindColorTolerance(x, y, Color2, MSX1, MSY1, MSX2, MSY2, Tolerance + i))and
(FindColorTolerance(x, y, Color3, MSX1, MSY1, MSX2, MSY2, Tolerance + i))then
begin
MMouse(x, y, 3, 3);
wait(80 + random(60));
if(IsUpText('Attack '+MonsterName))then
begin
result:= true;
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
wait(40 + random(20));
Flag;
OutFight; //Waits Until Out Of Fight..
exit;
end;
end;
end;
end;
And Now Lets play that Im calling it up on my main loop
Code:
Procedure MainLoop;
Begin
a=0;
Repeat;
Kattackmonster(Color1,Color2,Color3,Tolerance,Monstername) ;
EatFood;
FindNormalRandoms;
a=a+1;
Until(a=1000) ;
End;