RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Automatically Eat & Drink

datguy

Sorceror
Supports RunUO 2.0

AutoEat


It will allow players to automatically eat or drink whatever is found in players pack that is eatable or drinkable. So if you like having a food system but your players whine you can make things a bit easier for them but they still have to have foods on them

-staff are exempt from forced autoeating

When player gets less than 10 in Hunger/Thirst they'll start to loose Stam/Mana respectively.

If XanthosUtilities is in place you can opt to display the names of what your eating / drinking, Helps if you have a packload of things & something in there was poisoned

If you have XmlSpawner in place the player can opt to turn off auto eating/drinking if say they have something they want as deco & not accidentally eat or drink it.

In AutoEat-Drink.cs Uncomment the appropriate lines to enable the feature
//If these systems are in place, uncomment out the next appropriate line
//#define XanthosUtilities_PRESENT
//#define XMLSPAWNER_PRESENT

It will look for beverage containers with something it them, if it finds an empty beverage container it will DELETE it & give player 3 gold(same as if they sold it, based on emptypitcher) This is so the script doesn't continually find the same empty container & not drink. If someone wants to write an ignore routine feel free

The MyHunger Command is a redo of something I found on here some time ago. It'll display your hunger & thirst level with approximately the amount of time remaining till your at 0
It is not required for auto eat&drink to work


*EDIT*
Updated AutoEat-Drink to no longer exchange empty containers for goldcoin but now ignores the empty containers :) thanks to traorange for starting a backpack loop query & Peoharen for suggesting it :)



Uploaded newest version, players can now tag specific food/drink to not be auto consumed, the item will get a [Guarded] added to the name, It goes away when tag is removed. New Command [yukky
:D
Xmlspawner needed for attachment tagging to work

Version 1.0
auto eat & drink anything in players pack when hungry or thirsty, turn autoeating on/off with [autoeat

Version 1.1
changes, system ignores empty beverage containers instead of removing them for gold

Version 1.2
changes, added new command routine [yukky - target a food or beverage & toggle the system on/off to not auto consume that specific item when [autoeat is on,
it will also get [Guarded] added to it's name, use again to remove the blockage & name [Guarded].
version really needs XmlSpawner for it's features to work although,
the system auto-eat will still work with the #define lines commented out if you don't have those systems inplace
 

Attachments

  • myhunger_Command.cs
    3 KB · Views: 27
  • AutoEat-Drink 1.2.cs
    25.1 KB · Views: 36

Pure Insanity

Sorceror
This really is a great idea, can't believe it hasn't been done before. I force people to eat and drink on my shard, a hand full complain about it. Even though I have made it rather easy to eat and drink...this on the other hand would be great to have for people that tend to train while afk. Now as long as they carry enough food with them, they'll be fine. Going to add this to my shard, I'll be sure to let you know if I have any issues. =P
 

Macil

Sorceror
Hrm. I have an idea for this. Perhaps you could add a type container that the script will look for that can only carry food. Lets say, a 'food satchel' of sorts or something. This way if the player is carrying food that they do not want to be eaten, the script will only look inside the satchel or what not to feed the player and not elsewhere. So if you have say a veteran reward birthday cake that can be eaten, the game wont eat it by mistake. Or like the gingerbread cookies, some players collect stuff like that, it'd be annoying I'd imagine to find out that your hungry little character ate them by accident without your permission, heh. I'm not at home to test this script out so I'm not sure if your script already accounts for anything like this, so sorry if this post is redundant. Either way, this is a great idea, I can't wait to get home and try it!
 

Pure Insanity

Sorceror
I don't believe it checks for things like that, but players that don't want to use it can simply type [autoeat and not have to worry about it.
 

datguy

Sorceror
Uploaded newest version, players can now tag specific food/drink to not be auto consumed,I added [Guarded] to the name, original name stored in Attachment & is restored to the item when tag is removed via new command [yukky
:D

Xmlspawner needed for attachment tagging to work
 

Pure Insanity

Sorceror
So using [yukky will make the system not auto eat/drink the item? Will it allow it if done to the item twice? Or is there another command for that? ([yummy?)
 

datguy

Sorceror
There is a command [Autoeat which turns on/off autoeating
there is also a command [yukky is a toggle on/off where you target a specific item to not eat that when your autoeating, [yukky target it again to take the guard off.
I will change name to ver # so it's not confusing
 
Top