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
n30b1u3dr4g0n
Beginner


Joined: 14 Sep 2004
Posts: 18
Location: USA

PostPosted: Wed Sep 15, 2004 5:47 pm   

Experience Trigger
 
Ok, I know this is my second...or...ermm..third post. Whatever, anyway. I've got another trigger question that I'd like help on. I'm still playing LoK, and still using zMud 7.05 (trial version). What I'd like, is everytime I kill a creature, I want it to spit out via a group tell (1)how much experience I got, and (2)how much experience I need until my next level. I've tried doing the first (1) part of the trigger like this, without any success...

#TRIGGER {You receive (%d) experience points.; #VAR (%d) %1} {gt --->%1 XP<---}

and it just didn't want to work...I don't know...it's really wierd. Can someone please help me with it? Thanks!

The Jack@$$ zMud n00b
_________________
On wings of death, I swoop down and devour the souls of my enemies, laying waste to all I see, turning stone to ashe, and ashe to death.
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Wed Sep 15, 2004 6:03 pm   
 
The problem is you are using %d in the wrong place.
The %d is used for patten matching.
Quote:

%d match any number of digits (0-9)


The correct is:
Code:

#TRIGGER {You receive (%d) experience points.} {#VAR @exp %1; gt -->@exp XP <--}

I am not sure about the part with the gt on your mud, but the part you may want to look at is how to create variables in the help file.
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Reply with quote
n30b1u3dr4g0n
Beginner


Joined: 14 Sep 2004
Posts: 18
Location: USA

PostPosted: Wed Sep 15, 2004 7:25 pm   
 
Ok.....I'm still having a whole lot of trouble with this code. I put in everything you told me to and tried it out. And it doesn't want to work. See the following example below for the way it looks in my trigger editor:

================================================
Pattern: You receive (%d) experience points.
Value:
#VAR @exp %1; gt -->@exp XP<--
--------------------------------------------
gt -->@exp XP<--
^ syntax error
================================================

And then this is what the mud puts out to me:

==========================================================
<<prompt omitted>> kill dog

Your punch decimates a small street dog! [27]
Your punch MASSACRES a small street dog! [50]
A small street dog is covered in blood.

<<prompt omitted>>

You dodge a small street dog's attack.
Your punch *** DEVASTATES *** a small street dog! [63]
A small street dog is DEAD!!
You receive 0 experience points.
gt -->@exp XP<--
A small street dog spills his guts all over the floor.

<<prompt omitted>> You tell the group '-->@exp XP<--'
==========================================================

I'm sure you can see my command echo's. The red highlighting is where, I believe I'm having my problem. Because the syntax error in the trigger box, and the error that the mud puts out match up....how do I fix this?
_________________
On wings of death, I swoop down and devour the souls of my enemies, laying waste to all I see, turning stone to ashe, and ashe to death.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Thu Sep 16, 2004 12:33 am   
 
change this #VAR @exp %1; gt -->@exp XP<-- TO THIS #VAR exp %1; gt -->@exp XP<--
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Thu Sep 16, 2004 12:59 pm   
 
OOPS. I miss typed the line for the variable.
As for the group tell syntax error just make sure you have the correct alias for the group tell.
What mud is this?
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Reply with quote
n30b1u3dr4g0n
Beginner


Joined: 14 Sep 2004
Posts: 18
Location: USA

PostPosted: Thu Sep 16, 2004 5:10 pm   
 
This would be for the mud: The Legends of Krynn

which is located at: legendsofkrynn.wolfpaw.net, port 6100.

And this is what I'm getting now:

I typed the trigger into the command prompt of zMud via:

#TRIGGER {You receive (%d) experience points.} {#VAR exp %1; gt {Y---->{C@exp XP {Y<----{x}

And this is the trigger window:

=============================================
Pattern: You receive (%d) experience points.
Value:

