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


Joined: 24 Jul 2002
Posts: 5

PostPosted: Sat Dec 21, 2002 6:49 pm   

Problems with my hilighter in the new zmud
 
Alright, I had a hilighter with an alias, trigger, and string listing variable on 6.16.

I would enter the name of an enemy to hilight with the variable (addname Zugg). It would put "Zugg" into the string list and the trigger would hilight any name it saw that was in the string list.

Now, when I add a name to the list, it'll bunch the other names in the second line, like...
addname Love
addname Hate
addname Children
addname Adults

String List looks like this:
Adults
Children|Hate|Love

For some reason, it couples it like (Children|Hate|Love) instead of making a list.

This is the alias I used:
#VA enemy %additem( @enemy, %1)

So can someone tell me how to make an alias that makes a list instead of making a name and coupling the rest? Either that, or send me a hilighting trigger compatible with zmud 6.40 (I don't like using the #hi command since it gives tons of clutter in my trigger folder).
Reply with quote
Belmyrddyn
Magician


Joined: 17 Oct 2001
Posts: 371
Location: USA

PostPosted: Sat Dec 21, 2002 6:58 pm   
 
I believe you've got your function reversed:
#VAR enemy %additem(%1, @enemy)

I've tested this and it works for me.

Belmyrddyn
Reply with quote
arkanes
Beginner


Joined: 02 Feb 2002
Posts: 17

PostPosted: Sat Dec 21, 2002 6:59 pm   
 
What do you mean by "couples" ? And what you're showing IS a list. I have an almost identical trigger that works fine after my move from 6.23 to 6.40.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Dec 21, 2002 8:00 pm   
 
You could use #ADDITEM for this. It has the added benefit of not creating duplicate entries (you don't need to highlight the same name twice).
#ADDITEM enemy %1

LightBulb
Senior Member
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Sat Dec 21, 2002 8:53 pm   
 
In version 6.40, you can now have nested lists, meaning a list can be a list item within another list.

As Belmyrddyn pointed out, you have reversed the arguements in the %additem function. The syntax for that should be %additem(new_item, @list).

In versions previous to 6.40, the reverse worked just as well because all it did was make one big list. In 6.40, however, it preserves the "listy" quality of "Children|Hate|Love" when it adds it to "Adult", resulting in "Adult|(Children|Hate|Love)".

To avoid that, reverse the arguements so that you're adding "Adult" to "Children|Hate|Love" and not vice-versa.

Troubadour
(Win 98, Pentium III, 550 MHz)
Reply with quote
Kefka
Newbie


Joined: 24 Jul 2002
Posts: 5

PostPosted: Sat Dec 21, 2002 10:10 pm   
 
Woo, works now.

What are some uses for that nested list thing, anyhow?
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Sat Dec 21, 2002 10:58 pm   
 
I've written a script (it's in the Finished Scripts section) that tracks when I've quested. It stores (day-of-year|time-of-day) pairs to a list. The list looks like "(335|139495)|(335|200382)|(336|143883)". (It tracks time-of-day in seconds since midnight.) Each item is comprised of two elements which can be added, deleted, popped, and pushed as a pair.

You might also store several sets of x-y coordinates to a list.

Another aspect of this feature is that you can assign a list as the value in a record variable and have it retain its "listiness".

#ADDKEY spellstuff bless "tormentil|witch hazel|quartz"

#ALIAS needwhat {#SHOW Ingredients for the spell '%-1' are %expandlist(%db(@spellstuff, %-1), ", ").}

needwhat bless would show:

Ingredients for the spell 'bless' are tormentil, witch hazel, quartz.

Troubadour
(Win 98, Pentium III, 550 MHz)
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