SRL Archive - SRL Archives

NpcFindNClick;//i must say it works good


ShowerThoughts

2007-10-27 08:19:13

updated!

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')

imafatmess

2007-10-27 08:38:31

Very nice, I'd say change it so there's an option of not using the repeat until…

Well, actually I spose you could just type true if you don't want any repeat until stuff.. Otherwise, nice :P

ShowerThoughts

2007-10-27 08:39:56

then just fill in false so the tries will take over the repeatuntil okay?
because repeat until is needed.

legendaryhero90

2007-10-27 14:42:15

simple yet effective.

very nice.

ShowerThoughts

2007-10-27 14:46:15

thanks

mat_de_b

2007-10-27 17:06:42

if findobjcustom is going to offer you the chance to use an array, let your function use one…

ShowerThoughts

2007-10-30 15:24:41

nah its not that needed just was bored 5 mins :D

MasterKill

2007-10-30 15:30:54

hermpie: i gues this will never be in srl couse it's to complicated.

edited version: (#9)
http://www.villavu.com/forum/showthread.php?t=19858?p=252959

ShowerThoughts

2007-10-30 16:15:14

i updated a version look my other thread