PA[Script] Show nicks in emote/action messages to the right of the nick column
Added by Per Amundsen over 7 years ago
2019/05/16 Fixed the incoming action should trigger the "new message" color.
; Listen for incoming ACTION/me messages.
on ^*:ACTION:*:*:{
; Print our own custom message format.
echo $color(action) -tbflm $target $prefixemote(#, $nick) $1-
; Halt the original message
halt
}
; override the /me alias with our own.
alias me {
; Send the message using the built-in /me command.
.!me $1-
; Print our own custom message format.
echo $color(action) -tbf $target $prefixemote(#, $me) $1-
}
Replies (11)
MW RE: [Script] Show nicks in emote/action messages to the right of the nick column - Added by Megan Woulffe over 6 years ago
This does exactly what I want it to! However....it turns actions received from others into a system notice instead of an action, so it doesn't color the channel correctly or activate any privmsg notifications. If I could fix it myself I would, but I don't know the scripting that well yet. Any chance you can help me out?
PA RE: [Script] Show nicks in emote/action messages to the right of the nick column - Added by Per Amundsen over 6 years ago
You are right, I updated the script with a fix, adding "-m" to the parameters, thanks.
MW RE: [Script] Show nicks in emote/action messages to the right of the nick column - Added by Megan Woulffe over 6 years ago
Tested and functioning! Thanks!
MW RE: [Script] Show nicks in emote/action messages to the right of the nick column - Added by Megan Woulffe over 6 years ago
I actually did just find another issue. If highlight is kicked off by an emote, the line does not get the highlight color, only the action color. Is there a way to account for this?
PA RE: [Script] Show nicks in emote/action messages to the right of the nick column - Added by Per Amundsen over 6 years ago
That does complicate things a little, you can try this:
on ^*:ACTION:*:*:{
var %color = $color(action)
if ($highlight($1-)) {
%color = $highlight($replace($v1, $ $+ me, $me)).color
}
echo %color -tbflm $target $prefixemote(#, $nick) $1-
halt
}
MW RE: [Script] Show nicks in emote/action messages to the right of the nick column - Added by Megan Woulffe over 6 years ago
How does this determine the color? It's highlighting in red, not the color I have set for highlighting. I tried figuring it out myself, but there are a lot of identifiers in that code. :P
PS - Thanks for the all the help on this.
PA RE: [Script] Show nicks in emote/action messages to the right of the nick column - Added by Per Amundsen over 6 years ago
It uses the $highlight(text) to check if the current text contains a highlight word, then it looks up the word in $highlight(word) and gets the associated color using the .color property for $highlight(word), it should return the color set for "$me" in Options -> Highlights. You can click the "Edit" button there to verify.
Worst case scenario, you can just set the color yourself using %color = N, where N is a number between 0 and 98, see Extra Colors for more about that.
MW RE: [Script] Show nicks in emote/action messages to the right of the nick column - Added by Megan Woulffe over 6 years ago
That should be able to handle! Thanks again.
MW RE: [Script] Show nicks in emote/action messages to the right of the nick column - Added by Megan Woulffe over 6 years ago
So, I've found another issue that I didn't notice until I started to plug in some aliases. I use a lot of aliases that use the /me command, but the script reads the input in the editbox before the alias is parsed. It sees it as != /me, and so doesn't format the output correctly. I've been looking over the scripting wiki some more, but it's all a little overwhelming. Is there a way to account for this?
PA RE: [Script] Show nicks in emote/action messages to the right of the nick column - Added by Per Amundsen over 6 years ago
Totally forgot about that. The solution is to override the /me alias and roll your own, you can decide yourself whether to use an alias or a script do that.
Remove the entire "on :INPUT::{" section then do this in the alias editor:
/me {
.!me $1-
echo $color(action) -tbf $target $prefixemote(#, $me) $1-
}
Or this in the script editor:
alias me {
.!me $1-
echo $color(action) -tbf $target $prefixemote(#, $me) $1-
}
/me should then do what you want when called from anywhere, will update the original script as well.
MW RE: [Script] Show nicks in emote/action messages to the right of the nick column - Added by Megan Woulffe over 6 years ago
Tested and working properly, with all highlights, aliases, etc. You're a rockstar!