Tomb Titivator
Posts: 857
Joined: Monday, 31st January 2011, 23:19
Auto Butcher Version 3
Just copy this into your RC file and it works! There's NO NEED to fumble around with macros or anything like that. It works with every species: spriggans, mummies, trolls, hill orcs, and more! Just copy it, paste it, and forget it exists! It doesn't interact in any way with any other options you have set so there's no reason not to use it!
It works for trunk at the moment and may not work for earlier versions of Crawl.
- Code:
:function can_eat_chunks()
: if you.race()=="Spriggan" then return end
: if you.gourmand() or you.race()=="Kobold" or you.race()=="Felid" then
: return you.hunger()<6
: end
: return you.hunger()<4
:end
:function edible_corpse(item)
: if not can_eat_chunks() then return end
: if food.rotting(item) and not you.saprovorous() then return end
: if food.dangerous(item) then return end
: return string.find(item.name(),"corpse")
:end
:function over_corpse()
: for item_under_you in iter.invent_iterator:new(you.floor_items()) do
: if string.find(item_under_you.name(),"corpse") then return true end
: end
:end
:function over_edible_corpse()
: for item_under_you in iter.invent_iterator:new(you.floor_items()) do
: if edible_corpse(item_under_you) then return true end
: end
:end
:function walk_over_edible_corpses(item)
: return edible_corpse(item) and not over_edible_corpse()
:end
:function ready()
: if not default_options then
: default_options=options.runrest_stop_message
: crawl.setopt("confirm_butcher=never")
: crawl.setopt("auto_eat_chunks=true")
: end
: if can_eat_chunks() then
: crawl.setopt("runrest_stop_message+=corpse")
: else
: crawl.setopt("runrest_stop_message="..default_options)
: end
: if you.feel_safe() and over_edible_corpse() then
: crawl.sendkeys("c")
: crawl.process_command()
: end
:end
:add_autopickup_func(walk_over_edible_corpses)