confirm_butcher = never auto_butcher = true autofight_stop = 50 autopickup_exceptions += wand of (p|l|f|e|c|m|s|ic) ################################## # For descriptions of all options, as well as some more in-depth information # on setting them, consult the file # options_guide.txt # in your /docs directory. If you can't find it, the file is also available # online at: # https://gitorious.org/crawl/crawl/source/HEAD:crawl-ref/docs/options_guide.txt # # Crawl uses the first file of the following list as its option file: # * init.txt in the -rcdir directory (if specified) # * .crawlrc in the -rcdir directory (if specified) # * init.txt (in the Crawl directory) # * ~/.crawl/init.txt (Unix only) # * ~/.crawlrc (Unix only) # * ~/init.txt (Unix only) # * settings/init.txt (in the Crawl directory) ##### Some basic explanation of option syntax ####################### # Lines beginning with '#' are comments. The basic syntax is: # # field = value or field.subfield = value # # Only one specification is allowed per line. # # The terms are typically case-insensitive except in the fairly obvious # cases (the character's name and specifying files or directories when # on a system that has case-sensitive filenames). # # White space is stripped from the beginning and end of the line, as # well as immediately before and after the '='. If the option allows # multiple comma/semicolon-separated terms (such as # autopickup_exceptions), all whitespace around the separator is also # trimmed. All other whitespace is left intact. # # There are three broad types of Crawl options: true/false values (booleans), # arbitrary values, and lists of values. The first two types use only the # simple =, with later options - which includes your options that are different # from the defaults - overriding earlier ones. List options allow using +=, ^=, # -=, and = to append, prepend, remove, and reset, respectively. Usually you will # want to use += to add to a list option. Lastly, there is := which you can use # to create an alias, like so: # ae := autopickup_exceptions # From there on, 'ae' will be treated as if it you typed autopickup_exceptions, # so you can save time typing it. # ##### Other files ################################################### # You can include other files from your options file using the 'include' # option. Crawl will treat it as if you copied the whole text of that file # into your options file in that spot. You can uncomment some of the following # lines by removing the beginning '#' to include some of the other files in # this folder. # Some useful, more advanced options, implemented in LUA. # include = advanced_optioneering.txt # Alternative vi bindings for Dvorak users. # include = dvorak_command_keys.txt # Alternative vi bindings for Colemak users. # include = colemak_command_keys.txt # Override the vi movement keys with a non-command. # include = no_vi_command_keys.txt ##### Ancient versions ############################################## # If you're used to the interface of ancient versions of Crawl, you may # get back parts of it by uncommenting the following options: # include = 034_command_keys.txt # And to revert monster glyph and colouring changes: # include = 034_monster_glyphs.txt # include = 052_monster_glyphs.txt # include = 060_monster_glyphs.txt # include = 071_monster_glyphs.txt # include = 080_monster_glyphs.txt # include = 0.9_monster_glyphs.txt # include = 0.12_monster_glyphs.txt # include = 0.13_monster_glyphs.txt # include = 0.14_monster_glyphs.txt { --------------------------------------------------------------------------- -- 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 -- Modified by CommanderC --------------------------------------------------------------------------- -- 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 = "staff of energy" 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 crawl.process_keys('\'') 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) crawl.more_autoclear(true) -- Repeat command while mp < max_mp, prompting for breaks if hungry or -- if hunger status changes. local mp, max_mp = you.mp() local max_turn = 20 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() if max_turn <= 1 then return else max_turn = max_turn - 1 end end crawl.more_autoclear(false) 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 function autofight_safe() tab_loop() end function tab_loop() crawl.more_autoclear(true) local hp, max_hp = you.hp() local max_turn = 5 local min_hp = hp while hp >= min_hp do crawl.process_keys('\t') coroutine.yield(true,true) hp,max_hp = you.hp() if max_turn <= 1 then crawl.mpr("turn is over") return else max_turn = max_turn - 1 end end crawl.mpr("end of macro") crawl.more_autoclear(false) end function autofight_interrupt_macro(interrupt_name) if interrupt_name == "message" then else crawl.mpr(interrupt_name) end return interrupt_name == test end chk_interrupt_macro.autofight_safe = autofight_interrupt_macro }