ShowerThoughts
2007-10-27 08:19:13
updated!
-Hermpie(pls change my first letter to a capital'H')
program NPCFinder;
{.include SRL/SRL.Scar}
{==============================]
Function:FindClickNpc
by:Hermpie
Info:you could use it like this,
NPCFindNClick(Color1,Color2,'uptext1','uptext2','rade',InFight,False,10);
[==============================}
Function NPCFindNClick( NPCColor1, NPCColor2:integer; UpText1,UpText2, COption:string;RepeatUntil, RightOrLeft:boolean;
HMTolerance:integer):boolean;
var
TMT :Integer;
Coord123X :Integer;
Coord123Y :Integer;
T:integer;
begin
TMT:=0;
repeat
FindTalk;
TMT:=TMT + 1
Wait(50+random(10));
if FindObjCustom(Coord123X, Coord123Y, [Uptext1, Uptext2], [NPCColor1, NPCColor2],HMTolerance) then//Thanks killerDou!:)
begin
T := GetSystemTime;
Wait(50+random(10));
Mouse(Coord123X, Coord123Y, 1, 1, RightOrLeft);
Wait(50+random(10));
if (RightOrLeft=False) then
begin
if ChooseOption(COption) then
begin
Result:=True;
WriteLn('Found Npc');
Break;
end;
end;
end;
until (RepeatUntil) or (TMT>10)
if RepeatUntil then Result:=true;
Writeln(IntToStr(GetSystemTime - T));
end;
Begin
SetupSrl;
NPCFindNClick(1,1,'uptext1','uptext2','rade',InFight,False,10);
end.
-Hermpie(pls change my first letter to a capital'H')