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


Joined: 16 Aug 2007
Posts: 28

PostPosted: Thu Sep 01, 2011 5:12 pm   

Newbie Need Help
 
Problem: This is suppose to show up on my status bar and it is applied to a golden ring. It has 5 uses, and I want it to count down after each use so for example a new ring that has five uses on it when I type RENEW I get the wording of "Your Golden Ring Glows Momentarily. This is when the 5 showing on the status bar should go down to 4 and so forth. Once it gets down to 4 uses which would actually show on the status bar 1, I will type rreset and it will change the value back up to five once the ring is fully charged again.
It shows on the status bar correctly but it isn't counting down. Also my hp/sp is not updating as it should. Below the first part will be the hp/sp stuff I have.

1st Alias:

NAME: recall
~recall;#RECALL

2nd Alias:

NAME: rreset

#var rcount 5

1st Trigger

PATTERN: Your Golden Ring glows momentarily.

#cw pink
#var rcount [@rcount-1]

VAR:
NAME: recount
VALUE: 5
--------------------------------------------
HP/SP

Variables

1st: Name: chp Value 274
2nd: Name: mhp Value 274
3rd: Name: csp Value 178
4th: Name: msp Value 178

Trigger:
PATTERN: You have (%d)/(%d)hp, and (%d)/(%d)sp

#var chp %1;#var mhp %2;#var csp %3;#var msp %4;#gag


My custom status bar shows this:

@chp/@mhp @csp/@msp Target-@target Ring Uses Left-@rcount

I do not understand what I am doing at all. The help files read to me like a foreign language. Could someone help me?

Here are the mud text response on the ring:

When I use it I type renew then the mud will display this on my screen: Your Golden Ring glows momentarily.

When the ring regenerates itself one at a time it will show this text:
The Golden Ring glows on your Finger. And there is one more not sure which it does which says "The Golden Ring feels warmer on your finger."
Reply with quote
TerryG
Beginner


Joined: 16 Aug 2007
Posts: 28

PostPosted: Thu Sep 01, 2011 6:03 pm   
 
right now when the status bar shows the "Ring Uses Left 5" and I type renew to use the ring, it goes down to 0 instead it should be at 4.

PASTE FROM MUD:

renew

Your Golden Ring glows momentarily.
<282/186>

Status Bar: 274/274 178/179 Target-@target Ring Uses Left 0 (it showed 5 before I used the ring, 0 when I used the ring)

ring just healed once and from the mud it said: The Golden Ring feels warmer on your finger. but status bar still shows 0

also notice the status bar hp/sp didn't update
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Thu Sep 01, 2011 8:41 pm   
 
Well, one problem is that
Quote:
#var rcount [@rcount-1]

should be
Quote:
#var rcount (@rcount-1)


For your other problem, have you set your prompt trigger (which is grabbing hit points, etc) to TRIGGER ON PROMPT?
Reply with quote
TerryG
Beginner


Joined: 16 Aug 2007
Posts: 28

PostPosted: Thu Sep 01, 2011 11:16 pm   
 
Rahab wrote:
Well, one problem is that
Quote:
#var rcount [@rcount-1]

should be
Quote:
#var rcount (@rcount-1)


For your other problem, have you set your prompt trigger (which is grabbing hit points, etc) to TRIGGER ON PROMPT?


Ok so I changed the brackets like you showed and it worked but not understanding about the hp/sp part at all. Could you tell me like if your typing to a very green noob?

In game if i type set prompt it shows hp/sp in the game window, set prompt again it turns it off. I tried to turn it off but this didn't help.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Fri Sep 02, 2011 12:23 am   
 
When you edit the trigger in the package editor, there's a bunch of checkboxes at the bottom of the screen (you may have to click the more button to bring these up). One of the checkboxes is trigger on prompt, check it (you'll probably want to uncheck trigger on newline too).
Reply with quote
TerryG
Beginner


Joined: 16 Aug 2007
Posts: 28

PostPosted: Fri Sep 02, 2011 1:46 am   
 
