Line 1: | Line 1: | ||
{{mirc title|On Parseline - Events}} | {{mirc title|On Parseline - Events}} | ||
− | The '''on parseline''' event triggers before incoming/outgoing IRC server lines are received/sent and allows a script to modify them | + | The '''on parseline''' event triggers before incoming/outgoing IRC server lines are received/sent and allows a script to modify them. |
+ | |||
+ | The incoming / outgoing lines are in IRC protocol which is very different to the terminology used in the mIRC front end. For example all messages to channels and individual users are sent / received using PRIVMSG. {{mIRC|/ctcp}} also uses PRIVMSG with a special encoding to indicate it is CTCP. {{mIRC|/me}} action messages are a specific type of CTCP message etc. '''''Use of PARSELINE should therefore be considered advanced scripting and is not for the faint-of-heart.''''' | ||
+ | |||
+ | Because PARSELINE will be called for every matching line, care should be taken to provide the best possible matchtext in order to minimise the number of times it is called, and to keep the processing undertaken to a reasonable level. | ||
+ | |||
+ | '''Note:''' For obvious reasons, with the exception of use of {{mIRC|/parseline}}, it is probably not a good idea to try any mSL commands which create output during ON PARSELINE processing as this may create issues. | ||
== Synopsis == | == Synopsis == | ||
Line 7: | Line 13: | ||
</source> | </source> | ||
− | == | + | == Parameters == |
* '''<level>''' - The appropriate {{mIRC|access levels}} for the event. | * '''<level>''' - The appropriate {{mIRC|access levels}} for the event. | ||
− | + | * '''<matchtext>''' - See the {{mIRC|on text}} event page for a definition of the <matchtext> parameter and related prefixes. | |
− | |||
− | |||
− | See the {{mIRC|on text}} event page for a definition of the <matchtext> parameter | ||
== {{mIRC|/parseline}} == | == {{mIRC|/parseline}} == | ||
Line 39: | Line 42: | ||
== See also== | == See also== | ||
+ | * {{mIRC|/parseline}} | ||
+ | * {{mIRC|$parseline}} | ||
+ | * {{mIRC|$parseutf}} | ||
* [[List of on events - mIRC|List of on events]] | * [[List of on events - mIRC|List of on events]] | ||
* [[List of identifiers - mIRC|List of identifiers]] | * [[List of identifiers - mIRC|List of identifiers]] |
Revision as of 11:05, 4 October 2018
The on parseline event triggers before incoming/outgoing IRC server lines are received/sent and allows a script to modify them.
The incoming / outgoing lines are in IRC protocol which is very different to the terminology used in the mIRC front end. For example all messages to channels and individual users are sent / received using PRIVMSG. /ctcp also uses PRIVMSG with a special encoding to indicate it is CTCP. /me action messages are a specific type of CTCP message etc. Use of PARSELINE should therefore be considered advanced scripting and is not for the faint-of-heart.
Because PARSELINE will be called for every matching line, care should be taken to provide the best possible matchtext in order to minimise the number of times it is called, and to keep the processing undertaken to a reasonable level.
Note: For obvious reasons, with the exception of use of /parseline, it is probably not a good idea to try any mSL commands which create output during ON PARSELINE processing as this may create issues.
Contents
Synopsis
on <level>:parseline:in|out|*:<matchtext>:<commands>
Parameters
- <level> - The appropriate access levels for the event.
- <matchtext> - See the on text event page for a definition of the <matchtext> parameter and related prefixes.
/parseline
Inside this event, you can use /parseline without the -q switch to change the line.
Local identifiers
The on parseline event expose 3 local identifiers
$parsetype
Return the type of line, "in" or "out"
$parseline
Return the line being sent/received.
Note: For out lines, $parseline is terminated with a $LF character that is not visible when viewed in mIRC. You may wish to remove this with:
var %pl $parseline if ($asc($right(%pl,1)) == 10) %pl = $right(%pl,-1)
$parseutf
Return $true if mIRC is going to decode/encode utf8 the message after the on parseline event
See also