@trigger
@trigger
Section titled “@trigger”@trigger[/<switches>] <object>/<attribute>[=<arg0>, ..., <arg29>]
@trigger/match[/<switches>] <object>/<attribute>=<string>
@trigger/args[/<switches>] <object>/<attribute>=<name>, <value>[, <name>, <value>...]
@trigger queues an action list stored in an attribute. It can also pass values to that attribute on the stack, as %0 to %9 and r(0,args) to r(29,args).
With /inline or /inplace, @trigger outputs what the last command it ran output; queued, it outputs nothing. See command output.
You must control <object>, or it must be Link_OK and you must have the same owner, to trigger an attribute on it.
The triggered attribute is queued - the new action list is not run instantly. The action list is executed by <object>, not by the object using @trigger.
- @trigger switches: named arguments, spoofing, inline runs and registers
Switches
Section titled “Switches”- /args: Pass named arguments instead: each
<name>, <value>pair is read in the attribute as%<name>(see uargs()), and also by numbered value position starting at %0. With/match, the pairs follow the match string. - /spoof: If you control
<object>, enactor is preserved. - /inline: Run @triggered attribute immediately, rather than queueing it.
- /clearregs: Clear Q-registers before @triggering.
- /quiet: Don’t tell you “Triggered.”, as the QUIET flag does. trigger() uses it.
- /notify: Queue
@notify meonce the attribute is found, after its commands are queued (or have run, with /inline, /now or /inplace), so a@wait me=...runs then. It is queued even when the attribute is empty or /match finds nothing.
If /inline is given, the following switches can be used:
- /nobreak: If the @triggered attribute has @break or @assert, it won’t propagate up.
- /localize: Don’t let the @triggered attribute override your Q-registers.
/inplace is an alias for /inline/localize/nobreak. /now, TinyMUX’s spelling, is /inline.
The /match switch is explained in @trigger enactor and register behavior
Enactor and register behavior
Section titled “Enactor and register behavior”By default, the object using @trigger will be the enactor (%#) for the triggered attribute. However, if you control <object>, the /spoof switch can be used to preserve the current enactor. This is useful for global commands with @a* verb attributes.
Q-registers set at the time @trigger is run will be copied and made available in the triggered attribute, unless the /clearregs switch is given.
@trigger can execute obj/attrs that are $-commands or ^-listens. e.g:
> &SLAP object=$slap *=*:@emit %n slaps %0 around with a %1> slap himself=troutWalker slaps himself around with a trout> @trigger object/slap=himself,troutWalker slaps himself around with a troutNote that you have to pass %0 and %1 yourself. For some $-commands or listens, the pattern can get complex (especially with regexps!), so /match allows you to pass a command to match the pattern.
> @trigger/match object/slap=slap himself=troutWalker slaps himself around with a trout::: seealso
Trigger examples
Section titled “Trigger examples”> &GREET me=POSE waves hi.> @trigger me/GREETCyclonus waves hi.> &GREET me=POSE waves to %0! ; say Hi there, %1.> @trigger me/GREET=Gears, ArceeCyclonus waves to Gears.You say, "Hi there, Arcee."> &foo Globals=$foo *: @assert setr(0,locate(%#,%0,*))=@nspemit %#=Who? ; @nspemit %#=You foo [name(%q0)]. ; @trigger %q0/AFOO> &AFOO Bar=:is foo'd by %n!> FOO BARBar is foo'd by Globals!> &foo Globals=$foo *: @assert setr(0,locate(%#,%0,*))=@nspemit %#=Who? ; @nspemit %#=You foo [name(%q0)]. ; @trigger/spoof %q0/AFOO> FOO BARBar is foo'd by Cyclonus!