mormonman
2009-01-14 23:30:28
Is there anyway to make a function that findsnpcchat, like in the normal srl? i tried to find someway, but im not so good with reflection. Any help?
2009-01-14 23:30:28
2009-01-15 01:31:03
2009-01-15 02:44:52
{*******************************************************************************
function ChatBoxTextExists(Text: string): Boolean;
By: lordsaturn
Description: Returns true if text exists and is visible in the chatbox according
to 'ChatType'.
*******************************************************************************}if ChatBoxTextExists('zasz owns') then
begin
writeln('Zasz GOT 10 YEAR DOMAIN AND 4 YEAR HOSTING FOR FREE!!');
end;
2009-01-15 03:38:20
if ChatBoxTextExists('vicrant60 owns') then
begin
writeln('Because Scaper GOT 10 YEAR DOMAIN AND 8 YEAR HOSTING FOR FREE!!');
end;2009-01-15 04:00:04
2009-01-15 08:47:02
From: N1ke!
You can use SRLs one since reflection don't got any.
2009-01-15 10:03:16
Function GetNPCChat: array of string;
var
P, C: integer;
Parents: array of integer;
begin
Parents := [64, 228, 241, 242];
for P:=Low(Parents) to High(Parents) do
for C:=1 to 6 do
if GetInterfaceText(Parents[P], C) <> '' then
begin
SetArrayLength(Result, GetArrayLength(Result) + 1);
Result[High(Result)] := GetInterfaceText(Parents[P], C);
end;
end;
Function IsNPCChat(Text: string): boolean;
var
i: integer;
Chat: array of string;
begin
Result := false;
Chat := GetNPCChat;
if GetArrayLength(Chat) = 0 then
exit;
for i:=0 to High(Chat) do
begin
if Pos(Text, Chat[i]) > 0 then
begin
Result := true;
exit;
end;
end;
end;
2009-01-15 10:06:31
2009-01-15 11:37:53