PDA

View Full Version : Detect red border message?



Bixby Sayz
09-15-2014, 05:34 PM
When you attempt to do something in RS3 that you cannot (Example: use an agility shortcut when lacking the required agility level) a message box with a red border and white text flashes on screen briefly then fades away.

Is there anything in SRL existing to detect this and get the text. Nothing jumped out at me perusing through the includes. Came up with my own to detect the red boarder and get the text but having a devil of a time to get the text to ocr properly. Hoping I missed something and there is something already built in I can use.

Clarity
09-15-2014, 05:36 PM
What warning specifically are you trying to detect? There may be an easier method depending on what you are doing.

Bixby Sayz
09-15-2014, 05:39 PM
Exactly as I stated: "You need Agility level x.". I would prefer to bundle the detection into a routine that I can re-use in the future (potentially in a different context).

Coh3n
09-15-2014, 06:10 PM
Is there anything in SRL existing to detect this and get the text. Nothing jumped out at me perusing through the includes. Came up with my own to detect the red boarder and get the text but having a devil of a time to get the text to ocr properly. Hoping I missed something and there is something already built in I can use.Have you tried using tesseract to find the text inside the box?

As far as I know there isn't an SRL function for this -- just functions that will find text inside a given box.

Bixby Sayz
09-15-2014, 06:52 PM
I have it working now. A *tiny* mistake in another custom routine of mine was returning the wrong text points messing up the ocr. Fixed that and now it works like a charm.

Now my big dilemma is: what do I call this? Is it a failure message, requirements message, or get totally unimaginative and call it a red border dialog? This is important stuff lol.

Coh3n
09-16-2014, 12:34 AM
I have it working now. A *tiny* mistake in another custom routine of mine was returning the wrong text points messing up the ocr. Fixed that and now it works like a charm.

Now my big dilemma is: what do I call this? Is it a failure message, requirements message, or get totally unimaginative and call it a red border dialog? This is important stuff lol.getDialogMsg? getPopupMsg? getFailureMsg? Those are my best ideas. :p

getRedBorderDialogMsg? Lol

The Mayor
09-16-2014, 01:12 AM
if getPopupDialogFailureMessageInsideRedBorder() then
begin
writeLn('We just found the popup dialog failure message inside the red border!');
end;