auto giving

by Munsia

Back to Mechanic's Corner.

Munsia2005-10-20 20:44:59
ok say I wanted to give leafs to all the pixies in the room (I know this is stupid but its just an example)
so you have
pixie134
pixie646
pixie954

how would you code it to just give it to every piixie?
Terenas2005-10-20 20:57:30
Unless it's zmud, otherwise I don't know. tongue.gif
Munsia2005-10-20 20:57:51
QUOTE(terenas @ Oct 20 2005, 04:57 PM)
Unless it's zmud, otherwise I don't know.  tongue.gif
209158


It is
Asarnil2005-10-20 21:35:27
#trigger {pixie(%d)%srestofinfoherelinehere} {give leaf to %1}

That way it ONLY triggers for the pixies of that certain type and not if say someone has a pixie as a pet in the room.
Terenas2005-10-20 21:36:37
#CLASS {pixiegiving}
#ALIAS pixiehere {info here pixie;#t+ pixielist;#res pixielist}
#ALIAS giveleaf {#t+ pixielist;#FORALL @pixielist {give leaf to %i};#t- pixielist}
#TRIGGER {Number of objects} {#t- pixielist}
#CLASS 0
#CLASS {pixielist}
#TRIGGER {"^pixie(%d)"} {#additem pixielist %1}
#TRIGGER {^Type MORE to continue reading.} {more}
#CLASS 0
#CLASS {pixielist}
#VAR pixielist {} {}
#CLASS 0
Munsia2005-10-20 21:39:01
sweet... and I can replace pixie with anything and leaf with the item?
Unknown2005-10-21 12:10:15
QUOTE(munsia @ Oct 20 2005, 09:39 PM)
sweet... and I can replace pixie with anything and leaf with the item?
209178



leaf, yes. Pixie, you will need to replace it with the word you get in the IH list.
Shorlen2005-10-21 18:24:54
Erm, this will give your leaves to all pixies in the room, including those who already are following you, correct?

EDIT: You need to keep a little list of all pixies that you give leaves to, and not give them any more leaves. Then you need to clear said list when you get to Mother. Oh, and if someone else enters the room and scares a pixie away, you need to remove them from the list... so, you'd want ENT to update the list of who is following and who isn't.
Asarnil2005-10-21 18:45:26
To be honest Malicia - while your script is nice, it is kinda overkill where my single trigger would do the same job as long as you use info here to pick up what to give it to. The main advantages of your script is when you have to give an item to a number of mobs and you can't afford to reset the pixielist variable every time you use it, such as the beggars in Magnagora.
Munsia2005-10-21 22:06:23
Pixies was just an example tongue.gif
I dont bring in pixies dry.gif
Kiarlea2005-10-22 03:31:38
She brings in cows! *duck*
Munsia2005-10-22 05:08:23
I swear I am going to hurt you...
Kiarlea2005-10-22 06:38:46
Stop leaving yourself wide open!