mIRC Homepage
Posted By: twigboy New ON SHOWTEXT event - 07/01/10 04:18 AM
Feature:
- Adds an event which receives the text which is about to be displayed onto the channel/query window (formatted by mIRC)
- Scripter has the ability to modify the text just before it is displayed

Reasoning:
Sometimes it is useful to replace ALL of the message, such as when a theme engine is taking care of the rendering.

But it is not always convenient for scripters (who are happy with the default mIRC formatting) who want to make a minor change but do not wish to go through the hassle of:
- displaying the right colors
- displaying the right usermode (op, voice, halfop, etc)
- getting the right timestamp



Just a suggestion, I'm open to feedback.
Unsure of how much work/modification would be involved, but I was thinking there is already an existing 'hook' system to broadcast events and its just another event being added prior to display.
Posted By: RusselB Re: New ON SHOWTEXT event - 07/01/10 05:23 AM
This sounds like the ON INPUT event.
Posted By: argv0 Re: New ON SHOWTEXT event - 07/01/10 11:53 AM
The issue is that colours and formatting are generally defined by the event type, not the mere existence of text. For this to work, mIRC would have to pass along that event type ($event, maybe?), but handling text based on $event would pretty much be the same thing as simply handling the event, just way messier.

So yes, for a case like "I want to add [CRAP] to the beginning of every line no matter what it is"-- yea, it's overly complex. However, that scenario is also an oversimplification of what themes actually are, not to mention that scenario is exceedingly rare (and a little pointless, subjectively speaking).

Would you mind elaborating on exactly what "minor change" you're looking to make? Perhaps there's an easier way to go about this...
Posted By: The_JD Re: New ON SHOWTEXT event - 09/01/10 02:23 PM
Sounds like OP wants to do what I suggested years ago, on ECHO, which is more like on ALINE than on ECHO, but with the added feature of returning a value.

To the OP, you can probably do what you want with the /debug command
© mIRC Discussion Forums