|
MisterDwooD Novice
Joined: 04 Feb 2014 Posts: 42
|
Posted: Tue Feb 04, 2014 7:09 am
Trigger for command on any input from user. |
I have a need to run a script, and then have it stop when I do anything that is sent to the mud. Any command at all, but the command I enter needs to go through.
So I have tried to use the OnInput command, but that actually overrides any command I do with the command that's specified. Is there a way to mirror the command enter, which will be also be the trigger, and have it go through?
I tried it sorta like this this:
#ONINPUT {{n|e|s|w|l|stat|score}} {}
That limits the commands that I can enter that will trigger, and I'm okay with that, but I'd rather it trigger on anything.
So.. "execute script" Script continues until I enter any command into the command line, the fact that I entered in a command triggers to stop the script, but then lets the command go through.
Anyways,
Thanks in advance.
- DW |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Tue Feb 04, 2014 9:16 am |
you can make an
#ONINPUT "anyKey" {*} {#T- anyKey}
that will trigger on anything, and turns itself off
you just need to turn it on before it will work with:
#T+ anyKey |
|
_________________ Discord: Shalimarwildcat |
|
|
|
MisterDwooD Novice
Joined: 04 Feb 2014 Posts: 42
|
Posted: Tue Feb 04, 2014 4:47 pm |
That's exactly what I do... except.
The script I'll be running is constantly triggering and inputting more commands. Not actually with me doing anything, but for example:
#ONINPUT "anyKey" {*} {#T- tempsigtrig;#T- sigwar;#T- anyKey} "Scripts|Slapsig"
#TRIGGER "tempsigtrig" {Tickle who~?} {tickle @ticklenow;#ALARM 5 {#T- "tempsigtrig"}} "Scripts|Slapsig"
That basically enters the tickle command, and if nobody is there to tickle, it enters it again until someone is there. When someone is there, it'll say something like, "You start to tickle...", and after 5 seconds, it'll stop the tickle trigger for nobody being there.
Because I want it to stop if I move a room, I want to trigger it to stop by entering a direction, or a command, but i want that command to go through, just like what you provided.
Unfortunately, the #ONINPUT is triggering off of the next tickle since nobody was there to be tickled, and then it's actually stopping the whole thing. Is there a way for it to trigger only on something that I put in and press enter? Maybe trigger off a hard return? I guess I could try to tickle a certain amount of times before moving to the next area to tickle, but, I'd rather have it go indefinitely, until I stop it.
Hopefully that's clear. Thanks Guys. |
|
|
|
MisterDwooD Novice
Joined: 04 Feb 2014 Posts: 42
|
Posted: Tue Feb 04, 2014 10:12 pm |
Alright..
So the dots sorta connected and i figured I could just use this
#ONINPUT "anyKey" {{n|e|s|w|l|stat|score}} {#T- tempsigtrig;#T- sigwar;#T- anyKey} "Scripts|Slapsig"
#TRIGGER "tempsigtrig" {Tickle who~?} {tickle @ticklenow;#ALARM 5 {#T- "tempsigtrig"}} "Scripts|Slapsig"
But then that is triggering on the "e" in tickle. So, if I"m sitting there trying to tickle someone, when it's send "tickle" it stops the trigger.
Is there anyway to have it send Tickle, but only trigger on "e" when it's by itself, as if moving east? The "l" in tickle is also triggering it.
Hmm.. It looks like this would work... :)
#ONINPUT "anyKey" {^{n|s|e|w|l|look|score|stat|f|flee}$} {#T- tempsigtrig;#T- sigwar;#T- anyKey} "Scripts|Slapsig"
#TRIGGER "tempsigtrig" {Tickle who~?} {tickle @ticklenow;#ALARM 5 {#T- "tempsigtrig"}} "Scripts|Slapsig"
Any way to clean that up at all? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Tue Feb 04, 2014 11:32 pm |
Um... im not sure how your alarm is working usally its +5 -5 *5, not sure if jjust the number is treated a positive or what.
but otherwise... i don't see anyway to make it less verbose |
|
_________________ Discord: Shalimarwildcat |
|
|
|
MisterDwooD Novice
Joined: 04 Feb 2014 Posts: 42
|
Posted: Wed Feb 05, 2014 5:06 am |
Exactly. I ended up using +7 for the alarm. Other than that, it seems to be working perfectly. I didn't use the {+|-} at first and it was creating tons of repeating triggers.. haha. was crazy, I had to show triggers in parsing to see what it was doing. But I got it figured out.
I appreciate your help! |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Wed Feb 05, 2014 5:51 pm |
Check out %q. This wildcard was designed directly to deal with the e in tickle.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: Wed Feb 05, 2014 7:56 pm |
not really needed with the anchors in place, but very useful when you want to honor whole word boundries
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|