Auto consume lua script


Questions, Explanations, Howtos

Dungeon Dilettante

Posts: 2

Joined: Wednesday, 18th April 2012, 12:43

Post Wednesday, 18th April 2012, 12:47

Auto consume lua script

Hi all,

I've been thinking about writing an "auto consume" in a similar vein to the autofight lua script to:
Confirm nothing dangerous nearby
Look for non-poison corpses within view
Walk to the nearest
Chop it up
If less than Very Full, eat chunks until we're good

I set out to write it and ran into a few problems. As far as I can tell, there's no way to see corpses within view. (ie: there's no equivelent to monster_at). The dgn functions do appear to support it, but those are only for wizard mode.. correct?

Also, I can't see how to check if a corpse is poison. Could anyone point me in the right direction?

Thanks in advance!

Spider Stomper

Posts: 243

Joined: Sunday, 28th August 2011, 14:04

Post Wednesday, 18th April 2012, 13:14

Re: Auto consume lua script

keaponlaffin wrote:I set out to write it and ran into a few problems. As far as I can tell, there's no way to see corpses within view. (ie: there's no equivelent to monster_at). The dgn functions do appear to support it, but those are only for wizard mode.. correct?

The closest function I have found is you.floor_items, but it only returns items at your position. See this thread
keaponlaffin wrote:Also, I can't see how to check if a corpse is poison. Could anyone point me in the right direction?

item:is_bad_food()

Dungeon Dilettante

Posts: 2

Joined: Wednesday, 18th April 2012, 12:43

Post Wednesday, 18th April 2012, 13:33

Re: Auto consume lua script

Thanks. Am I correct in saying that the only way to find lua functions is to look in the source code? There's no documentation is there?

Thanks. So, if there was a floor_items_at this sounds very doable. Would make playing something like a troll a lot less tedious.

Return to Coding

Who is online

Users browsing this forum: No registered users and 8 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.