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
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Tue Jul 22, 2003 6:23 pm   

Question with UNTRIGGER
 
Ok, I have this script...

#TRIGGER {Diamonds %s (%d) * {Good Stores|Nearly Out!|Going Fast|Surplus!} %s Pearls %s (%d) * {Good Stores|Nearly Out!|Going Fast|Surplus!}} {
#VAR Diamonds %db( 0, Average)
#IF (%1 < @Diamonds) {#CW Diamonds Green}
#IF (%1 > @Diamonds) {#CW Diamonds Red}
#IF (%1 = @Diamonds) {#CW Diamonds Yellow}
#SUB {%1} {%1-@Diamonds}
#UNV %1
#Var Pearls %db( 4, Average)
#IF (%2 < @Pearls) {#CW Pearls Green}
#IF (%2 > @Pearls) {#CW Pearls Red}
#IF (%2 = @Pearls) {#CW Pearls Yellow}
#SUB {%2} {%2-@Pearls}
#UNV %2

------------------
It makes a sub trigger from %1 and %2. I want it to then delete this trigger.... I tried #UNVAR %1, #UNVAR @{%1}
But I cant get it to work...Any help would be great
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Tue Jul 22, 2003 6:59 pm   
 
Also, is there anyway to delete variables without it echoing to you that it is deleted?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jul 22, 2003 7:29 pm   
 
Why would you try #UNVAR to remove a TRIGGER?

If the messages annoy you, disable Echo Messages in Prefs. NOTE: This will disable all messages, not just ones about variables.

It's seldom necessary to delete a variable. In most cases, the same purpose can be served by setting it to an empty string or 0.
#VAR pearls ""

Similarly, it's seldom necessary to use #UNTRIGGER, especially from within a script. Instead use #TEMP to create a temporary trigger which will delete itself after firing once.
Reply with quote
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Tue Jul 22, 2003 8:05 pm   
 
quote:
Originally posted by LightBulb

Why would you try #UNVAR to remove a TRIGGER?

If the messages annoy you, disable Echo Messages in Prefs. NOTE: This will disable all messages, not just ones about variables.

It's seldom necessary to delete a variable. In most cases, the same purpose can be served by setting it to an empty string or 0.
#VAR pearls ""




Ok, one last thing then. This should make it that I don't have to delete it. When I make a class and inside that class it has a trigger that creates another variable or another trigger, they are made in the main class folder not the one the parent trigger was running in....

For instance I have a Market Class and in it is a trigger that creates a highlight trigger, but this new highlight trigger is made in the main root class folder... I want it in the MARKET class so when I disable the market class those new triggers are disabled as well.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jul 22, 2003 8:29 pm   
 
See my comment about #UNTRIGGER above. I edited my post while you were writing your response.

There are several ways to control which class settings are made in.
1. Many settings have a Class field in their syntax
#TR {something about the market} {#CO white} {Market} {Options}
2. The #CLASS command has a "setdef" option: "setdef" to make this the default class for triggers, aliases, etc. running within it
#CLASS Market {setdef}
3. The #CLASS command itself can be used within scripts
#CLASS Market;#TR {something about the market} {#CO white};#CLASS 0

The first method is the best choice, in my opinion.
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