{#VAR
----------------------
{#VAR
^ syntax error

=============================================

And this is what I'm getting through the mud:

<<prompt omitted>> kill beggar
Your flaming bite === OBLITERATES === a helpless beggar! [81]
A helpless beggar is burned by a flaming whip.
A helpless beggar is blinded by smoke!
A helpless beggar is covered in blood.


<<prompt omitted>>
Your flaming bite === OBLITERATES === a helpless beggar! [80]
A helpless beggar is DEAD!!
You receive 0 experience points.

{#VAR
You hear a helpless beggar's death cry.
You get 18 gold coins and 2 steel coins from the corpse of a helpless beggar.

<<prompt omitted>> Huh?


------------------------------------------------------------------------------------------------

What should I do?! I'm so lost!

The Jack@$$ zMud n00b
_________________
On wings of death, I swoop down and devour the souls of my enemies, laying waste to all I see, turning stone to ashe, and ashe to death.
Reply with quote
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Thu Sep 16, 2004 5:25 pm   
 
That usually happens because of a space issue. You need to put a space after the {.
Code:
#TRIGGER {You receive (%d) experience points.} { #VAR exp %1; gt -->@exp XP <-- }
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Sep 16, 2004 6:11 pm   
 
The problem is that you are using one of zMUD's grouping characters, }, to insert colors. You can do this, but you have to use a ~ to tell zMUD to ignore the character and send it to the MUD as though it were an ordinary character. You should also do this with the <> characters since they are also used by zMUD.

#TRIGGER {You receive (%d) experience points.} {#VAR exp %1;gt ~{Y----~>~{C@exp XP ~{Y~<----~{x}

Next time, I suggest you get the basic trigger working before you try to get fancy by adding colors, ---> arrows before and after <---, and the like.
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
n30b1u3dr4g0n
Beginner


Joined: 14 Sep 2004
Posts: 18
Location: USA

PostPosted: Thu Sep 16, 2004 9:48 pm   
 
unfortunately, I'm at my...ermm..yeah...my significant other's house, and I'll have to try the things you've told me about tomorrow, but I really appreciate your help. If I can get to it tonight, I will. Thanks everyone for helping 'The Jack@$$ zMud n00b' learn how to program properly in the new zMud 7.05! Smile
_________________
On wings of death, I swoop down and devour the souls of my enemies, laying waste to all I see, turning stone to ashe, and ashe to death.
Reply with quote
n30b1u3dr4g0n
Beginner


Joined: 14 Sep 2004
Posts: 18
Location: USA

PostPosted: Fri Sep 17, 2004 3:59 pm   
 
Ok Lightbulb. I did it your way and it didnt work. Here's the specs on what happened.

Typed the trigger in as:
#TRIGGER {You receive (%d) experience points.} {#VAR exp %1;gt ~{Y----~>~{C@exp XP ~{Y~<----~{x}

Trigger Settings Box Reads:
============================================
Pattern: You receive (%d) experience points.
Value:
#VAR exp %1
gt ~{Y----~>~{C@exp XP ~{Y~<----~{x
============================================

No syntax erros as I'm sure you can see....BUT! This is what the mud puts out:

<<prompt omitted>> Your cleave === OBLITERATES === a sailor! [89]
Your slash
>>> ANNIHILATES <<< a sailor! [113]
You swing your blade down upon a sailor's head, splitting it open.
a sailor's brains pour out of his forehead.
A sailor is DEAD!!
You receive 0 experience points.

gt {Y---->{C@exp XP {Y<----{x
You hear a sailor's death cry.
You get 238 gold coins and 4 steel coins from the corpse of a sailor.

<<prompt omitted>> You tell the group '
---->@exp XP <----'

And...I'm still lost...but I'm pretty sure what it is...is that I haven't set up the #VAR for @exp yet.....and if this is the case, remind me how I'm supposed to do it, please. Thanks!
_________________
On wings of death, I swoop down and devour the souls of my enemies, laying waste to all I see, turning stone to ashe, and ashe to death.
Reply with quote
Falan
Wanderer


Joined: 17 Aug 2004
Posts: 98
Location: OK, USA

PostPosted: Sat Sep 18, 2004 7:00 am   
 
Your trigger matches this pattern

"You receive 0 experience points."

and the #VAR exp is created with a value of 0. Any further matches will update the variable with the %1 value.

The script worked for me. What happens if you type "#SH @exp"? (w/o quotes)
_________________
zMUD 7.05a
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Sep 18, 2004 1:53 pm   
 
Then I suggest you take my advice:
"Get the basic trigger working before you try to get fancy by adding colors, ---> arrows before and after <---, and the like."

The trigger creates the variable before sending the gt, so my guess is that you've changed your variable character to something other than @. You don't need the variable, just use %1.
#TRIGGER {You receive (%d) experience points.} {gt ~{Y----~>~{C%1 XP ~{Y~<----~{x}
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
n30b1u3dr4g0n
Beginner


Joined: 14 Sep 2004
Posts: 18
Location: USA

PostPosted: Sat Sep 18, 2004 4:39 pm   
 
OK! My xp trigger finally works! Thanks for all the help guys and gals! Now, let's see about getting my gauges to work! Thanks again! Very Happy
_________________
On wings of death, I swoop down and devour the souls of my enemies, laying waste to all I see, turning stone to ashe, and ashe to death.
Reply with quote
Backu
Novice


Joined: 24 Feb 2003
Posts: 36
Location: USA

PostPosted: Sat Sep 18, 2004 5:02 pm   
 
Someone may say this is wrong, but put a space between the C and the @
_________________
-Backu Zethara
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Sep 18, 2004 10:01 pm   
 
Backu,
Yes, that's wrong.

n30b1u3dr4g0n,
What turned out to be the problem? Or, if you don't know that, what fixed the problem? The answer is likely to help in solving other things which are giving you trouble, so it would be nice if you shared it with us.
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
n30b1u3dr4g0n
Beginner


Joined: 14 Sep 2004
Posts: 18
Location: USA

PostPosted: Mon Sep 20, 2004 1:47 pm   
 
I think each and everyone of you are going to hate me on this....but...ermm..well...I didn't know my little cousin liked to play muds and he saw I had zMud on my computer one day. Well....he doesn't like to play with the default special characters checked to be used in the prefs...so he turned the @ symbol off in the special character preferences. And after we used the %1 for my xp trigger, and I couldn't get our (as in all of us) buttons to work for the hp/mana/move gauges. I went and checked. I noticed it unchecked and called my cousin. He told me he forgot to recheck the @ symbol and was very sorry... I'm sorry about that as well...I feel stupid for not checking sooner...

The Jack@$$ zMud n00b
_________________
On wings of death, I swoop down and devour the souls of my enemies, laying waste to all I see, turning stone to ashe, and ashe to death.
Reply with quote
Thrillhouse8
Beginner


Joined: 21 Sep 2004
Posts: 18

PostPosted: Tue Sep 21, 2004 2:12 am   
 
Wouldn't the brackets < > also alleviate that problem around @exp? As in:

#TRIGGER {You receive (%d) experience points.} {#VAR exp %1;gt ~{Y----~>~{C<@exp> XP ~{Y~<----~{x}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Sep 21, 2004 4:20 pm   
 
No. If the @ symbol isn't in use, then @exp isn't a variable. It doesn't matter whether you put <> around it or not, it's still not a variable.

Using <> in a #TRIGGER command causes zMUD to expand the variable while making the trigger, which isn't what's desired. The intention is to have the variable expanded when the trigger fires, not when the trigger is made, and that's what it does without the <>. There's nothing wrong with the trigger, the problem was in neo's Preferences.
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
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