1337_macro
2006-10-02 02:26:42
Ya i was bored and i rly want to help out srl so i was scanning though srl to see what they dont have then the npcs came up…so i made a procedure and a funtion for em
Note these are for use with talking to npcs such ass the rune ess guy and like the armor smithing guy (lol i dont play rs too much) lol not atking npcs
This one is the same as the above but this will phisicly click the npc when forund
Note these are for use with talking to npcs such ass the rune ess guy and like the armor smithing guy (lol i dont play rs too much) lol not atking npcs
{*******************************************************************************
Function ScanForNpc(Name: String; NpcColor, Timeout, Tolerence:Integer):boolean;
By: 1337_Macro
Description:Will scan the main screen for a npc in a ever widining circle untill found then returns true
Arguments: Name=Name of the npc, Timeout is the max time in seconds u want it to run before it stops, Tolerance of the color.
*******************************************************************************}
Function ScanForNpc(Name: String; NpcColor, Timeout, Tolerence:Integer):boolean;
var
a1, b1, c1, d1:Integer;
x1,y1,timeouttime: Integer;
Found:boolean;
begin
Result:=false;
Marktime(timeouttime)
a1 := 184;
b1 := 118;
c1 := 311;
d1 := 219;
repeat
if (FindColorTolerance(x1, y1, NpcColor,A1,B1,C1,D1, Tolerence)) then
MMouse(x1, y1, 5, 5)
if (IsUpText(Name)) then
begin
Mouse(x1,y1,3,3,true)
Break;
Found:=True;
end
if (not(IsUpText(Name))) then
begin
a1 := a1+10;
b1 := b1+10;
c1 := c1+10;
d1 := d1+10;
end;
until (Timefrommark(timeouttime)/1000>=timeout) or (result) ;
end;
This one is the same as the above but this will phisicly click the npc when forund
{*******************************************************************************
Procedure ScanAndClickNpc(Name: String; NpcColor, Timeout, Tolerence:Integer);
By: 1337_Macro
Description:Will scan the main screen for a npc in a ever widining circle untill found then Click on npc
Arguments: Name=Name of the npc, Timeout is the max time in seconds u want it to run before it stops, Tolerance of the color.
*******************************************************************************}
Procedure ScanAndClickNpc(Name: String; NpcColor, Timeout, Tolerence:Integer);
var
a1, b1, c1, d1:Integer;
x1,y1,timeouttime: Integer;
Found:boolean;
begin
Marktime(timeouttime)
a1 := 184;
b1 := 118;
c1 := 311;
d1 := 219;
Found:=false;
repeat
if (FindColorTolerance(x1, y1, NpcColor,A1,B1,C1,D1, Tolerence)) then
MMouse(x1, y1, 5, 5)
if (IsUpText(Name)) then
begin
Mouse(x1,y1,3,3,true)
Break;
Found:=True;
end
if (not(IsUpText(Name))) then
begin
a1 := a1+10;
b1 := b1+10;
c1 := c1+10;
d1 := d1+10;
end;
until (Timefrommark(timeouttime)/1000>=timeout) or (found) ;
end;