Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
freagin
Newbie


Joined: 16 Jun 2007
Posts: 6

PostPosted: Sat Jun 16, 2007 4:56 am   

Vendor walking script troublesl
 
Hi all,

I've just upgraded to CMUD v1.33, and most of my old scripts work. One i'm having problmes with is my vendor where script.

In zmud, what it did, in the bazar, you would type

vendor where freagin
You sense that 'Some store' may be located to the northwest.
nw (ie, move that direction)

Once you arrived at that shop, you'd see:
You are here.

Zmud code:
--------------------------
#alias vwhere {#var vendor "%1";#t+ vwhere;vendor where %1}
#class {vwhere} {disable}
#trigger {You sense that '*' may be located to the (%w).} {%1;#alarm +1 {vendor where @vendor}}
#trigger {^You are here.} {#t- vwhere}
#trigger {^You are not able to sense the direction of that vendor from your current location.} {#t- vwhere}
#class 0

Its supposed to work as:
vwhere freagin

...and walk you to the shop. As it is above, i get one move then 'vendor where %1'...which doesn't work.

If i change "%1" in line 1 to %1, it seems to walk further, but...seems to fast and get stuck in a direction.

Any ideas what I can change in ths? Hope this makes sense.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sat Jun 16, 2007 5:07 am   
 
"%1" is invalid there is no need to quote %nn in cmud, #EXECUTE might be needed to send the direction, And you should always name your alarms to avoid having duplicates etc.
I also changed the alias to use temporary variables! not that it was really needed it just looks cooler and makes more sense on reading it in the future.

Code:
#ALIAS vwhere($vendor) {#VAR vendor $vendor;#T+ vwhere;vendor where $vendor}
#CLASS {vwhere} {disable}
#TRIGGER {You sense that '*' may be located to the (%w).} {#EXEC {%1};#ALARM "vendalarm" {+1} {vendor where @vendor}}
#TRIGGER {^You are here.} {#T- vwhere}
#TRIGGER {^You are not able to sense the direction of that vendor from your current location.} {#T- vwhere}
#CLASS 0
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
freagin
Newbie


Joined: 16 Jun 2007
Posts: 6

PostPosted: Sat Jun 16, 2007 2:18 pm   Almost workded...
 
Thanks for your help. That almost worked...it seems to eho each direction 5 times....weird. Confused
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net