|
Cyril Beginner
Joined: 16 Apr 2005 Posts: 12
|
Posted: 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?
|
|
|
|
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: 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?
|
|
|
|
Cyril Beginner
Joined: 16 Apr 2005 Posts: 12
|
Posted: 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
|
|
|
|
Cyril Beginner
Joined: 16 Apr 2005 Posts: 12
|
Posted: 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? |
|
|
|
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: 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 |
|
|
|
Cyril Beginner
Joined: 16 Apr 2005 Posts: 12
|
Posted: Fri Apr 22, 2005 4:53 pm |
hrmph still not working, i'll look into other commands I guesss
|
|
|
|
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: 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]") |
|
|
|
Cyril Beginner
Joined: 16 Apr 2005 Posts: 12
|
Posted: 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[]
|
|
|
|
Cyril Beginner
Joined: 16 Apr 2005 Posts: 12
|
Posted: Fri Apr 22, 2005 5:36 pm |
I tried using the "" and comas, but the [] still didn't show
|
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Fri Apr 22, 2005 9:05 pm |
Instead of using gtell @break (or whatever) use %quote(@break)
|
|
|
|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: 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
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 |
|
|
|
|
|