Reproducing text efficiently via omit and note triggers

Posted by Chaotzin on Wed 24 Oct 2018 12:56 AM — 2 posts, 13,258 views.

#0
I have an idea for a plugin I’d like to write for Geas mud but am unsure of the most efficient way to go about it. The idea is to give more choice and variability to users in the colour scheme and styles of text they see and the ability to trigger reliably on ‘events’ via broadcasts to other plugins.

The situation is that Geas mud gives a lot of variability in coloursets to users. For example I can set all my critical hits on an enemy to pink text over blue background. This makes creating triggers based on colour/font easy and very reliable for events. BUT maybe I don’t want to see a whole lot of pink and blue on my screen – ie I want the reliable trigger with a fairly neutral colour palette.

So then in comes this idea... what it involves is setting all message types to unique font/colours, using triggers to identify what the message type is, omitting it from output, broadcasting that ‘event’ to other plugins, then using ColourNote to send the text back to the output window in a user-defined colour and font.

I am comfortable doing all that but I’m unsure if that’s the most efficient way to do it. For example, there are 82 different types of text I can receive from the mud in unique colours. Is making 82 different triggers matching only on font a wise move or is one trigger with a function more efficient? Also is using ColourNote to reproduce all this text going to result in slowness or issues with the sequence of text on the screen?
Australia Forum Administrator #1
First, see this timing test:

http://www.gammon.com.au/forum/?id=9189&reply=3#reply3

In that test I was able to test 1000 non-matching triggers plus 10 matching triggers, at a rate of 672 lines per second in 2009 (so PCs would be somewhat faster these days).

So, around 100 triggers should be processed at the rate of 6720 lines per second, somewhat faster than they arrive, I hope! (You would have to be a bit of a speed reader to read text that fast).

However if most of your triggers match fixed text (eg. * says *) then it might be faster to make one trigger and check for the colours inside the script, which is easy enough to do.

Quote:

Also is using ColourNote to reproduce all this text going to result in slowness or issues with the sequence of text on the screen?


Not really. ColourNote is basically a script interface to the same code that draws style runs on the screen in the first place, so it should be just as fast, since you are omitting the original text.