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


Joined: 31 Dec 2016
Posts: 3

PostPosted: Fri Jan 07, 2022 1:41 pm   

variable question
 
I have a var 'strike-number'
It reads the mud text correctly and sets the var correctly.
But when i try to display the var in status windiw, or just call it up with #show @strike-number command, i get '-number'

Can anyone elaborate?

And the MUD displays line: Your strike-number is: 4
Your (%w) is: (%d)
#var %1 %2
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Fri Jan 07, 2022 6:05 pm   
 
I don't think %w will do it as %w is word and you may have two words, or even word(minus)word. Try

Your (*) is: (%d)
#SH %trim(%1) %2

Alternatively, call your variable @strikeNumber
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Sun Jan 23, 2022 7:36 am   
 
#show @{strike-number}
Or as Hpoonis says, #Trigger {Your strike-number is: (%d)} {#Var Strikenumber %1}
Reply with quote
Gintonic
Beginner


Joined: 04 May 2018
Posts: 12

PostPosted: Mon Jan 24, 2022 4:35 am   
 
%x would match the non-white space, so it eliminates the need of training.
Your (%x) is: (%d)
Should work just fine
Reply with quote
Gintonic
Beginner


Joined: 04 May 2018
Posts: 12

PostPosted: Mon Jan 24, 2022 4:35 am   
 
*triming
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Mon Jan 24, 2022 11:45 pm   
 
Gintonic wrote:
%x would match the non-white space, so it eliminates the need of training.
Your (%x) is: (%d)
Should work just fine

The issue isn't writing to the variable. The issue is when he is trying to access the variable,
the - creates an issue, so he needs to use {} to specify the variable name to include -. This is
a carry-over from zMUD and can be found in the zmud help files.
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