ZMud Help

by Faethan

Back to Mechanic's Corner.

Faethan2005-01-30 20:42:55
I have the following things:

#ALIAS {targ} {#VAR target %1 ; #additem targetlist %1}
#TRIGGER {{@targetlist}} {#CW red}

I want to make an alias that will clear my targetlist. I use this when influencing to keep track of which NPC numbers I've already hit. Right now I'm just deleting the targetlist variable when I want to start over. Any advice?

Unknown2005-01-30 20:45:32
When I want to reset a string list, I simply assign it a null string.

CODE
#ALIAS targreset {#var targetlist ""}
Faethan2005-01-30 21:32:18
Aha! I hadn't been using the "", and it was just displaying the entire list. Thanks.
Unknown2005-01-30 21:41:36
Yeah, doing #var targetlist would just display the contents of it, as it has no value after it. You have to put "" or {} after to make it have a null value.
Gwylifar2005-01-30 22:39:19
Or targetlist = "" equivalently.
Unknown2005-01-30 23:00:24
But that has problems on some zMUDs... For me and Zarquan it sometimes creates another variable of the same name in the same place even if one already exists. And this can bug scripts up a bit.

Also, #VARIABLE TargetList "" looks neater. wink.gif
Unknown2005-01-31 05:15:38
Or: #VAR targetlist %null happy.gif
Gwylifar2005-01-31 13:41:58
Hmm, that's odd, because I once had a case where out of the blue, the #var syntax started doing what you describe, and I had to change to the assignment syntax to get it to stop.

Ah, lovably flaky zMUD, how we do dote on thee.

Laysus2005-02-01 16:24:03
Sometimes I'm glad I don't use Zmud dry.gif
Unknown2005-02-02 03:35:24
zMUD has so many (well, it doesn't have that much) bugs and things only because it has so many features, such as graphical things such as buttons, gauges, and status windows. Also, it's scripting is far easier to learn than most other clients.