Make rest default to sif's channel


Ask fellow adventurers how to stay alive in the deep, dark, dangerous dungeon below, or share your own accumulated wisdom.

Vaults Vanquisher

Posts: 428

Joined: Friday, 17th December 2010, 22:07

Post Monday, 2nd April 2012, 20:23

Make rest default to sif's channel

Hi ... started playing mummies, and I figured that channeling is free, and I'd like to do that whenever I rest. I currently use s and num-5 to rest, so I can macro 'aa' to 's', but for the "rest until interrupted (num-5)" that seems a bit more challenging... perhaps involving lua?

Does anyone have any pointers?

Or, perhaps one could just change the default behavior of mummies with channel to always channel when resting, kinda like how characters passively search while resting?

Vestibule Violator

Posts: 1500

Joined: Monday, 3rd January 2011, 17:47

Post Monday, 2nd April 2012, 20:32

Re: Make rest default to sif's channel

Do it yourself with a macro.
~. aa

Edit:
I just re-read OP's post and see that he mentioned a macro. I'm dumb.
Last edited by rebthor on Monday, 2nd April 2012, 21:18, edited 2 times in total.

Tartarus Sorceror

Posts: 1776

Joined: Monday, 21st February 2011, 15:57

Location: South Carolina

Post Monday, 2nd April 2012, 20:48

Re: Make rest default to sif's channel

Is there a way to make long resting, autotraveling, autoexploring, and butchering force eating of chunks when satiation allows?

Ziggurat Zagger

Posts: 3163

Joined: Friday, 6th January 2012, 18:45

Post Monday, 2nd April 2012, 20:54

Re: Make rest default to sif's channel

If you mean eating to engorged as a carnivore or with gourmand, I don't think so, no.

Tartarus Sorceror

Posts: 1776

Joined: Monday, 21st February 2011, 15:57

Location: South Carolina

Post Monday, 2nd April 2012, 23:15

Re: Make rest default to sif's channel

BlackSheep wrote:If you mean eating to engorged as a carnivore or with gourmand

Sure, that. But also when you're not a carnivore and you become hungry while walking. The game could automatically eat for you and then take you on to your destination without pausing for input. Or if I press 5, and become hungry while resting, just go ahead and eat and then finish out the resting. If I have chunks, and can eat, and am not in view of monsters, I can't think of any time I wouldn't eat. Except perhaps when I want to eat a royal jelly and I need stomach capacity for that, but I've probably only eaten to restore stats twice in four thousand games.

Dungeon Master

Posts: 1613

Joined: Thursday, 16th December 2010, 21:54

Post Monday, 2nd April 2012, 23:41

Re: Make rest default to sif's channel

auto_eat_chunks = true

As far as channeling goes, I remember someone made a Lua script for automatic channeling to full MP, but the pastebin link for it in the LearnDB has expired. Maybe it's in somebody's online config somewhere, but I dunno.

Spider Stomper

Posts: 243

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

Post Tuesday, 3rd April 2012, 02:45

Re: Make rest default to sif's channel

Here you have autochannel.lua by ekiM. It had a bug that I have fixed.

  Code:
