 |
oldguy2 |
Posted: Fri Apr 11, 2008 12:47 pm
OnInput Delay |
 |
Larkin Wizard

Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Mon May 05, 2008 4:39 pm |
He -wants- the command input trigger to fire the other one, at least in this case.
|
|
|
 |
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Mon May 05, 2008 9:34 pm |
Right. The whole point of the delay script is to add all commands being entered or sent to a list and then send them with a delay.
So does this mean using an oninput is faster than an alias since you have to add a #wait command before adding the items?
Hmm, even just adding #wait with no time makes it work. Whats the difference between how the oninput adds the items and how the alias adds them? Why is a #wait needed? I'm curious because if it is going to cause problems I will change back to aliases. |
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Mon May 05, 2008 11:25 pm |
I think the problem really stems from your choice of priorites. If you make the delay oninput in the first priority it will catch the text you type. Next is the alarm to send it, minore structural changes there. Finally you can use oninput triggers to change what actually gets sent. I just ran a quick test of this stuff with 2.23
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<trigger type="Command Input" priority="20" copy="yes">
<pattern>a</pattern>
<value>#SUB d</value>
</trigger>
<trigger name="SlowMotionOutput" type="Command Input" priority="1" regex="true" copy="yes">
<pattern>(.*)</pattern>
<value>#if (@slowMotion) {
#noinput
#additem slowMotionList %1
}</value>
</trigger>
<trigger name="SlowMotionAlarm" type="Alarm" priority="2" copy="yes">
<pattern>*1</pattern>
<value>#T- SlowMotionOutput
#if (@slowMotion) {
#if (%numitems(@slowMotionList) > 0) {
#say {%item(@slowMotionList, 1)}
#send {%pop( slowMotionList)}
}
#T+ SlowMotionOutput
} {
#forall @slowMotionList {#send {%pop(slowMotionList)}}
#T- SlowMotionAlarm
}</value>
</trigger>
</cmud> |
You will notice my silly 'a' oninput trigger changes what is sent to a 'd', and this allows further triggers to examine it based on a d. I think using the combination of #NOINPUT and #SEND causes CMud to start another pass through all the triggers and that is not what you want. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
 |
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Tue May 06, 2008 1:04 am |
Well I will figure it out. Thanks. I seem to be irritating people so see you around.
|
|
|
 |
|
|