Quote:
Seems to me, you may end up building a scripting language of your own, as you add more and more actions that can be done directly with the "Send" box. That's more to learn for the newbie, and I don't know if that is such a good thing.
There was a recent post from someone who wanted to detect a spell cast with a trigger, and tell himself 30 seconds later when it had worn off. At present you can only do that by:
- Making a trigger to match the text - OK, so far so good
- The trigger calls a script
- The script adds a timer with AddTimer
- The timer calls a second script
- The second script does a world.note
- Plus, maybe he has to enable scripting, and create a script file, and point the scripting configuration to that file
This seems like a lot of work for what he wanted to do. My proposed solution would be something like this:
Trigger: You have cast spell *!
Send: 30 >N ; Your spell has worn off!
Send to: Delayed send
A lot simpler and easier to explain, I think.
Quote:
For instance I am using ` (the symbol above ~) for command stacking because both ; and : are used for types of emotes on channels. Not to mention that : is far more commonly used for other purposes in normal chat, tells, etc. than ;
I understand that for command stacking, but as I was trying to describe, only the first instance of the delimiter would have any effect, and then only on the "delayed send" option. For example, to send a semicolon you would just do it like this:
30 ; ; sighs
The first one is the "time -> message" delimiter, the second and subsequent ones are just part of the message.
However I am happy to use one that is less likely to confuse, such as ~
Right now I am out of string space in the world file, and until that is revamped I need a fixed delimiter. Later on it could be made variable, although that conceivably would cause problems for people who share triggers, and use different delimiters. :)
Quote:
I would suggest however also making it so that any command directly entered into the command window or through macros would override any queued commands in the delay list, since you may need to react suddenly to something and having to wait for all of them to process before using another one could be very bad.
I am using timers for this purpose for this reason, not the queued commands previously used for speedwalks. For speedwalking, I assumed that you would want to get to your destination before doing whatever it was you wanted (eg. buy bread) however for delayed commands, I assume that this is not an issue. Thus, the example of "your spell has worn off" is simply added as a timer, which will fire in (say) 30 seconds, however you can still do other things in the 30 seconds.
Quote:
Being able to send a note or similar is definitely interesting though, but again I would suggest \>, since that is much less likely to be used than -> or > as part of the normal text people will want to send.
Again, this delimiter would only apply in the first part of the message. Thus you could do this:
30 >N ; --->Note: your spell has worn off; run away <---
Note how the >N only has effect before the semicolon, and only the first semicolon has any meaning. I think this is fairly bulletproof.
Quote:
NOTE!! (a bug I forgot to report): I even had to set the immediate script command to ## because A) I use / sometimes where it might be mistaken for a script request (in things like 'to tell') and B) a bug I resently came across in MUSHclient treated a single # as a command request, even though it was part of the same continuous line. Looks like it incorrectly used the line break where the text wrapped as a hard break, instead of as a wrap like it should have. i.e.
---------------------------------------------------------
|tell someone I have found a nice whatever at E-Bay item|
|#24826487. |
---------------------------------------------------------
produces a tell of the first line 'and' an error saying that it couldn't execute the non-existant script routine called 24826487. This is as I said easy to fix by making immediate commands start with ## instead of # or the default /, but it is definitely a glitch. ;)
I cannot reproduce that. I have tried three possibilities:
- Hard wrap (Ctrl+Enter in command window):
# script line 1 (newline)
script line 2
In this case the single script character makes the whole multi-line command be treated as a script.
- Soft wrap (narrow window)
say hi there someone (wrap at window edge here)
#world.note "blah"
World displays:
You say in human 'hi there someone #world.note "blah"'
- Multi-line command, with script on second line
say hi there someone (newline)
#world.note "blah"
Script prefix is ignored, as it is only tested at the start of the command window, not on a per-line basis. |