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
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Mon Dec 16, 2002 6:59 am   

trigger or something
 
Please help : I need a way to look in a container find all the food (or thing)and then have it pick one of the foods and eat it
In game of Realms of Dispair

megamog75
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Mon Dec 16, 2002 4:26 pm   
 
you'll want to post some examples of your mud output.

  • the message you get when hungry

  • the message you get when thirsty

  • the command for looking in your container

  • what you see when you look in your container

  • the items that you'd want to get out


without that information i'll give what advice i can...
make 2 trigger classes, 1 called hunger and 1 called thirst
put triggers in this class that fire off of what you see in your container, the ones in hunger should fire on food, and the ones for thirst should fire on drink containers.
the commands for hunger trigger should be something like
get pie container
eat pie
#t- hunger
and thirst something like
get canteen container
drink canteen
put canteen container
#t- thirst

then one trigger to fire on hunger message that will turn on the hunger class and look in the container
and one for thirst that does the same
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Wed Dec 18, 2002 5:16 am   
 
Actualy that is what I have now plus i can use a button i set up too.
But what i need is a way to lokk in a container recognize severl different foods pick one and eat it.

exp: you are hungry
triggers :look in bag
mud report :you have in a bag
meat (4)
soup (2)
eggs (12)
At this point i would like it if zmud picked
one of the things on the list radomly and
eats it. and if nothing found it would tell
me no food.

Thank you so much for any help.

megamog75
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Dec 18, 2002 11:23 am   
 
How does zMUD knows what is food an what isn't? That is, if the container has a sword and some meat, how would zMUD know to take the meat and leave the sword alone?

Kjata
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Dec 19, 2002 11:47 pm   
 
Looks like we will have to repopulate the finished mud script for the diku autoeat/drinkers!

Found an old version of Darmir's script that will need some tweaking for your mud:

www.sitecenter.dk/nool/zmudscripts/

Autoeat
Created by Darmir
..

Also appears there is no more living pages by Radix!

Ton Diening
Reply with quote
Drevarr
Beginner


Joined: 19 Dec 2001
Posts: 17
Location: USA

PostPosted: Fri Dec 20, 2002 5:46 am   
 
You'll need to populate the stringlist @FoodStuff with the common food items you tend to carry around in your bag.

#CLASS {AutoEat}
#CLASS 0
#VAR FoodStuff {meat|soup|eggs}
#VAR fed {1}
#TRIGGER {you are hungry} {#T+ AutoEat;look in bag}
#TRIGGER {you have in a bag} {#temp {^({@FoodStuff}) } {get %%1 bag;eat %%1;#var fed 0} eattemp} "AutoEat"
#COND {^$} {#T- AutoEat;#delclass eattemp;#if (@fed) {#show No FoodStuff found in bag!} {#var fed 1}}
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Thu Dec 26, 2002 8:48 pm   
 
Ok after much tooling around and working I finally got this to work hope you like it, I will also include it in the zmud scripts and post a link when I can figure that out.

#CLASS {autofood}
#VAR havefood {meat|mushroom|cookie|bread}
#VAR havecontainer {portal|bag|jar}
#CLASS 0

#CLASS {autofood|unload}
#ALIAS unload {#unv havefood;#unv havecontainers}
#CLASS 0

#CLASS {autofood|checkcon}
#ALIAS checkcontainers {#ADD loopcount 1;#T+ foodcheck;exam %item( @havecontainer , @loopcount);#wa 3000;#T- foodcheck;#IF (%numitems( @havefood)>0) {get %item( @havefood, 1) %item( @havecontainer, @loopcount);eat %item( @havefood, 1);stillhungry = 0;#abort 1} {#echo I have no food in %item( @havecontainer, @loopcount)};IF ((@stillhungry=1) and (@loopcount<@containercount)) { checkcontainers} {#echo I have nothing at all better get some}}
#CLASS 0

#CLASS {autofood|AutoeatAliases}
#ALIAS condel {#delitem containertypes {%-1}}
#ALIAS eathelp {#show { AutoEat Help};#show {-------------------------------------------------------------------};#show {This script is to reduce the mundane eating crap!};#show {foodadd ------------------------ add food to the food list};#show {fooddel ------------------------ delete food from the food list};#show {conadd ------------------------ add container to the container list};#show {condel ------------------------ delete container from the container list};#show {eatshow ----------------------- shows the list of food and container you have in your lists}}
#ALIAS fooddel {#delitem foodtypes {%-1}}
#ALIAS foodadd {#additem foodtypes {%-1}}
#ALIAS conadd {#additem containertypes {%-1}}
#ALIAS eatshow {#show %crlfFood List;#show -------------------;#loop 1,%numitems(@foodtypes);#show %i~. %item(@foodtypes,%i);#show %crlfContainer's List;#show -------------------;loop 1,%numitems(@containertypes);#show %i~. %item(@containertypes,%i)}
#CLASS 0

#CLASS {autofood|food}
#VAR foodtypes {meat|mushroom|cookie|bread}
#CLASS 0

#CLASS {autofood|multcontainer}
#VAR containertypes {an extradimensional portal|bag|jar}
#CLASS 0

#CLASS {autofood|foodcheck}
#TRIGGER {{@foodtypes}} {#IF %ismember( %1, {@foodtypes}) {#VAR havefood %addItem( %1, @havefood)}}
#CLASS 0

#CLASS {autofood|containercheck}
#TRIGGER {{@containertypes}} {#IF %ismember( %1, {@containertypes}) {#VAR @havecontainer %addItem( %1, @havecontainer)}}
#CLASS 0

#CLASS {autofood|autoeat}
#TRIGGER {You are hungry} {#unv havefood;#unv havecontainer;#unv loopcount;#unv containercount;#unv stillhungry;#T+ containercheck;#T+ foodcheck;inventory;#wa 3000;#T- containercheck;#T- foodcheck;#IF (%numitems( @havecontainer)>0) {#var stillhungry 1;#var loopcount 0;#var containercount %numitems( @havecontainer);checkcontainers} {#show {I have no containers need go buy one, duh!}}}
#CLASS 0

------------------------------------------
OK this is important: I made this to work with Realms of Dispair so I do not know how it will work in other places.
Also you will have to change the food and containers manually to what you use.

One more thing; And this is really important
to get this into zmud easy Just make a new class, then click on class script, cut and past, then save and there you go!!!!!!!

have fun; email me if your having trouble.

megamog75
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