checked Trigger on prompt and unchecked trigger on newline. There is also a box checked that says trigger on trigger. It isn't working still.
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Fri Sep 02, 2011 2:24 am   
 
Let's get a clearer picture what's going on. Are you manually typing something to get our hp/sp reported, is it part of your command prompt, or is it a separate line that is sent with the prompt or in regular intervals?

When you say the status bar isn't updating hp/sp, are the variable updating? If you type "#ECHO @chp @csp" on the command line, does it display the correct information, or the same outdated information as in the status bar? Outdated information indicates the pattern is not matching correctly.

You may try tweaking your pattern as such:
Code:
#TR {^You have &chp/&{mhp}hp, and &csp/&{msp}sp} {#GAG}


The &Var syntax in a trigger pattern will assign the matching value to @Var. The {} are necessary for the maximums so that the system knows where the variable name ends and the pattern begins. The ^ will anchor the pattern to the beginning of the line. This is a generally good idea for all patterns that always start at the beginning of the line because, among other reasons, it will prevent other players from spoofing MUD text to mess with your scripts.

Note for the noob: When quoting your code on these forums, it will help us see your settings if you copy and paste the XML from the Package Editor (click the XML tab at the bottom of the window of the where you type in the code), and also use the [code](paste XML code here)[/code] flags to set it off from the rest of the text.
_________________
.geniusclown
Reply with quote
TerryG
Beginner


Joined: 16 Aug 2007
Posts: 28

PostPosted: Fri Sep 02, 2011 3:48 am   
 
Thank you geniusclown I must be tired because your post is way over my heard right now.

I just wanted my hp/sp to show up on the status bar and update as it increases or decreases. Nothing more than that.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Fri Sep 02, 2011 1:31 pm   
 
What he was asking is this: You say that the status bar does not update. Have you checked whether the values of the variables used in the status bar have updated, or are the variables giving the same value as displayed in the status bar?

There are two possibilities here: 1) The variables are updating, but the status bar is not. 2) The variables are not updating, and the status bar is simply displaying what is in the variables. If (2) is true, then your trigger is not matching the lines from your mud, and you simply need to fix the trigger pattern to match correctly. This is the most likely problem. If (1) is true, something odd is going on.
Reply with quote
TerryG
Beginner


Joined: 16 Aug 2007
Posts: 28

PostPosted: Fri Sep 02, 2011 3:34 pm   
 
Double post


Last edited by TerryG on Fri Sep 02, 2011 3:36 pm; edited 1 time in total
Reply with quote
TerryG
Beginner


Joined: 16 Aug 2007
Posts: 28

PostPosted: Fri Sep 02, 2011 3:35 pm   
 
This is what I have showing
I tried putting the pattern in what he showed me but it didn't work unless I did that wrong. First part is the variables listed, 2nd part is the trigger I have, and the last one is the status bar:

Code:
<var name="chp" id="220">282</var>
<var name="csp" id="223">186</var>
<var name="mhp" id="221">282</var>
<var name="msp" id="226">186</var>

<trigger priority="1580" newline="false" prompt="true" id="158">
  <pattern>You have (%d)/(%d)hp, and (%d)/(%d)sp</pattern>
  <value>#var chp %1;#var mhp %2;#var csp %3;#var msp %4;#gag
</value>
</trigger


 <value>@chp/@mhp   @csp/@msp     Target-@target         Ring Uses Left-@rcount</value>
Reply with quote
TerryG
Beginner


Joined: 16 Aug 2007
Posts: 28

PostPosted: Fri Sep 02, 2011 3:43 pm   
 
here is a link of a screen cap to show you. Notice the sp didn't change on status bar to reflect the decrease by a few little hit points

http://i29.photobucket.com/albums/c271/Lera213/cmudscreencap.jpg
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Fri Sep 02, 2011 3:47 pm   
 
Is it just the status bar that isn't updating, or the variables too? Rahab gave you two possibilities, you never said which is happening...
Reply with quote
TerryG
Beginner


Joined: 16 Aug 2007
Posts: 28

PostPosted: Fri Sep 02, 2011 3:48 pm   
 
