SRL Archive - OSR Help

What am I doing wrong - Detecting chat text


Im4everlast

2011-06-12 08:00:48

I'm trying to make it check all the lines in chat, but I can't get it to work. Could someone correct this or tell me what I should change.


procedure ChatCheck;
var
i, l : Integer;
b : Boolean;
TSA : TStringArray;
begin
TSA := ['.', 'boot', 'bot', 'boots', 'bots', 'booter', 'boter', 'booters', 'boting', 'booting', 'robot', 'legit', 'noob booters'];
for i := 0 to High(TSA) do
begin
//Writeln('E1 i := ' + IntToStr(i));
for l := 1 to 8 do
begin
//Writeln('E2');
if (Pos(TSA[i], Lowercase(GetChatBoxText(l, clBlue))) > 0) then //<----- :/
begin
//Writeln('E3');
b := True;
Wait(1);
end else
//Writeln('Text not found...');
end;
end;

if b then
begin
Writeln('Someone is being gay..');
Writeln('Logging out.');
Wait(1000 + Random(1500));
Logout; //change the world..
end
end;

Rich

2011-06-12 08:09:16

Do you think you could put it in code tags instead of Simba tags please? But anyway, what problems are you having? Does it give an error, or does it just not detect the text?

Im4everlast

2011-06-12 08:13:32

It's just not detecting the text :/

WT-Fakawi

2011-06-12 09:06:46

This is how I detect Chat Text:

if (pos('yourtext', GetBlackChatMessage) <> 0 ) then …

Im4everlast

2011-06-12 09:50:42

From: WT-Fakawi
This is how I detect Chat Text:

if (pos('yourtext', GetBlackChatMessage) <> 0 ) then …


This will only check chat line for the black text right? What I want to do is make it check all the lines for the blue text.

Hm..what did I do wrong…

i luffs yeww

2011-06-12 10:03:11

Do <> 0 rather than > 0. Also the clBlue may be wrong. Pick the color you want in the chat box and use that instead.

Im4everlast

2011-06-12 11:00:06

Thanks, that worked! :-)