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


Joined: 31 Aug 2005
Posts: 7

PostPosted: Thu Nov 03, 2005 10:32 pm   

possible 7.21 bug - using %i in a variablename
 
When i used 7.13, i wrote a little friendlist, which helps me picking out my friends and foes easily. However, when i changed to 7.21. The code doesn't seem to work anymore. A little more explenation follows:

characters are put into groups (addchar-alias), which are made by issuing the addgroup-alias. A group has a certain colour appointed to it(@<group>_col). whoever is in a group, will get a trigger (by the applycol-alias) which uses the #CW <colour>.

As i said earlier, this all worked fine in 7.13. In 7.21, the code in the alias which makes the triggers (applycol-alias). doesn't work as it used to anymore (see below for code). the #cw @[%i]_col part creates a trigger like @[friends]_col. which causes the characternames to color black, while with 7.13. It just creates the trigger like @friend_list.

applycol-alias:
Code:

#forall @cgroups {#forall @%i {#trigger {%j{ |,|.|?|!|~*|$}} {#cw @[%i]_col} ColGroup|triggers}}

So basically: when i create a group, the name of that group will be added to the stringlist @cgroups. And a variable @<groupname>_col will be made, which contains the colour of that group. the applycol-alias will make a trigger for every person in every group with it's own colour.

Any ideas on getting the colour-variable name into the triggers? ({#cw @<group>_col}).

Thanks in advance.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Fri Nov 04, 2005 12:54 am   
 
Don't mean this to be rude, but you are using sloppy syntax.

[] is used to FORCE expansion depending on options and isnt Ideal for use in scripts but more for use on the command line
{} is Used to group stuff and fols the same principals as () in math in that the innermost will be executed first, This is untested but I think should work.

#forall @cgroups {#forall @{%i} {#trigger {%j{ |,|.|?|!|~*|$}} {#cw @{%i}_col} ColGroup|triggers}}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
coamenel
Newbie


Joined: 31 Aug 2005
Posts: 7

PostPosted: Fri Nov 04, 2005 6:32 am   
 
nexela wrote:
Don't mean this to be rude, but you are using sloppy syntax.

[] is used to FORCE expansion depending on options and isnt Ideal for use in scripts but more for use on the command line
{} is Used to group stuff and fols the same principals as () in math in that the innermost will be executed first, This is untested but I think should work.

#forall @cgroups {#forall @{%i} {#trigger {%j{ |,|.|?|!|~*|$}} {#cw @{%i}_col} ColGroup|triggers}}


Thanks for your reply, I've tried what you said. But unfortunately, it doesn't work. What happens when i use {} instead of [] is that the triggers are made with this:
#cw @{family}_col

It shouldn't take the {} into the variable name. Sad
Reply with quote
coamenel
Newbie


Joined: 31 Aug 2005
Posts: 7

PostPosted: Mon Nov 14, 2005 11:21 am   
 
hmm.. if there is no solution for this thingie, i think imma switch back to 7.13. Since it's getting pretty anoying now Crying or Very sad
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Nov 14, 2005 9:33 pm   
 
Have you tried it without any brackets? I believe %i variables are subject to early expansion and don't need the brackets anymore. Of course, I could be wrong too.
_________________
EDIT: I didn't like my old signature
Reply with quote
yejun
Wanderer


Joined: 13 Jun 2005
Posts: 51

PostPosted: Tue Nov 15, 2005 7:28 pm   
 
#forall @cgroups {#forall @%i {#exec {#trigger {%j{ |,|.|?|!|~*|$}} {#cw @{%i}_col} ColGroup|triggers}}}
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