@force #118={@dig %1=[escape(%4)],[escape(%5)]};@wait #118={@force
#118={@parent [where([lastcreate(#118)])]=%2}};@notify #118;@wait
#118={@force #118={@set
[where([lastcreate(#118)])]=d.description:[escape(%3)]}};@notify #118
...and so on and so forth.
I'm doing it this way because I assumed that if I did so, it would queue
up the commands in order, not starting the next until the last was
complete. I -tried- putting the @dig command into a @wait, but then it
didn't work at all.
What I'm finding is that some commands are going out of queue, and it's
screwing everything else up.
I'm wholly confused as to why this would be so. Any advice would be
appreciated. I just want the object to run its commands, completely and
with all effects realized, in order.
--->Ben
Let me explain:
I'm finding that, without any sort of @wait going on, some commands
aren't being fully effected in order. For example, lastcreate() isn't
working reliably on following commands, I'm guessing because the @dig is
still digging.
So, let's say I want to have a bunch of commands be evaluated, and be
-definitely- complete before the next commands are evaluated.
How do I do that?
--->Ben
1 second: Command 1
3 seconds: Command 2
5 seconds: Command 3
...or...
1 second: Command 1
3 + 1 = 4 seconds: Command 2
5 + 3 + 1 = 9 seconds: Command 3
I'm very much hoping to avoid this solution, because it seems to me that
there must be -some- way to force commands to operate distinctly and
completely in the queue.
However, if I can't figure that out, I'll try your approach. Thank you!
--->Ben
--->Ben
An example would be:
&CMD-DIG #123=$+dig */*=*,*=*:@switch/first 0=valid(roomname,%0),@pemit
%#=That's a silly name for a room!,valid(exitname,%2),That's a silly name
for an entry exit!,valid(exitname,%3),That's a silly name for a return
exit!,isdbref(%1),@pemit %#=I can't find that room parent!,{&NULL
me=[setq(1,create(eval(%0),10,r))][setq(2,create(%2,1,e))][setq(3,create(%3,1,e))];@parent
%q1=%1;@link %q2=%q1;@desc %1=%4;@link %q3=%l;@teleport %q2=%l;@teleport
%q3=%q1;@pemit %#=You dug a new room named "[eval(%0)]" %(%q1%) parented to
[name(%1)] %(%1%).}
@set #123/cmd-dig=no_parse
Usage: +dig <room name>/<parent db#>=<entrance>,<return>=<description>
That would dig the room and open the exits, link the exits, teleport them to
the correct place, and parent the room to the specified dbref#. The no_parse
flag means the exit names and room description will be set without being
evaluated, while the inclusion of the eval() function around the room name
segments of the code will allow people to use ANSI color in the room name.
Or you could remove that ability and just make the whole thing no_parse, in
which case the code would look like:
&CMD-DIG #123=$+dig */*=*,*=*:@switch/first 0=valid(roomname,%0),@pemit
%#=That's a silly name for a room!,valid(exitname,%2),That's a silly name
for an entry exit!,valid(exitname,%3),That's a silly name for a return
exit!,isdbref(%1),@pemit %#=I can't find that room parent!,{&NULL
me=[setq(1,create(%0,10,r))][setq(2,create(%2,1,e))][setq(3,create(%3,1,e))];@parent
%q1=%1;@link %q2=%q1;@desc %1=%4;@link %q3=%l;@teleport %q2=%l;@teleport
%q3=%q1;@pemit %#=You dug a new room named "%0" %(%q1%) parented to
[name(%1)] %(%1%).}
Hope this helps!
--------------------------------------------------
From: "Ben Trafford" <b...@prodigal.ca>
Sent: Sunday, December 27, 2009 11:00 AM
To: <tin...@googlegroups.com>
Subject: [TinyMUX] Command queue oddness.
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.722 / Virus Database: 270.14.121/2589 - Release Date:
> 12/27/09 03:18:00
>
&CMD-DIG me=$+dig */*=*,*=*:@switch/first 0=valid(roomname,%0),@pemit
%#=That's a silly name for a room!,valid(exitname,%2),That's a silly name
for an entry exit!,valid(exitname,%3),That's a silly name for a return
exit!,isdbref(%1),@pemit %#=I can't find that room parent!,{&NULL
me=[setq(1,create(eval(%0),10,r))][setq(2,create(%2,1,e))][setq(3,create(%3,1,e))];@parent
%q1=%1;@link %q2=%q1;@desc %q1=%4;@link %q3=%l;@teleport %q2=%l;@teleport
%q3=%q1;@pemit %#=You have dug a new room called "%0" %(%q1%) parented to
[name(%1)] %(%1%).}
(Previous version was setting the desc on the parent not the newly created
room.) So much for poorly watched test runs!
--------------------------------------------------
From: "Amy Kretzer" <ma...@stjoelive.com>
Sent: Sunday, December 27, 2009 11:03 PM
To: <tin...@googlegroups.com>
Subject: Re: [TinyMUX] Command queue oddness.
Thank you for your help!
--->Ben
I've bug-tested the hell out of the code. It's really the only answer
I've come up with.
--->Ben
I'll give it a shot and tell you how it goes.
Thanks!
--->Ben
So, back to my original question -- is there any way to force commands
to operate, completely, in sequence, including evaluating all internal
functions to said command (such as @parent where(lastcreate())), etc.)?
--->Ben
On Mon, 2009-12-28 at 01:12 -0600, Robby Griffin wrote:
Sometimes the brackets are just unnecessary line noise because you're already in a function-evaluating context, such as when creating an argument to pass to another function. When you really need brackets, like in the middle of a string, you can escape them, or just avoid @force and other queue-manipulating commands altogether.
I haven't tested this, but I'm guessing the following does what your original example intended:
@force #118={@dig %1=%4,%5; @parent where(lastcreate(me))=%2; &d.description where(lastcreate(me))=%3}
(and if this is already in a $-command on #118 itself, of course the @force is unnecessary as well).
--Alierak
I'll try work around the quirks. We'll see what happens.
It'd be -really- damned nice if there was some sort of command or
bracketing structure to force full evaluation of its contents. I keep
expecting softcode to act like Lisp...and then it doesn't, and I cry. :(
Thanks again!
--->Ben
Thanks for your help, everyone!
--->Ben
On Mon, 2009-12-28 at 01:56 -0600, Robby Griffin wrote:
--->Ben