| 1 |
! $eterna: serial_numbers,v 1.7 2018/06/10 08:17:42 mrg Exp $ |
| 2 |
! |
| 3 |
! Copyright (c) 1990-2018 Michael Sandrof, Troy Rollo, Matthew Green, |
| 4 |
! and other ircII contributors. |
| 5 |
! |
| 6 |
! All rights reserved. See the HELP IRCII COPYRIGHT file for more |
| 7 |
! information. |
| 8 |
! |
| 9 |
How to use SERIAL NUMBERS |
| 10 |
This describes the use of serial numbers in ON functions, |
| 11 |
and is a direct extension of the basic ON help file. |
| 12 |
|
| 13 |
It is now possible to have more than one ON hook executed for |
| 14 |
each event triggering a hook. This has been done by adding a |
| 15 |
new serial number concept to the ON command. Each ON hook has |
| 16 |
a serial number attached. Serial numbers can be any number |
| 17 |
from -maxint to maxint, with the default being 0. |
| 18 |
|
| 19 |
When an event triggers a hook, IRCII now goes through the ON |
| 20 |
hooks added for that event, and for each serial number used |
| 21 |
by ON hooks in that hook type, finds the best match out of those |
| 22 |
ON hooks which have that serial number and executes that ON |
| 23 |
hook. The hooks are executed in order of serial number. Thus |
| 24 |
if you set up the following set of MSG hooks. |
| 25 |
|
| 26 |
ON #^MSG -666 * echo Message coming: |
| 27 |
ON ^MSG * echo Message from $0: $1- |
| 28 |
ON #^MSG 666 * echo I got one, I got one! |
| 29 |
ON #^MSG 666 WiZ echo WiZ hath spoken |
| 30 |
|
| 31 |
will cause the following to appear when you receive a message: |
| 32 |
|
| 33 |
Message coming: |
| 34 |
Message from nick: text |
| 35 |
I got one, I got one! |
| 36 |
|
| 37 |
And the following if you receive a message from WiZ: |
| 38 |
|
| 39 |
Message coming: |
| 40 |
Message from WiZ: text |
| 41 |
WiZ hath spoken |
| 42 |
|
| 43 |
The default serial number is 0, and the serial numbers are always |
| 44 |
executed in order, starting with the lowest, and ending with the |
| 45 |
highest. |
| 46 |
|
| 47 |
Although the '^' modifier can be used with any serial number, |
| 48 |
it will only suppress the default action if used with serial |
| 49 |
number 0. Thus if the only message hook you have is: |
| 50 |
|
| 51 |
ON #^MSG -666 * echo Incoming: |
| 52 |
|
| 53 |
You will see the following when you receive a message: |
| 54 |
|
| 55 |
Incoming: |
| 56 |
*nick* text |
| 57 |
|
| 58 |
It is advisable to place any ON hooks which do not suppress the |
| 59 |
default action in a serial number other than 0. In particular, |
| 60 |
TIMER hooks, which are generally not intended to exclude other |
| 61 |
TIMER hooks, should be placed at different serial numbers wherever |
| 62 |
possible, and never on 0 (since 0 is the most likely place to |
| 63 |
get a clash if anybody does use it). |
| 64 |
|
| 65 |
See Also: |
| 66 |
ON |