SRL Archive - OSR Help

Detecting Private Chat Text


GREEN GIANT

2013-08-13 15:25:04

Hi Guys,
Just a quick one. What function should i use to detect the presence of the blue onscreen private chat text?
I want to make a procedure that plays a quick sound whenever someone messages me in OSRS.
Thanks

Ian

2013-08-13 15:29:20


if (CountColor(BlueChatColor, MCX1, MCY1, MCX2, MCY2) > 0) then
WriteLn('Weeeeoooooooweeeeeeeeeeoooooooo!!!!!!!!!!!');

GREEN GIANT

2013-08-13 16:11:52

From: BMWxi

if (CountColor(BlueChatColor, MCX1, MCY1, MCX2, MCY2) > 0) then
WriteLn('Weeeeoooooooweeeeeeeeeeoooooooo!!!!!!!!!!!');


Is there a way of retrieving the message?

Ian

2013-08-13 16:30:25

From: GREEN GIANT
Is there a way of retrieving the message?


I don't play 07 so I haven't tested, but you should be able to use

WriteLn('The Private Chat is: ' + GetTextAtExWrap(MSX1, MSY1, MSX2, MSY2,0,5,2, BlueChatColor, 0, SmallChars07));

Note that I have taken the GetTextAtExWrap from GetChatBoxText by ZephyrsFury. Things I've changed:

The area that it looks for text I changed from the line in the chatbox to the whole mainscreen (Because that's where it is I think)
BlueChatColor, replace this with the color of your text (use the color picker tool)

GREEN GIANT

2013-08-13 16:35:43

From: BMWxi
I don't play 07 so I haven't tested, but you should be able to use

WriteLn('The Private Chat is: ' + GetTextAtExWrap(MSX1, MSY1, MSX2, MSY2,0,5,2, BlueChatColor, 0, SmallChars07));

Note that I have taken the GetTextAtExWrap from GetChatBoxText by ZephyrsFury. Things I've changed:

The area that it looks for text I changed from the line in the chatbox to the whole mainscreen (Because that's where it is I think)
BlueChatColor, replace this with the color of your text (use the color picker tool)


It compiles, now i have to wait for someone to message me to see if it works lol

Thanks BMWxi

Ian

2013-08-13 16:36:41

From: GREEN GIANT
It compiles, now i have to wait for someone to message me to see if it works lol

Thanks BMWxi


No problem, let me know if it works or not :)

GREEN GIANT

2013-08-13 16:58:04

From: BMWxi
No problem, let me know if it works or not :)


Well, it kind of worked lol This is what it should have read:

The Private Chat is: Snow man has logged in. Snow man has logged out.

And this is what i got:

The Private Chat is: S Tnows ka hnS a lsTnows k oa h gn geda ls io ngg de ?out

Sjoe

2013-08-13 17:09:26

Don't know if smallchars are the correct fonts, make an array of all fonts and put them in a for to do loop.

GREEN GIANT

2013-08-13 17:15:45

From: Sjoe
Don't know if smallchars are the correct fonts, make an array of all fonts and put them in a for to do loop.


Don't know how to do this sorry :(

Sorry i understand now.

Sjoe

2013-08-13 17:19:37

From: GREEN GIANT
Don't know how to do this sorry :(

Sorry i understand now.


u got it? don't be afraid to ask :p

GREEN GIANT

2013-08-13 17:26:21

From: Sjoe
u got it? don't be afraid to ask :p


Well im guessing you mean just make an array that loops through the procedure using different chars in turn. The problem i have is trying to find the different char types as typing in chars only brings up the chars that start with 'Char' not any function that includes 'char' in it.

Ian

2013-08-13 17:28:10

From: GREEN GIANT
Well im guessing you mean just make an array that loops through the procedure using different chars in turn. The problem i have is trying to find the different char types as typing in chars only brings up the chars that start with 'Char' not any function that includes 'char' in it.


C:\Simba\Fonts

Look at the ones that have 07 at the end.

GREEN GIANT

2013-08-13 17:42:13

From: BMWxi
C:\Simba\Fonts

Look at the ones that have 07 at the end.


No such luck with those either :(

Itankbots

2013-08-14 20:45:50

From: GREEN GIANT
No such luck with those either :(


If it is the chat above the chatbox for Pm's , it might be a different font then everything else, in which case you would have to make your own font set, or just use pixel count or Something along that nature.

Have you tried switching the chat to display inside the chatbox? (idk if that option is there for 07 scape like it was in rs2)

if you can, then it should be same font