sorry number 2 I believe is the case, yep just checked and the variables are staying the same no changing.

So what is the trigger and what do I place in the value and do I have to delete the variables too? See I don't know what to put what where.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Fri Sep 02, 2011 4:07 pm   
 
We can't tell you what the problem with the pattern is without seeing the line from the mud that you're trying to match. I don't see anything in the screenshot you posted that resembles your pattern...
Reply with quote
TerryG
Beginner


Joined: 16 Aug 2007
Posts: 28

PostPosted: Fri Sep 02, 2011 4:13 pm   
 
When I test the pattern it says it matches. *sigh* Any suggestions?
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Fri Sep 02, 2011 4:22 pm   
 
Hmm, I don't see anything wrong with the code...does it gag the line at least? If it gags the trigger is firing...in that case, if I had to guess, I'd say you have duplicate variables, and the trigger is updating one set while the status bar reads from the other, you might want to check for that too. There's a useful search box in the package editor that you could use to find duplicates quickly.
Reply with quote
TerryG
Beginner


Joined: 16 Aug 2007
Posts: 28

PostPosted: Fri Sep 02, 2011 4:34 pm   
 
yes it is gagging the line, I try to figure out duplicates that might be it.
Reply with quote
TerryG
Beginner


Joined: 16 Aug 2007
Posts: 28

PostPosted: Fri Sep 02, 2011 4:59 pm   
 
I only have 6 variables listed so I don't see any duplicates.

The problem has to be with variables. This by the way worked when I was using Zmud.
Reply with quote
PermaLost
Newbie


Joined: 22 Mar 2008
Posts: 2

PostPosted: Sat Sep 03, 2011 3:54 am   
 
A few triggers for the golden ring
the variable used for the golden ring for these is gring, change to suit
You should be able to copy and paste these into your command line.

For renewing charges:
#trig {Golden Ring feels warmer} {#IF (@gring<5) {#VAR gring @gring+1}}

For using up a charge:
#trig {Your Golden Ring glows} {#IF (@gring<5) {#VAR gring @gring-1}}

For setting it when looking at the ring:
#trig { A (*) within the gem.} {#switch (%1 = "very bright crimson cross is glowing from") {#VAR gring 5} (%1 = "bright crimson cross is glowing from") {#VAR gring 4} (%1 = "crimson cross is glowing from") {#VAR gring 3} (%1 = "dull crimson cross is glowing from") {#VAR gring 2} (%1 = "crimson cross, which is barely visible, glows") {#VAR gring 1}}
Reply with quote
TerryG
Beginner


Joined: 16 Aug 2007
Posts: 28

PostPosted: Sat Sep 03, 2011 4:29 am   
 
You are awesome, worked like a charm!
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Sat Sep 03, 2011 12:49 pm   
 
First, the obvious question... have you tried rebooting? I find that CMUD sometimes will glitch and give erratic results. Restarting (or better yet, rebooting) fixes those problems.

I recommend you try variable assignment through the pattern, using &Var matching. Reread my previous post while you're awake. =)
_________________
.geniusclown
Reply with quote
TerryG
Beginner


Joined: 16 Aug 2007
Posts: 28

PostPosted: Sat Sep 03, 2011 3:37 pm   
 
Thank you geniusclown I will keep that reboot in mind. Permalost totally got my ring operational and even better then before.
Reply with quote
PermaLost
Newbie


Joined: 22 Mar 2008
Posts: 2

PostPosted: Sun Sep 04, 2011 2:18 am   
 
Also to help fix the hp/sp

#trig {^<(*)/(*)>} {#VAR chp %1;#VAR csp %2}

OR


#trig {^<&chp/&csp>} {}

geniusclown
I was actually going to see about replacing some of the triggers with events like I currently have mine set. These I'm putting up just to get TerryG up and running. Optimization later.
Reply with quote
TerryG
Beginner


Joined: 16 Aug 2007
Posts: 28

PostPosted: Sun Sep 04, 2011 4:40 am   
 
I'm excited and very grateful!
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