SRL Archive - OSR Help

Trying To learn "GetChatBoxText"


Xodz

2012-11-13 09:50:23

but this reference seems to be outdated

http://docs.villavu.com/srl-5/chat.html

At "SetAllChats"

procedure SetAllChats(Game, Pub, Priv, Clan, Trade, Assist: string);

It doesnt have "friendchat" it skips from Private to Clan

Is there anywhere I can find more updated material? Is this function updated within SRL?

I'm trying to make it so it can understand when it has received a trade request

nokkasiili

2012-11-13 10:06:36

procedure SetAllChats(Game, Pub, Priv, Friends, Clan, Trade, Assist: string);
from chat.simba

Rezozo

2012-11-13 10:06:51

Well, it is updated…I see no problem.
Does it really matter though? Just do chatsoff; . Then a Repeat-Until(FindChatBoxText(info-color))
Then click it.

Xodz

2012-11-14 18:02:38

From: Rezozo
Well, it is updated…I see no problem.
Does it really matter though? Just do chatsoff; . Then a Repeat-Until(FindChatBoxText(info-color))
Then click it.


Is FindChatBoxText a Procedure itself or can I put it inside a procedure that I want to title "accepttrade"

Roflme

2012-11-14 18:14:23

You can put procedures in procedures and functions in functions :p (so long as you do it properly).



FindChatBoxText is a function:
function FindChatBoxText(Text: string; Line: Integer; TextCol: Integer): Boolean;
It'll search for the text on the specified line with the specified color. It'll return true if it's found.

The text is a string of whatever you want to find, the lines go from 1 (the top) to 8 (the most bottom line). Colors can be a specified color or you can use some included:
    - clMessage/clBlack - Black text messages ("Oh Dear you are dead", etc).
- clChat/clBlue - Chat messages from you and other players.
- clTrade/clPurple - Colour of trade request text.
- clFriend - Colour of friend and clan chat.

Like:

Procedure AcceptTrade;
begin
if FindChatBoxText('rade', 8, clTrade) then // You can change the 'rade' to whatever text you want it to search for. Maybe look for a specific name trading you? Etc.
// Whatever you want to do when it receives a trade request
end;