SRL Archive - OSR Help

How can I search black text in chatbox?


jimthesoundman

2010-02-03 02:34:06

I tried this but it apparently doesn't work anymore even though it is still in the manual:

function IsChatBlackTextAnyLine(ChatTxt: String): Boolean;
By: Wizzup?
Description:
Returns true if ChatTxt is found in any of the 8 lines in ChatBox.

So, if this is broken/nonfunctional/whatever, can someone please tell me what a good workaround would be?

Thanks!

jimmy_mac

2010-02-03 02:45:26

I cant find that in the SRL chat.scar,
use this:


IsChatBoxTextAnyLine('String', clBlack);


jimthesoundman

2010-02-03 12:18:48

Well what upsets me is there is no comprehensive and up to date reference for what is in scar or srl. I found this function in the C:\Program Files\SCAR 3.22\Help\SRL.html file and it sucks that it is out of date and there is no way to tell. I certainly would love to help update it but someone else would have to be the pointman on it as I don't have the background or expertise to do it properly. But I would certainly contribute at least 4 hours per week to getting it updated if someone wants to take the lead.

But, enough of my ranting, thank you for the information and I will certainly try out your suggestion.

JIM

Dynamite

2010-02-03 12:50:49

I think the chat box functions are outdated.

Bionicle

2010-02-03 13:08:10

FindBlackChatMessage('');
I'm using it right now. Works fine for me. It only searches for the last line though AFAIK.

Dynamite

2010-02-03 13:09:40

Bionicle, it is actually working for you?
Do you put the whole line in or only a part?

Wanted

2010-02-03 13:55:08

From: bionicle1800
FindBlackChatMessage('');
I'm using it right now. Works fine for me. It only searches for the last line though AFAIK.


Is the same thing I use to detect the tunnel entrances when entering abyss… I'm pretty sure it only picks up the bottom line, and it works.

Dynamite

2010-02-03 13:57:03

That is soo weird…
function WaitUntilMined(Rock: TOre): Boolean;
var
GetAnimationTime, T, CX, CY, IC, P: Integer;
begin
Status('Walking to Rock');
MarkTime(t);
SetColorspeed2Modifiers(Rock.Hue, Rock.Sat);
repeat
Wait(10);
if (TimeFromMark(t) >= 6000) then Exit;
until (not FlagPresent) and FindBlackChatMessage('u swi') and
(FindColorTolerance(cx, cy, Rock.Color, MSCX-65, MSCY-65, MSCX+65, MSCY+65, Rock.Tol));
Status('Mining Rock');
IC := InvCount;
MarkTime(t);
repeat
Wait(10);
if (TimeFromMark(t) >= 12000) then Exit;
Wait(750); //was 500
if ClickContinue(false, false) then
begin
Inc(Stats_CustomVars[13]);
TakePic;
end;
if IC < InvCount then Break;
until (GetAnimation <= 0);
if FindBlackChatMessage('You manage') then
Begin
Inc(Mined);
WriteLn('Success!');
Writeln(Mined);
Inc(Players[CurrentPlayer].Integers[10]);
Inc(Stats_CustomVars[1]);
case Players[CurrentPlayer].Strings[1] Of
'copper' : Inc(Stats_CustomVars[6]);
'tin' : Inc(Stats_CustomVars[7]);
'iron' : Inc(Stats_CustomVars[8]);
'coal' : Inc(Stats_CustomVars[11]);
'mith' : Inc(Stats_CustomVars[12]);
End;
End;
Result := True;
end;
It only sometimes detects the last line for me… :S

Wanted

2010-02-03 14:00:13

use like

if (Pos('anage', GetBlackChatMessage) > 0) then

Bionicle

2010-02-03 14:49:23

From: The Man
That is soo weird…
function WaitUntilMined(Rock: TOre): Boolean;
var
GetAnimationTime, T, CX, CY, IC, P: Integer;
begin
Status('Walking to Rock');
MarkTime(t);
SetColorspeed2Modifiers(Rock.Hue, Rock.Sat);
repeat
Wait(10);
if (TimeFromMark(t) >= 6000) then Exit;
until (not FlagPresent) and FindBlackChatMessage('u swi') and
(FindColorTolerance(cx, cy, Rock.Color, MSCX-65, MSCY-65, MSCX+65, MSCY+65, Rock.Tol));
Status('Mining Rock');
IC := InvCount;
MarkTime(t);
repeat
Wait(10);
if (TimeFromMark(t) >= 12000) then Exit;
Wait(750); //was 500
if ClickContinue(false, false) then
begin
Inc(Stats_CustomVars[13]);
TakePic;
end;
if IC < InvCount then Break;
until (GetAnimation <= 0);
if FindBlackChatMessage('You manage') then
Begin
Inc(Mined);
WriteLn('Success!');
Writeln(Mined);
Inc(Players[CurrentPlayer].Integers[10]);
Inc(Stats_CustomVars[1]);
case Players[CurrentPlayer].Strings[1] Of
'copper' : Inc(Stats_CustomVars[6]);
'tin' : Inc(Stats_CustomVars[7]);
'iron' : Inc(Stats_CustomVars[8]);
'coal' : Inc(Stats_CustomVars[11]);
'mith' : Inc(Stats_CustomVars[12]);
End;
End;
Result := True;
end;
It only sometimes detects the last line for me… :S


Try
if FindBlackChatMessage('mine some ore.') then
I'm assuming this is for your T.E.M.P. script :p I always use the last part of the line, or the whole line…i don't know if it makes a difference though.

Eg:
If FindBlackChatMessage('Your inventory is too full to hold any more logs.') Then
If FindBlackChatMessage('You need a Woodcutting level of 30 to chop down this tree.') Then
If FindBlackChatMessage('t light a fire here.') Then