SRL Archive - OSR Help

Wait until a string is in the chatbox?


Nebula

2011-12-31 21:36:23

Is there a procedure/function I could use to wait until a specfic string appears in the chatbox? I have tried looking through the functions list but can't find anything. Thanks :)

[Nathan]

2011-12-31 21:38:18

while not(IsChatBoxTextAnyLine('string',clBlack)) do
sleep(100);
though you would want a failsafe in there as it could be an endless loop without one

Kasi

2011-12-31 21:39:04

are you talking about a line in the chatbox? or like a click to continue?
i'd just use a getcolor on different points as it'd be fastest

Brandon

2011-12-31 21:43:37

I use this to find out if someone is talking to my character when I'm away from the computer.. You can modify it and see if OldLine = 'text here' then…..



Procedure SomeoneTalked;
var
I: Integer;
begin
FixChat;
OldLine := TheLine;

if(LastChatter(TheName))then
begin
GetLastChatText(TheLine);
if OldLine <> TheLine then
try
For I:= 0 To 5 do
begin
PlaySound('C:\Users\Brandon\Downloads\MSN_Sound.wav');
wait(150);
end;
writeln(TheLine);
except end;
end else
begin
GetLastChatText(TheLine);
if OldLine <> TheLine then
try
For I:= 0 To 5 do
begin
PlaySound('C:\Users\Brandon\Downloads\MSN_Sound.wav');
wait(150);
end;
writeln(TheLine);
except end;
end;
end;

Nebula

2011-12-31 21:44:33

From: [Nathan]
while not(IsChatBoxTextAnyLine('string',clBlack)) do
sleep(100);
though you would want a failsafe in there as it could be an endless loop without one


Hmm I'll try that, thanks.