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
ThunderHawk
Newbie


Joined: 28 May 2003
Posts: 8
Location: United Kingdom

PostPosted: Wed May 28, 2003 3:39 pm   

heh, another question
 
(PowerLevel (9,110/10,021) Energy (1/213) Lifeforce (1/100)) thats trigger. The condition is:
west;say return me;say healing
but the powerlevel varies after each time i kill a mob which is when i want this to come into play. I've tried: PowerLevel (%d/%d) but it didnt work. Could someoen please help?
Thanks
Reply with quote
ThunderHawk
Newbie


Joined: 28 May 2003
Posts: 8
Location: United Kingdom

PostPosted: Wed May 28, 2003 5:09 pm   
 
i even tried *Lifeforce (1/100)) but it didnt work...
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed May 28, 2003 5:58 pm   
 
%d is digits only, it doesn't recognize commas. Since your numbers use commas, you'll need to use the %n wildcard instead. ( and ) have a special meaning in trigger patterns. To use them as normal characters, precede them with ~.

#TR {PowerLevel ~(%n/%n~) Energy ~(%n/%n~) Lifeforce ~(%n/%n~)} {west;say return me;say healing}

LightBulb
Advanced Member
Reply with quote
ThunderHawk
Newbie


Joined: 28 May 2003
Posts: 8
Location: United Kingdom

PostPosted: Wed May 28, 2003 7:27 pm   
 
Thanks that helped a bundle...But now i am faced with a problem where it just keeps going. I want it to run once, and then stop without being deleted...Is that possible?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed May 28, 2003 8:30 pm   
 
Just add a control.
#TR {PowerLevel ~(%n/%n~) Energy ~(%n/%n~) Lifeforce ~(%n/%n~)} {#IF (@goheal = 1) {#VAR goheal 0;west;say return me;say healing}}

After you've finished healing, and want the trigger to work again, be sure to set the variable to 1.

LightBulb
Advanced Member
Reply with quote
ThunderHawk
Newbie


Joined: 28 May 2003
Posts: 8
Location: United Kingdom

PostPosted: Wed May 28, 2003 9:25 pm   
 
Will i have to keep doing that each time?
Reply with quote
ThunderHawk
Newbie


Joined: 28 May 2003
Posts: 8
Location: United Kingdom

PostPosted: Wed May 28, 2003 10:07 pm   
 
Pattern: PowerLevel ~(%n/%n~) Energy ~(1/%n~) Lifeforce ~(1/%n~))
value: #IF (@goheal = 1) {
#VAR goheal 0
west
say return me
say healing
}

but it wont work....If tried setting the #VAR goheal 0
to 1 and the @goheal to 0 but neither work...
Reply with quote
Virus
Wanderer


Joined: 29 Jun 2002
Posts: 69
Location: USA

PostPosted: Wed May 28, 2003 10:35 pm   
 
Try this. Ive noticed that you can have multiple variables when you use the #VAR command. IE if you do #VAR 5 15, 5 times in a row you now have 5 variables named 5 all holding the value 15. Instead once you have the 1 variable somewhere, use <variable name> = <value>. Works wonders. Heres what you should have I think.

#TR {PowerLevel ~(%n/%n~) Energy ~(%n/%n~) Lifeforce ~(%n/%n~)} {#IF (@goheal = 1) {goheal = 0;west;say return me;say healing}}

That should work.

Richard Powell
Mux Alias: Virus
2796 Wizard Staff
64.89.10.1 port 2796
Rich@gigdev.com
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed May 28, 2003 11:39 pm   
 
#VARIABLE does NOT create multiple variables when reusing the same variable name. Please don't spread misinformation.

varname = value is just another form of #VAR varname value. If #VAR 5 15 created multiple variables, then 5 = 15 would also. Fortunately, neither is true (although i think "5" is a very poor choice for a variable name).

ThunderHawk, is the original pattern a prompt? If so, change the trigger's Trigger On options to Prompt = checked, Newline = unchecked. Also be sure to create the variable by typing this at the command line.
#VAR goheal 1
Another thing you should check is the number of spaces between items. The forum only displays 1 space between items and that's what I used in making the trigger pattern. If there is actually more than one space, you'll need to adjust the pattern accordingly.

LightBulb
Advanced Member
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu May 29, 2003 4:07 am   
 
You have an unmatched parenthesis at the end of your pattern. You should either remove it or put a ~ in front of it.
PowerLevel ~(%n/%n~) Energy ~(1/%n~) Lifeforce ~(1/%n~))

Also, your trigger will only fire when both Energy and Lifeforce are 1 (no more, no less). There's nothing wrong with this, as long as it's what you want. It does make it easy to use another trigger to reset the variable after healing. The condition can be changed to suit yourself, the one I used resets the variable when Energy and Lifeforce both reach max. I've included the options to make this a prompt trigger, remove them if they aren't appropriate.
#TR {PowerLevel ~(%n/%n~) Energy ~((%n)/(%n)~) Lifeforce ~((%n)/(%n)~)} {#IF ((%1 = %2) AND (%3 = %4)) {#VAR goheal 1}} {} {nocr|prompt}

LightBulb
Advanced Member
Reply with quote
ThunderHawk
Newbie


Joined: 28 May 2003
Posts: 8
Location: United Kingdom

PostPosted: Thu May 29, 2003 7:03 pm   
 
Ok thanks for all your help. I'm kinda new at this so if you dont mind could you explain what i put where in zMUD 6.62?
This would be much appreciated
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu May 29, 2003 7:20 pm   
 
You put all of this in the command line.
#TR {PowerLevel ~(%n/%n~) Energy ~((%n)/(%n)~) Lifeforce ~((%n)/(%n)~)} {#IF ((%1 = %2) AND (%3 = %4)) {#VAR goheal 1}} {} {nocr|prompt}

Or, you can break it up into parts:
#TR push the Trigger button, then push New

{PowerLevel ~(%n/%n~) Energy ~((%n)/(%n)~) Lifeforce ~((%n)/(%n)~)} Put in the Pattern. Remove the { and } at the beginning and end.

{#IF ((%1 = %2) AND (%3 = %4)) {#VAR goheal 1}} Put in the Value. Remove the { and } at the beginning and end.

{} This is where the class would go, if the trigger was to be in a subclass. When using the editor, you select the appropriate subclass first and make the trigger there. It's blank, so no action is needed. I just included it as a space holder so I could get to the next field.

{nocr|prompt} The options, in this case nocr which means turn Newline off, and prompt which means turn Prompt on. Options are found on the Options tab.

The easiest method is to just paste the entire trigger to the command line. It doesn't require any explanation of which part goes where. That's why I use it.

LightBulb
Advanced Member
Reply with quote
ThunderHawk
Newbie


Joined: 28 May 2003
Posts: 8
Location: United Kingdom

PostPosted: Fri May 30, 2003 7:28 pm   
 
OK, so where does the west; say return me; say healing go?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri May 30, 2003 10:26 pm   
 
In the other trigger (the one you already had).

In other words, you should have TWO triggers.
#TR {PowerLevel ~(%n/%n~) Energy ~(1/%n~) Lifeforce ~(1/%n~)~)} {#IF (@goheal = 1) {#VAR goheal 0;west;say return me;say healing}
#TR {PowerLevel ~(%n/%n~) Energy ~((%n)/(%n)~) Lifeforce ~((%n)/(%n)~)} {#IF ((%1 = %2) AND (%3 = %4)) {#VAR goheal 1}}

Change the Newline and Prompt options if needed.

LightBulb
Advanced 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