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
Evangelist
Adept


Joined: 10 Oct 2000
Posts: 224
Location: USA

PostPosted: Sat Jul 13, 2002 10:05 am   

container trigger
 
I need help making a container trigger. Basically, it will add all the items in a container to a list when i look in it. Then, it will report what is in the trigger to my group mates. The output of mud is as follows, the only thing different when you examine different containers, is the name. I am not sure how I could do this, and I need it to limit how many items it will say back at one time, to a max of like 5 maybe...if it says back to much, the mud will not accept it. Good news though, my database is finally working :)



You see nothing special.
When you look inside, you see:
The Blazing Collar of Red 13 contains:
(Glowing) Cordelia's Tear
tree moss (4)
ointment of palanthine
ointment of invocation and springing
(Invis) (Glowing) (Humming) malleable corpus
the Scales of the Ibrandlin
a reboot partyhat
a glass of milk
a small brass compass (2)
a strange looking helmet with a spinning wheel on top
a long carved wooden staff
a small bronze compass
a golden demon claw
a beautifully colored dragonscale shield
(Glowing) a driftlight
Cyndar's glowing blue wand
(OVERSTAT) a ring forged of wrought iron
the soul of the Darkling
salve of protection
single pokeball marker
an Eagle Eye Mask
salve of heroism
(Humming) a Scepter of Shielding
an ebony shield
a pair of magical glasses
the tail of kentas of karth-hokesh
an ebony breastplate fashioned from the fabric of shadows
a flanged battle mace (2)
(Invis) a gambling token (4)
a small lockpick (3)
a pair of crimson demon horns
the Dagger of the Ancients
a vial of extra-healing
(Glowing) (Humming) the Eye of Lidefeath
a crimson red mace surrounded by an unholy fire
(Glowing) (Humming) The magical teeth of Gatinblk
a pale humming potion (14)
a mithril wristband
Idol of the Crimson Bull
a bloodied war axe


Evangelist
www.phidar.com
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Jul 13, 2002 4:04 pm   
 
You need a way to know when the output of the container ends. I will assume here a blank line:
#ALIAS reportContents {#VAR temp @container;groupTell My container has:;#WHILE (@temp <> "") {#VAR message %concat(%item(@temp, 1), %item(@temp, 2), %item(@temp, 2), %item(@temp, 4), %item(@temp, 5));groupTell @message;#LOOP 1,%max(5, %numitems(@temp)) {#DELNITEM items %i}}}
#TRIGGER {When you look inside, you see:} {#VAR container "":#T+ getContents}
#TRIGGER {$} {#T- getContents;reportContents}
#TRIGGER {(*)} {#ADDITEM container "%1"}

It might display a little strange when the number of items in the container is not evenly divisble by 5, but it should work fine otherwise.

Kjata
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