SRL Archive - OSR Help

Am I using this right?


rj

2013-04-14 14:29:09

I am trying to check if I get the message in game "there is currently no ore available in this rock"

So I am using

ChatText := GetChatBoxText(1,0);
if ChatText = 'There is no ore' then
begin
writeln('found chat text moving on')
exit;
end;

It does not seem to work, I have tried

GetChatBoxText(0,0);
GetChatBoxText(8,0);

Also no results

Rich

2013-04-14 14:42:11

I have no idea what is said in the chat box when you click on a dead rock, but going on what you've said you've got the wrong text in the script?

ChatText := GetChatBoxText(1,0);
if ChatText = 'There is currently no ore' then
begin
writeln('found chat text moving on')
exit;
end;
Would you not want the "currently"?

Le Jingle

2013-04-14 15:13:37

use the Pos function > 0

Ex.


if (Pos('is currently no ore', GetChatBoxText(1,0)) > 0) then
Writeln('yes');

tealc

2013-04-14 15:21:09

program new;
{$DEFINE SMART8}
{$i srl/srl.simba}
var
ChatText:String;
begin
ChatText := GetChatBoxText(4,0);
writeln(chattext);

end.

just tried running this (eoc) it either writes a blank line or something like this "? ? ?=?"

the line I called it on had black text

rj

2013-04-14 15:27:28

From: Le Jingle
use the Pos function > 0

Ex.


if (Pos('is currently no ore', GetChatBoxText(1,0)) > 0) then
Writeln('yes');


EDIT:

@Le Jingle

It still does not work :/

Le Jingle

2013-04-14 16:09:29

From: Officer Barbrady
EDIT:

@Le Jingle

It still does not work :/



program StringTest;
{$include_once srl/srl.simba}
const
SEARCH_STRING = '';
begin
SetupSRL;
if IsChatBoxTextAnyLine(SEARCH_STRING, clBlack) then
Writeln('True');
end.

rj

2013-04-14 16:12:24

From: Le Jingle

program StringTest;
{$include_once srl/srl.simba}
const
SEARCH_STRING = '';
begin
SetupSRL;
if IsChatBoxTextAnyLine(SEARCH_STRING, clBlack) then
Writeln('True');
end.


That might get it confused though :/ i'll try it though