---------------------------------------------------------------------------
-- autochannel.lua:
-- Automatically fill up on mana from Sif Muna or staff of channeling.
--
-- To use this, add this line to your init.txt:
--   lua_file = lua/autochannel.lua
-- ... or inline it.
-- Then macro any key to "===autochannel_staff" or "===autochannel_sif".
--
-- WARNING! Make sure channel energy is still on 'a' or autochannel_sif won't
-- work, probably getting stuck in an infinite loop.
--
-- Written by ekiM, suggestions or additions welcome!
-- Created: 2011-03-20
-- Last updated: 2012-04-03
-- Edited by CommanderC: new messages shouldn't interrupt the macro
---------------------------------------------------------------------------
-- BUGS
-- If 'aa' is not channel energy then autochannel_sif may loop forever.
---------------------------------------------------------------------------
-- TODO: Remove spurious mpr('')s when CDO updates Trunk
-- TODO: Check wield of staff was successful.
-- TODO: If currently wielded item is cursed, can't wield.
-- TODO: Check for infinite loops, just in case. Idea: if MP didn't increase
-- after X uses of command, ask if the player is sure they want to do this.
-- TODO: Give a message explaining what interrupted autochanneling.
-- TODO: Find the slot for the channel energy ability.  Alternatively, call
-- channel energy directly, if that's possible.
-- TODO: Switch back to previously wielded item (or ask?) when done or
-- interrupted.
-- TODO: Some way to quit early?
-- TODO: More checking for whether autochanneling is advisable?
-- e.g., very low hp, poisoned, glowing, rotting...
-- TODO: Make gaining Invocations skill/levels interrupt channeling.
-- Maybe ask if the player want to turn off Invocations?
-- TODO: Create a function that asks how much MP to channel then does
-- channel_loop until that much MP has been channeled, or we max out, or
-- we are interrupted.
-- TODO: Create a function to save how much energy the player likes to
-- autochannel
-- TODO: The above functions, as percentages of max mp?
---------------------------------------------------------------------------

function autochannel_staff()
   -- Try to get a staff of channeling wielded, then loop channeling
   to_match = "channeling"
   if mp_full() then return end
   if items.equipped_at(0) == nil or
   not string.find(items.equipped_at(0).name(),to_match) then
      local found = false
      for k,v in pairs(items.inventory()) do
         if string.find(v.name(),to_match) then
            if not v.cursed or v.cursed and
            crawl.yesno("Wield cursed staff?",true,'n') then
               v.wield()
               coroutine.yield(true)
               crawl.mpr('')
               found = true
               break
            end
         end
      end
      if not found then
         crawl.mpr("You need a suitable staff in order to channel. Sorry!")
         return
      end
   end
   if not mp_full() then channel_loop('v') end
end

function autochannel_sif()
   -- Check you have the channel energy (a)bility, then loop channeling
   local can_channel = false
   for k,v in pairs(you.abilities()) do
      if v == "Channel Energy" then can_channel = true end
   end
   if not can_channel then
      crawl.mpr('Sif Muna is not letting you channel energy. Sorry!')
      return
   end
   if not mp_full() then channel_loop('aa') end
end

function mp_full()
   -- return true if mp == max_mp else false
   local mp, max_mp = you.mp()
   if mp == max_mp then
      crawl.mpr("Your mana batteries are already full!")
      return true
   else
      return false
   end
end

function channel_loop(command)
   -- Repeat command while mp < max_mp, prompting for breaks if hungry or
   -- if hunger status changes.
   local mp, max_mp = you.mp()
   local hungry_ok, very_hungry_ok, near_starving_ok = false

   while mp < max_mp do
      local hunger = you.hunger()
      if not hungry_ok and hunger == "hungry" then
         if crawl.yesno("Autochannel while hungry?",false,'n') then
            hungry_ok = true
         else
            return
         end
      elseif not very_hungry_ok and hunger == "very hungry" then
         if crawl.yesno("Autochannel while very hungry?",false,'n') then
            very_hungry_ok = true
         else
            return
         end
      elseif not near_starving_ok and hunger == "near starving" then
         if crawl.yesno("Autochannel while near starving?",false,'n') then
            near_starving_ok = true
         else
            return
         end
      elseif hunger == "starving" then
         crawl.mpr("You are starving! You should eat RIGHT NOW!")
         return
      else
         crawl.process_keys(command)
         coroutine.yield(true, true)
      end
      mp = you.mp()
   end
end


function channeling_interrupt_macro(interrupt_name)
   return interrupt_name == "force" or
   interrupt_name == "statue" or
--   interrupt_name == "message" or
   interrupt_name == "hp_loss" or
   interrupt_name == "burden" or
   interrupt_name == "stat" or
   interrupt_name == "monster" or
   interrupt_name == "monster_attack" or
   interrupt_name == "teleport"
