tile_display_mode = glyphs flash_screen_message += Jiyva alters your body. force_more_message += You have finished your manual force_more_message += Jiyva alters your body. runrest_stop_message += Your transformation is almost over auto_butcher = true mlist_min_height = 8 easy_confirm = all msg_condense_repeats = true msg_max_height = 6 explore_auto_rest = true mlist_allow_alternate_layout = true view_max_width = 61 allow_extended_colours = true default_manual_training = true travel_delay = 20 rest_delay = 0 sacrifice_before_explore = true auto_sacrifice = true confirm_butcher = never easy_eat_chunks = true auto_eat_chunks = true auto_drop_chunks = rotten ####################################################### ## Swap weapon to inscribed on explore/rest ## ## Also warn before resting if rest not needed ## ######################################################## { queued_actions = {} function swap_for_autoexplore() local w = items.equipped_at("Weapon") if w and string.find(w.inscription, "autoexplore") then return nil else for i, j in ipairs(items.inventory()) do if string.find(j.inscription, "autoexplore") then return items.index_to_letter(j.slot) end end return nil end end function swap_for_autorest() local w = items.equipped_at("Weapon") if w and string.find(w.inscription, "autorest") then return nil else for i, j in ipairs(items.inventory()) do if string.find(j.inscription, "autorest") then return items.index_to_letter(j.slot) end end return nil end end function autorefresh_slot() local w = items.equipped_at("Weapon") if w and string.find(w.inscription, "autorefresh") then return items.index_to_letter(w.slot) end end function should_rest() if you.breath_timeout() then return true end if hp_percent() ~= 100 then return true end if mp_percent() ~= 100 then return true end bad_statuses = {"hop", "contam", "slowed", "potion", "cooldown", "berserk", "mark", "corr", "weakened", "spewing sludge", "Wisp%-form", "weak%-willed", "silenced"} for k, v in pairs(bad_statuses) do if string.find(string.lower(you.status()), string.lower(v)) then crawl.mpr("Waiting off " .. v) return true end end if you.god() == "Hepliaklqana" and you.piety_rank() > 0 then found_ancestor = false for x=-los,los do for y=-los,los do mons = monster.get_monster_at(x, y) if mons ~= nil then if string.find(mons:desc(true), "insubstantial memory") then if mons:damage_level() > 0 then crawl.mpr("Waiting for ancestor to heal") return true end found_ancestor = true end end end end if not found_ancestor then crawl.mpr("Waiting for ancestory") return true end end if you.god() == "Yrede" then for x=-los,los do for y=-los,los do mons = monster.get_monster_at(x, y) if mons ~= nil then if string.find(mons:desc(true), "bound") then if mons:damage_level() > 0 then crawl.mpr("Waiting for bound soul to heal") return true end end end end end end return false end function custom_autoexplore() no_explore_statuses = {"mark"} for k, v in pairs(no_explore_statuses) do if string.find(string.lower(you.status()), string.lower(v)) then crawl.mpr("Not autoexploring with " .. v) return end end if not you.feel_safe() then crawl.mpr("But you're not safe!") return end if dangerous_friend then crawl.mpr("Not exploring near that thing") return end if should_rest() then crawl.sendkeys("5") return end local action = "" local swap = swap_for_autoexplore() if swap then crawl.mpr("Swap") action = "w" .. swap crawl.sendkeys(action) queued_actions = {"o"} return end if autorefresh_needed then crawl.mpr("refresh") local refresh = autorefresh_slot() if refresh then crawl.sendkeys("w -") queued_actions = {"w" .. refresh, "o"} autorefresh_needed = False return end end crawl.sendkeys("o") end function hp_percent() a,b=you.hp() return 100*a/b end function mp_percent() a,b=you.mp() if a == 0 and b == 0 then return 100 end return 100*a/b end function custom_rest() if not you.feel_safe() then crawl.mpr("But you're not safe!") return end local swap = swap_for_autorest() if swap then action = "w" .. swap crawl.sendkeys(action) end if not you.feel_safe() then return end if autorefresh_needed then local refresh = autorefresh_slot() if refresh then crawl.mpr("autorefresh") crawl.sendkeys("w -") if not you.feel_safe() then return end crawl.sendkeys("w" .. refresh) end autorefresh_needed = False end if not should_rest() then if crawl.yesno("Wait 100 turns?", true, 'n') then crawl.sendkeys("5") end else crawl.sendkeys("5") end end function check_queue() if next(queued_actions) == nil then return end if not you.feel_safe() then crawl.mpr('Not safe, discarding queue') queued_actions = {} return end action = table.remove(queued_actions, 1) crawl.mpr('Executing queued action') crawl.sendkeys(action) end function queue_and_do_first(actions) if next(queued_actions) ~= nil then crawl.mpr('Already have queued actions - confused. Clearing.') queued_actions = {} return end queued_actions = actions check_queue() end function test_queue() queue_and_do_first({"n", "n"}) end function queue_statue() crawl.mpr('Queue statue') queue_and_do_first({"we", "zs", "w-"}) end function queue_storm() crawl.mpr('Queue storm') queue_and_do_first({"PUI", "zb", "PIU"}) end } function exclude_all_hostiles() for x=-los,los do for y=-los,los do mons = monster.get_monster_at(x, y) if mons ~= nil then if mons:attitude() == 0 and not mons:is_firewood() then travel.set_exclude(mons:x_pos(), mons:y_pos(),los) end end end end end macros += M o ===custom_autoexplore macros += M 7 ===custom_rest macros += M 8 ' macros += M \{167} Za macros += M 1 Zb macros += M 2 Zc macros += M 3 Zd macros += M 4 Ze macros += M \{-531} Zf macros += M \{-528} Zg macros += M \{-530} Zh macros += M \{-532} Zi