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


Joined: 16 Apr 2005
Posts: 12

PostPosted: Fri Apr 22, 2005 2:30 pm   

%numwords
 
Is there a command that counts the number of characters, including spaces, for a command or function..etc?
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Fri Apr 22, 2005 2:50 pm   
 
Well theres %len(s) which returns the length of the string s but from your description I am not sure exactly what you are looking for. Could you provide a quick example?
Reply with quote
Cyril
Beginner


Joined: 16 Apr 2005
Posts: 12

PostPosted: Fri Apr 22, 2005 3:03 pm   
 
I Want an alias to gtell something, but if it's too long it will gt it in 2 gtell...etc
Reply with quote
Cyril
Beginner


Joined: 16 Apr 2005
Posts: 12

PostPosted: Fri Apr 22, 2005 3:48 pm   
 
break=%concat( ~|g~|%proper( %1)|w|: |bc|@%1.number |w|~[|c|@%1.name|w|~])
When I do this, it atkes away the [], anyway for it not to?
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Fri Apr 22, 2005 4:05 pm   
 
I hate it when it does that. Sometimes you just have to fiddle with it until it comes out right. I played around with your string (via local echos) and I think this one might work:

break=%concat( ~|g~|%proper( %1)|w|: |bc|@%1.number |w|<[>|c|@%1.name|w|])

IE surround first bracket with <> and nothing on the second... see if that works
Reply with quote
Cyril
Beginner


Joined: 16 Apr 2005
Posts: 12

PostPosted: Fri Apr 22, 2005 4:53 pm   
 
hrmph still not working, i'll look into other commands I guesss
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Fri Apr 22, 2005 5:31 pm   
 
Hmm, you know I cant make heads or tails of what that concat is actually doing... are you using the pipes (IE |) as seperators? Each item in the concat should be in quotes if needed and use commas instead. Perhaps this is close? Prolly not but ill take a stab at it anyways...

break=%concat("|g|",%proper( %1),"w:bc",@%1.number,"w[c",@%1.name,"w]")
Reply with quote
Cyril
Beginner


Joined: 16 Apr 2005
Posts: 12

PostPosted: Fri Apr 22, 2005 5:34 pm   
 
|g| is a color code, the comma is there to display in the mud, not as a separator, so I used ~ and am just wanting to have the in there too[]
Reply with quote
Cyril
Beginner


Joined: 16 Apr 2005
Posts: 12

PostPosted: Fri Apr 22, 2005 5:36 pm   
 
I tried using the "" and comas, but the [] still didn't show
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Fri Apr 22, 2005 9:05 pm   
 
Instead of using gtell @break (or whatever) use %quote(@break)
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Mon Apr 25, 2005 3:11 pm   
 
This is what worked for me but depending on how your using it you might have some problems

Code:

break=%concat( ~|g~|%proper( %1)|w|: |bc|@%1.number |w|[|c|@%1.name|w|])
#var break %replaceitem("%char(91)",9,@break)
#var break %replaceitem("%char(93)",13,@break)
#show @break


I also got this to work and is more flexible
Code:

break=%concat( ~|g~|%proper( %1)|w|: |bc|@%1.number |w|"%char(91)"|c|@%1.name|w|"%char(93)")
#var break @break
#show @break


hope you like it
_________________
megamog75 Smile
I will do this.Nothing in my life matters except this.No moment in my life exists except this moment.I am born in this moment, and if I fail, I will die in this moment. Raistlin Majere
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