|
Kronas Wanderer
Joined: 28 Dec 2003 Posts: 62 Location: Australia
|
Posted: Thu Apr 08, 2004 5:36 am
offerring all corpses from inv |
Hi,
I'm tyring to work out the script to offer all corpses I kill.
I got the trigger: {you have slain a *({@target})* {#cw magenta;#addi corpses1 %1}{#wait 2000};look}
now that seems to work ok..adds all I kill to corpses1.
Now I can't seem to work out the maths part,eg: I have 5 of 1 type of beast and 2 of another so the variable is like so {#var corpses1}{deer|monk|astronomer}
It offers the 1st item in the list, but because deer is still in the line 1 box, it prompts: what is it you wish to offer.
I've tried #delitem %1. It does that ok, but I still have 4 left of that kind.
I've used #add ({@corpses}) 1. But that makes another #var of that type.
So the bottom line is: how do I write it so it adds my kills,of all I kill, then when I go to offer them it counts it down to nil, then goes to the next beast and so on, till there all offered?
Sorry nearly forgot It's zmud 7.05 version |
|
|
|
user0101 Apprentice
Joined: 01 Aug 2003 Posts: 100 Location: USA
|
Posted: Thu Apr 08, 2004 6:26 am |
#trigger {You have slain a *({@target})*} {#cw magenta;corpses1=%additem(%1,@corpses1);#alarm +2 {look}}
#alias offerall {#forall @corpses1 {offer %i};corpses1=""}
If you are killing multiple mobs by the same name, just use %additem to account for duplicates. |
|
|
|
user0101 Apprentice
Joined: 01 Aug 2003 Posts: 100 Location: USA
|
Posted: Thu Apr 08, 2004 6:36 am |
By the way, if you are on Achaea or one of its sister MUDs this probably won't work since the entire mob name is expanded, suffix and prefix included. What I do is:
#ALIAS offerall {#t+ Auto_Offer;#t+ Auto_Offer|Corpse;#alarm +2 {ii corpse}}
#CLASS {Auto_Offer}
#VAR offer_list {}
#VAR total {0}
#CLASS 0
#CLASS {Auto_Offer|Corpse}
#TRIGGER {^~"(%w)%d~"} {#if (%numitems(@offer_list)<16) {offer_list=%additem(%1,@offer_list)} {total=1}}
#TRIGGER {^You are wearing} {#alarm +1 {#forall @offer_list {offer %i};offer_list=""};#alarm +2 {#if (@total=1) {total=0} {#t- Auto_Offer;#alarm +2 {med}}};#t- Auto_Offer|Corpse}
#CLASS 0
Although you could just get away with using a couple of named triggers that get turned on or off instead of using class folders. |
|
|
|
Kronas Wanderer
Joined: 28 Dec 2003 Posts: 62 Location: Australia
|
Posted: Thu Apr 08, 2004 7:58 am |
Thanks guys, that did the trick :)
|
|
|
|
|
|