|
kibln8 Beginner
Joined: 05 Sep 2005 Posts: 11
|
Posted: Mon Sep 05, 2005 2:53 pm
Ugly Parenthesis and |s in my Variable, PLEASE HELP. |
Alright, this is a group break down trigger that goes through all the classes, which are listed in @breakclasslist, and adds (# of a certain class) (class name) [(names of groupies who belong to that particular class)] without the parenthesis obviously.. the only problem I have with it is that when I add color codes (on the mud I'm playing currently (AVATAR mud) colors codes are designated by using |br|, |r|, and |bk| like you see in my trigger) parenthesis are added to the beginning and end of each "item" in the variable and also a | is placed between each of these "item"s. Delitem won't delete them. I know everything else works fine though because I tried it without the colors codes and it worked out just the way I wanted it to minus the part about the |s being displayed inbetween the different "item"s.
#forall @breakclasslist {#if @%{i}numb>0 {#VAR report %additem( |br| @%{i}numb |r|@%{i}prop |bk|"["@%{i}list"]", @report)}}
gt @report
SAMPLE REPORT: You tell the group '( 1 Cleric [Cenor])|( 1 Warrior [Boaba])'
Of course the color didn't show up, but you can see how the parenthesis and |s show up. I just need to find a way to delete those before I tell the group the @report.
Please respond even if you think you can only help out a little. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon Sep 05, 2005 4:10 pm |
I don't know if this will actually fix your problem, but use quotes or brackets of some kind--heck, for complete control you should just use %concat() to build your string. You might try using the quote character (~) with your color codes to see if that fixes the problem. If that doesn't work, you'll have to use 3 %replace() functions.
The problem you're seeing is that ZMud is interpreting the string you want to add via %additem() as a stringlist itself. A stringlist contained within another stringlist is called a nested stringlist, and these are denoted with surrounding parentheses (if not, then the items are confused as part of the original stringlist):
Code: |
1a | 2a | 3a | 4a
1b 2b 3b
1c 2c
1d
|
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|
|
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
|
|