SRL Archive - OSR Help

Detecting certain words in chatbox


Lancelot074

2011-06-30 21:41:40

Hey fellas, haven't scripted in a while, but being summer, I decided to start again.

What I want is to check for certain words during a chat update while skilling.

Ex: If I am woodcutting and I receive a yew log, I want to read the message that says I found a yew log by recognizing the word "yew" and then update my variables accordingly.

Thanks for the help!

Awkwardsaw

2011-06-30 21:49:17


if GetLastChatText(text) then
if Pos(stringthatyouwanttofind, text) > 0 then
writeln('found text');

is this what you where looking for?

edit: sorry, this is probably what you where looking for

FindBlackChatMessage(ChatMsg: string) : boolean;

Lancelot074

2011-06-30 21:55:05

Yeah, that's it. Couldn't find it mixed in with all the other functions. xD