end

chk_interrupt_macro.autochannel_sif = channeling_interrupt_macro
chk_interrupt_macro.autochannel_staff = channeling_interrupt_macro

Tartarus Sorceror

Posts: 1776

Joined: Monday, 21st February 2011, 15:57

Location: South Carolina

Post Tuesday, 3rd April 2012, 12:25

Re: Make rest default to sif's channel

MarvinPA wrote:auto_eat_chunks = true

THat doesn't appear to do anything. Even with easy_eat_chunks, easy_eat_gourmand, and easy_eat_contaminated activated, I still have to press e once for each chunk I eat.

Dungeon Master

Posts: 1613

Joined: Thursday, 16th December 2010, 21:54

Post Tuesday, 3rd April 2012, 13:58

Re: Make rest default to sif's channel

auto_eat_chunks makes you automatically eat while exploring/resting if you get hungry, which I thought is what you were asking about? The easy_eat options are (mostly) separate.

Ziggurat Zagger

Posts: 3163

Joined: Friday, 6th January 2012, 18:45

Post Tuesday, 3rd April 2012, 14:57

Re: Make rest default to sif's channel

The thing I don't like about auto_eat_chunks is that I never notice the eating messages while auto-exploring, so I lose track of where my hunger is. I tried easy_eat_chunks too, but I seem to be addicted to pressing ee whenever I get hungry.

Tartarus Sorceror

Posts: 1776

Joined: Monday, 21st February 2011, 15:57

Location: South Carolina

Post Tuesday, 3rd April 2012, 15:29

Re: Make rest default to sif's channel

It looks like with a troll, auto_eat_chunks doesn't make you eat when you're satiated, but only when you're hungry. I'd like for it to go ahead and eat until I'm engorged.
User avatar

Halls Hopper

Posts: 55

Joined: Saturday, 2nd July 2011, 14:45

Post Tuesday, 3rd April 2012, 16:11

Re: Make rest default to sif's channel

BlackSheep wrote:The thing I don't like about auto_eat_chunks is that I never notice the eating messages while auto-exploring, so I lose track of where my hunger is. I tried easy_eat_chunks too, but I seem to be addicted to pressing ee whenever I get hungry.

runrest_stop_message = You finish eating
?

It still requires a keypress this way, however.

Ziggurat Zagger

Posts: 3163

Joined: Friday, 6th January 2012, 18:45

Post Tuesday, 3rd April 2012, 16:16

Re: Make rest default to sif's channel

That would somewhat defeat the purpose of using the feature. Really, the problem is that I'm a control freak and want to know exactly when I'm getting hungry and what I'm eating.
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Tuesday, 3rd April 2012, 22:26

Re: Make rest default to sif's channel

jejorda2 wrote:It looks like with a troll, auto_eat_chunks doesn't make you eat when you're satiated, but only when you're hungry. I'd like for it to go ahead and eat until I'm engorged.

Done
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...

For this message the author galehar has received thanks: 3
donblas, jejorda2, rchandra
User avatar

Abyss Ambulator

Posts: 1249

Joined: Sunday, 18th September 2011, 02:11

Post Wednesday, 4th April 2012, 00:08

Re: Make rest default to sif's channel

BlackSheep wrote:That would somewhat defeat the purpose of using the feature. Really, the problem is that I'm a control freak and want to know exactly when I'm getting hungry and what I'm eating.

...then eat manually. Anything automated will have certain downsides; if you want greater control, turn auto_eat_chunks off and spend a couple of turns pressing keys.

Ziggurat Zagger

Posts: 3163

Joined: Friday, 6th January 2012, 18:45

Post Wednesday, 4th April 2012, 02:15

Re: Make rest default to sif's channel

Thank you for the advice.

Return to Dungeon Crawling Advice

Who is online

Users browsing this forum: No registered users and 6 guests

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