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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
mortie
Wanderer


Joined: 26 Sep 2002
Posts: 73
Location: United Kingdom

PostPosted: Thu Sep 26, 2002 3:42 pm   

Trigger and adding the ID it
 
Hi,

below is an extract of a trigger which i have in a flat file

#TRIGGER {^Aardwolf Aura of Sanctuary%s(*)%s%p(%d)%s(*)%s%w%s%w} {serial_number=%%1;autoswapping_lvl=%%2;is_already_worn =%literal( %%3);#if ((@is_already_worn != @player_name_with_wornflag) & (@autoswapping_lvl <= @currentlevel) & (@autoswapping_lvl > @auralvl_already_worn)) {#say %ansi( blink, bright, white)Changing over aard equipment;get @serial_number @item_container;wear @serial_number;#if (@currentlevel != 1) {put @previous_aura @item_container};auralvl_already_worn = @autoswapping_lvl;previous_aura = @serial_number};serial_number="";autoswapping_lvl="";is_already_worn=""}

NB This may look messy here but its all on one line and works.

This is part of a bigger script which is kept in a flat file and i just copy and paste to zmud when i want to install it.

As it is it works fine and the trigger is properly installed with no variables/arguments missing.

However i needed to name this trigger among others using ID, for another part of my script to work.

So the above trigger looks like this

#TRIGGER "auratrig" {then the above syntax}

When i copy this to zmud all the variable names are missing so it trashes the trigger.

I found a work around and that is to use the ~ (tilda) infront of all the variable names. With this everything is copied across properly.

My question is, Why with the introduction of the name to the trigger statment do i have to add the tilda to every variable in it for it to copy across correctly. I want to understand the mechanics behind it.

Thanks

Mortie :)
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Sep 26, 2002 5:05 pm   
 
It looks like the answer is yes. However, if you use auratrig as a class instead of a label it will copy without modification.

#TRIGGER {^Aardwolf Aura of Sanctuary%s(*)%s%p(%d)%s(*)%s%w%s%w} {serial_number=%%1;autoswapping_lvl=%%2;is_already_worn =%literal( %%3);#if ((@is_already_worn != @player_name_with_wornflag) & (@autoswapping_lvl <= @currentlevel) & (@autoswapping_lvl > @auralvl_already_worn)) {#say %ansi( blink, bright, white)Changing over aard equipment;get @serial_number @item_container;wear @serial_number;#if (@currentlevel != 1) {put @previous_aura @item_container};auralvl_already_worn = @autoswapping_lvl;previous_aura = @serial_number};serial_number="";autoswapping_lvl="";is_already_worn=""} {auratrig}

LightBulb
Senior Member
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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