Avaphi
2007-03-01 20:59:24
Notes: Hi all. While I was writing my tutorial island script I noticed I couldnt find a function in which it found if you were in chat with an npc. So I wrote one for SRL :) It uses bmp masks to increase speed and such :).
Description: Function InChatNPC(NPCName : string): boolean;
When you call it, you must enter in an argument for NPC name, and make sure the caps are exactly how they are in the game :) or it wont work :( It will return a boolean whether it has found it or not, Works perfect for me, so without further adieu here it is :
Description: Function InChatNPC(NPCName : string): boolean;
When you call it, you must enter in an argument for NPC name, and make sure the caps are exactly how they are in the game :) or it wont work :( It will return a boolean whether it has found it or not, Works perfect for me, so without further adieu here it is :
Function InChatNPC(NPCName : string): boolean;
var NPCText, OutPut : integer;
begin
NPCText := LoadChars2(AppPath + 'includes\SRL\CharsNPC\');
OutPut := CreateBitmapMaskFromText(NPCName, NPCText);
if (FindBitmapMaskTolerance(OutPut, x, y, 124, 356, 493, 411, 10, 2)) then
begin
Result := True;
end;
FreeBitmap(OutPut);
FreeChars2(NPCText);
end;