mIRC Home    About    Download    Register    News    Help

Print Thread
Shortening messages #267928 20/10/20 06:58 AM
Joined: Oct 2020
Posts: 2
A
AtotehZ Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
A
Joined: Oct 2020
Posts: 2
Hello,

I'm trying to make my mIRC take up as little space as possible in the corner and sometimes the messages I get are 80% redundant information.
Example: "Message of the day - It's sunday - Set 07:32 10-18-2020"

Can I, from a user side, use a script that shortens the message down to the more relevant bits?
Example: "MOTD: It's sunday"
I removed the set time since I use timestamps.

So, in short, I'm looking for a way to shorten down frequent redundant info in my messages.

Re: Shortening messages [Re: AtotehZ] #267957 22/10/20 12:44 PM
Joined: Jan 2012
Posts: 62
Epic Offline
Babel fish
Offline
Babel fish
Joined: Jan 2012
Posts: 62
You can use RAW event handlers to intercept server messages and change their length, format, and color as you see fit.

For example, you can use a script like this to intercept MOTD messages:
Code
raw 375:*: haltdef
raw 376:*: haltdef
raw 372:*: /echo -st $2- | haltdef

Now, if you run the command /MOTD, you will see that the first and last lines have been blocked for display. They were under the protocol numbers as 375 and 376.
Numeric line numbering may differ depending on the version of IRCd.

To keep track of the lines you want and their numerical value, you can use the following code, placing it above all others:
Code
raw *:*: .echo -s $+($chr(3),04,,$numeric,$chr(3)) $1-

And to intercept user messages, use other handlers using the ^ prefix.
The ^ prefix only works with the following handlers: ACTION, BAN, CHAT, DEHELP, DEOP, DEVOICE, HELP, INVITE, JOIN, KICK, MODE, NICK, NOTICE, OP, OPEN, PART, TEXT, UNBAN, USERMODE, VOICE, QUIT, SERV, SERVERMODE, SNOTICE, TOPIC, WALLOPS.

An example of intercepting and replacing a users messages on a channel:
Code
on ^*:TEXT:*:#: .echo -t $chan $+(<,$nick,>) $1- | halt

Thus, you can modify almost all messages to suit your preferred format and appearance. See the mIRC client manual for more details with examples.

Re: Shortening messages [Re: Epic] #267969 23/10/20 05:10 PM
Joined: Oct 2020
Posts: 2
A
AtotehZ Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
A
Joined: Oct 2020
Posts: 2
Thanks a lot.

I don't entirely understand the answer, but that's on me. I'll try to make sense of it.