[PennMUSH] Trying to specify automated response via puppet/monitor

Talvo Hornblower talvohornblower at hotmail.com
Mon Jul 7 17:41:11 PDT 2008


Hi Sean,

The first problem is that you're trying to use MUSHcode in the 
command/listen pattern (the bit between $ and : for commands, or ^ and : for 
listens). All that accepts is wildcards and literal strings.

The easiest way to do what you want is probably to use the @break command to 
stop the listen from running, if the player triggering the listen meets 
certain criteria. For instance:

&arrive_trigger obj=^* has arrrived.: @break 
cor(hasflag(%#,Wizard),member(owner(me) #1 #2 #3,%#)) ; @wait ....

The @break command stops the commands that follow it from running if the 
argument given to it evaluates to true - in this case, if the triggering 
player (%#) is a Wizard, or is the owner of the object the code is on, or is 
#1, #2 or #3. Otherwise, the rest of the code will run.

Hope that helps,
Mike

(Incidently, you probably want tiny_booleans set to no - most PennMUSH code 
assumes it's that way, and so will most people familiar with playing on Penn 
games. For instance, a lot of PennMUSH code relies on dbrefs of 0 or above 
being true (#0, #1, etc), and negative dbrefs being false; #-1 and #-2 are 
returned by several functions as errors. But with tiny_booleans on all 
dbrefs are false.)

----- Original Message ----- 
From: "Sean Darby" <sean.darby at gmail.com>
To: <pennmush at pennmush.org>
Sent: Monday, July 07, 2008 8:42 AM
Subject: [PennMUSH] Trying to specify automated response via puppet/monitor


> Hi,
>
> I hope someone might be able to provide some input on this. I've created 
> two
> specific objects for someone at their request,  and would like for the two
> objects to react to players as they arrive, yet I do not want the two
> objects to react to each other.
>
> To get into context, they are two grey hound dogs located around the
> player's (character's) home. I originally set it up so the reaction of the
> two pets would simply be in one "room". I've since tried to have them move
> outside and return back to the room. They chase each other out and back, 
> so
> the complication in that so far is that when dog B returns after dog A, 
> then
> A reacts to B as an "^* has arrived.", hence beginning what appears to be 
> an
> infinite loop.
>
> Here's a copy/paste of what I have so far, including messed up sections
> copy/pasted below the 2 objects' info.
>
> Diamond(#4248TVwnMp)
> Type: THING Flags: VISUAL NO_WARN NO_COMMAND MONITOR PUPPET
> An older, muscley, taupe colored grey hound.
> Owner: Cloud(#4171PenA)  Zone: *NOTHING*  credits: 10
> Parent: *NOTHING*
> Powers:
> Warnings checked:
> Created: Sun Jul 06 19:06:22 2008
> Last Modification: Mon Jul 07 00:39:55 2008
> FOLLOWING [#1$icw]: #4171
> VA [#61]: (ncond(0,^*,1,#4249) has arrived.):@wait 2={:jumps up, barks at
> %N, and runs around them.};@wait 5={:sees Moxie and runs after
> her.;e;e;d;e;w;u;w;w};@wait 10={:runs back to his original spot and sits
> down.}
> Home: The Hills(#2773Rnt)
> Location: Front Yard(#4225Rnt)
>
> Moxie(#4249TVwnMp)
> Type: THING Flags: VISUAL NO_WARN NO_COMMAND MONITOR PUPPET
> A young, brindle colored, sleek looking grey hound.
> Owner: Cloud(#4171PenA)  Zone: *NOTHING*  credits: 10
> Parent: *NOTHING*
> Powers:
> Warnings checked:
> Created: Sun Jul 06 19:06:28 2008
> Last Modification: Sun Jul 06 23:54:30 2008
> FOLLOWING [#1$icw]: #4171
> VA [#61]: ^*(not(#4248)) has arrived.:@wait 4={:jumps up at Diamond's
> jumping up, barks at %N, and runs around them both.};@wait 7={:tries to 
> play
> with Diamond.;e;e;d;e;w;u;w;w};@wait 12={:runs back to her original spot 
> and
> sits down.}
> Home: The Hills(#2773Rnt)
> Location: Front Yard(#4225Rnt)
>
> This one, in #4248's &VA is obviously wrong:
> (ncond(0,^*,1,#4249) has arrived.)
>
> This one, in #4249's &VA is also obviously wrong:
> ^*(not(#4248)) has arrived.
>
> You can tell that I have yet to learn even basic programming. These 2
> horrible efforts are only 2 examples of a plethora of arrangements of () 
> {}
> etc., experimenting with if, else, ifelse, and various boolean approaches
> that I've tried.
>
> I should note that I did go in (I have a wizard account) and set the 
> config
> for "tiny_boolean" to "yes" (enabled). If it's recommended or suggested 
> that
> I turn it back off, I'll do it. What I understood was it alters the effect
> of negative numbers versus zero or positive numbers.
>
> There may be a few weird logistical corrections needed in some easier 
> steps,
> like the dog doing the chasing is currently the first one to run out. I'll
> just adjust the "wait" seconds. That's an easy one.
>
> Another is, I'd like to set it so the dogs don't react to multiple things,
> specifically: each other, their owner, and wizards... if at all possible.
> This would be nice, so that the dogs would jump and run only when the
> occasional player-types walk by.
>
> Thanks to any and all in advance for any input, advice, pointers, etc.!
>
> -Sean
> _______________________________________________
> PennMUSH mailing list
> PennMUSH at pennmush.org
> http://www.pennmush.org/mailman/listinfo/pennmush
> PennMUSH FAQ-o-matic! http://www.pennmush.org/cgi-penn/fom
> 



More information about the PennMUSH mailing list