include = no_vi_command_keys.txt show_more = false default_manual_training = true skill_focus = false default_show_all_skills = true force_more_message += (?!An|As|You|There)(?-i:[A-Z]{1}[a-z]+).*(come.*into.*view|open.*door|break.*door) autopickup_exceptions += = 3) or you.get_base_mutation_level("Clarity") == 1 or items.equipped_at("Amulet") and items.equipped_at("Amulet").name():find("Clar") or items.equipped_at("Body Armour") and items.equipped_at("Body Armour").name():find("Clar") then return true end return false end if name:find("Harm") or name:find("%*Noise") or name:find("%*Corrode") then return false end if name:find("%*Slow") then if you.race() == "Formicid" then return true end return false end if name:find("slick") then return false end if name:find("Mesm") then return false end if name:find("Charlatan") then return false end if name:find("mace of Variability") then if you.god() ~= "Xom" then return false end end return true end local class = it.class(true) local sub_type = it.subtype() if (class == "armour") then local armour_slots = { boots="Boots", cloak="Cloak", gloves="Gloves", helmet="Helmet", shield="Shield" } local equipped_item = items.equipped_at(armour_slots[sub_type]) if (sub_type == "boots") then if equipped_item then local plus = items.equipped_at("Boots").plus local nobrand = items.equipped_at("Boots").branded == false if nobrand then if plus < 2 and name:find("[" .. (plus + 1) .. "-2].*boots") then return true end if plus < 4 and name:find("[" .. (plus + 1) .. "-4].*barding") then return true end end return it.branded or it.ego else return true end end if (sub_type == "cloak") then if name:find("scarf.*harm") then return false elseif equipped_item then local plus = items.equipped_at("Cloak").plus local nobrand = items.equipped_at("Cloak").branded == false if plus < 2 and nobrand and name:find("[" .. (plus + 1) .. "-2].*cloak") then return true end return it.branded or it.ego else return true end end if (sub_type == "gloves") then if equipped_item then local plus = items.equipped_at("Gloves").plus local nobrand = items.equipped_at("Gloves").branded == false if plus < 2 and nobrand and name:find("[" .. (plus + 1) .. "-2].*gloves") then return true end return it.branded or it.ego elseif you.has_claws() ~= 0 then return it.branded or it.ego else return true end end if (sub_type == "helmet") then if equipped_item then local plus = items.equipped_at("Helmet").plus local a_hat = items.equipped_at("Helmet").ac local nobrand = items.equipped_at("Helmet").branded == false if plus < 2 and nobrand then if a_hat == 0 and plus < 2 and name:find("[" .. (plus + 1) .. "-2].*hat") then return true end if a_hat == 0 and name:find("[0-2].*helmet") then return true end if a_hat == 1 and plus < 2 and name:find("[" .. (plus + 1) .. "-2].*helmet") then return true end end return it.branded or it.ego else return true end end if (sub_type == "shield") then if equipped_item then local light = items.equipped_at("Shield").name():find("orb.*light") local buck = items.equipped_at("Shield").name():find("buck") local kite = items.equipped_at("Shield").name():find("kite") local plus = items.equipped_at("Shield").plus local ac = items.equipped_at("Shield").ac local nobrand = (items.equipped_at("Shield").branded) == false if nobrand then if ac == 3 and plus < 3 and name:find("[" .. (plus + 1) .. "-3].*buck") then return true end if ac == 8 and plus < 5 and name:find("[" .. (plus + 1) .. "-5].*kite") then return true end if ac == 13 and plus < 8 and name:find("[" .. (plus + 1) .. "-8].*tower") then return true end end if light and name:find("buck") then return true end if buck and name:find("buck") then return it.branded or it.ego end if buck and name:find("kite") then return true end if kite and name:find("kite") then return it.branded or it.ego end if name:find("tower") then return true end if name:find("orb") then return false end return it.branded or it.ego elseif name:find("buck") then return true else return false end end end if (class == "weapon") then local equipped_weapon = items.equipped_at("Weapon") if equipped_weapon then if equipped_weapon.weap_skill == "Short Blades" then if equipped_weapon.name():find("dagger") then if you.class():find("Wizard") and name:find("staff.*conj") then return true elseif you.class() == "Summoner" and name:find("staff.*summoning") then return true elseif you.class() == "Necromancer" and name:find("staff.*death") then return true elseif you.class() == "Fire Elementalist" and name:find("staff.*fire") then return true elseif you.class() == "Ice Elementalist" and name:find("staff.*cold") then return true elseif you.class() == "Air Elementalist" and name:find("staff.*air") then return true elseif you.class() == "Earth Elementalist" and name:find("staff.*earth") then return true elseif you.class() == "Venom Mage" and name:find("staff.*poison") then return true elseif you.class() == "Alchemist" and name:find("staff.*alchemy") then return true end end end elseif you.class():find("Wizard") and name:find("staff.*conj") then return true elseif you.class() == "Summoner" and name:find("staff.*summoning") then return true elseif you.class() == "Necromancer" and name:find("staff.*death") then return true elseif you.class() == "Fire Elementalist" and name:find("staff.*fire") then return true elseif you.class() == "Ice Elementalist" and name:find("staff.*cold") then return true elseif you.class() == "Air Elementalist" and name:find("staff.*air") then return true elseif you.class() == "Earth Elementalist" and name:find("staff.*earth") then return true elseif you.class() == "Venom Mage" and name:find("staff.*poison") then return true elseif you.class() == "Alchemist" and name:find("staff.*alchemy") then return true elseif you.base_skill("Unarmed Combat") == 0 and name:find("[0-9].*dagger") then return true else return false end end end) } { function version() local check_crawl_version = tonumber(string.sub(crawl.version("major"), 3, 4)) return check_crawl_version end } { function set_target(skill) local level = you.base_skill(skill) if skill == "Fighting" or skill == "Spellcasting" then for target = 1, 27, 2 do if level < target and target < 27 then you.set_training_target(skill, target) break end end elseif skill == "Unarmed Combat" then for target = 0, 27, 5.4 do if level < target and target < 27 then you.set_training_target("Unarmed Combat", math.ceil(target)) break end end elseif skill == "Throwing" then local throw = { 2, 6, 12, 16 } for k = 1, 4 do if level < throw[k] then you.set_training_target(skill, throw[k]) break end end elseif skill == "Stealth" then if level >= 1 and you.train_skill(skill) == 2 then you.train_skill(skill, 0) end if level < 1 then you.set_training_target(skill, 1) else for target = 6, 27, 3 do if level < target and target < 27 then you.set_training_target(skill, target) break end end end else for target = 6, 27, 3 do if level < target and target < 27 then you.set_training_target(skill, target) break end end end end } { local oka = true function ctrl_weapon() local equipped_weapon = items.equipped_at("Weapon") if equipped_weapon then local weapon_type = equipped_weapon.weap_skill local weapon_name = equipped_weapon.name() local weapon_delay = equipped_weapon.delay local weapon_base = you.base_skill(weapon_type) local weapon_target = you.get_training_target(weapon_type) local delay_09 = weapon_delay >= 10 and (weapon_delay - 9) * 2 or 0 local delay_min = (weapon_delay - (math.min(7, math.floor(weapon_delay / 2)))) * 2 local target_weapon_09 = weapon_base < delay_09 local target_weapon_min = weapon_base < delay_min local oka_yn = "Y = 14 weapon skill target (for Okawaru weapon gift)\nN = "..delay_min.." ( "..weapon_name.." ) min delay" if you.turns() == 0 then you.train_skill(weapon_type, 0) elseif target_weapon_09 then you.set_training_target(weapon_type, delay_09) elseif target_weapon_min then if version() >= 31 and you.god() == "Okawaru" then if delay_min < 14 and oka and you.feel_safe() then if crawl.yesno(oka_yn, true) then you.set_training_target(weapon_type, 14) oka = false else you.set_training_target(weapon_type, delay_min) oka = false end else you.set_training_target(weapon_type, delay_min) end else you.set_training_target(weapon_type, delay_min) end end else if you.turns() == 0 then you.train_skill("Unarmed Combat", 0) elseif you.base_skill("Unarmed Combat") ~= 0 or you.race() == "Felid" then set_target("Unarmed Combat") end end end } { function ctrl_shield() local function size_factor() local size_large = you.race() == "Troll" or you.race() == "Ogre" or you.race() == "Oni" local size_hybrid = you.race() == "Centaur" or you.race() == "Naga" or you.race() == "Palentonga" or you.race() == "Armataur" local big = ( size_large or size_hybrid ) and -2 or nil local size_little = you.race() == "Spriggan" and 4 or nil local size_small = you.race() == "Kobold" and 2 or nil return big or size_little or size_small or 0 end local function EV_penalty() local EV_penalty = nil if version() < 28 then if items.equipped_at("Shield") then if items.equipped_at("Shield").name():find("buck") then EV_penalty = 0.8 elseif items.equipped_at("Shield").name():find("kite") then EV_penalty = 3 elseif items.equipped_at("Shield").name():find("tower") then EV_penalty = 5 end end elseif version() >= 30 then if items.equipped_at("Shield") then if items.equipped_at("Shield").name():find("buck") then EV_penalty = 5 elseif items.equipped_at("Shield").name():find("kite") then EV_penalty = 10 elseif items.equipped_at("Shield").name():find("tower") then EV_penalty = 15 end end end return EV_penalty or nil end local EV_penalty = EV_penalty() if EV_penalty then if version() < 28 then local size_factor = size_factor() local target = EV_penalty * ( 5 + size_factor ) you.set_training_target("Shields", target) elseif version() >= 30 then local str = you.strength() local shield_lv = you.base_skill("Shields") local p1 = nil local p0 = nil for s = 0, 27, 1 do local p = (2/5) * ((EV_penalty * EV_penalty) / (5 + str)) * ((27 - s) / 27) if p < 1 and not p1 then p1 = s end if p < 0.0500 and not p0 then p0 = s end if p0 then break end end if p1 and p1 ~= 0 and p1 > shield_lv then you.set_training_target("Shields", p1) elseif p0 and p0 > shield_lv then you.set_training_target("Shields", p0) end end end end } { function ctrl_school_list() local school_list = { "Conjurations", "Hexes", "Charms", "Summonings", "Necromancy", "Translocations", "Transmutations", "Alchemy", "Fire Magic", "Ice Magic", "Air Magic", "Earth Magic", "Poison Magic" } for k = #school_list, 1, -1 do local school = school_list[k] if version() >= 26 then if school == "Charms" then table.remove(school_list, k) end end if version() < 31 then if school == "Alchemy" then table.remove(school_list, k) end elseif school == "Transmutations" or school == "Poison Magic" then table.remove(school_list, k) end end return school_list end } { function ctrl_spell(...) local function school_name(name) if name == "Conjuration" then return "conjurations" elseif name == "Summoning" then return "summonings" elseif name == "Translocation" then return "translocations" elseif name == "Transmutation" then return "transmutations" elseif name == "Fire" then return "fire magic" elseif name == "Ice" then return "ice magic" elseif name == "Air" then return "air magic" elseif name == "Earth" then return "earth magic" elseif name == "Poison" then return "poison magic" else return name end end local function ctrl_school_search(spell) local school_search = spells.describe(spell) if school_search and school_search ~= "" then if school_search:find("School:") then school_1 = school_search:match("School:%s*(.-)%s*Fail:") elseif school_search:find("Schools:") then school_find = school_search:match("Schools:%s*(.-)%s*Fail:") school_1, school_2, school_3 = school_find:match("([^/]+)/?([^/]*)/?([^/]*)") end end school_1 = school_name(school_1) school_2 = school_name(school_2 or "") school_3 = school_name(school_3 or "") local school_1_gt = you.get_training_target(school_1) local school_2_gt = you.get_training_target(school_1) local school_3_gt = you.get_training_target(school_1) local sam_lv = 0 school_1_lv = school_1 ~= "" and you.base_skill(school_1) school_2_lv = school_2 ~= "" and you.base_skill(school_2) or nil school_3_lv = school_3 ~= "" and you.base_skill(school_3) or nil max_lv = math.max(school_1_lv, school_2_lv or 0, school_3_lv or 0) min_lv = math.min(school_1_lv, school_2_lv or 100, school_3_lv or 100) if school_1_lv == min_lv then sam_lv = sam_lv + 1 end if school_2_lv == min_lv then sam_lv = sam_lv + 1 end if school_3_lv == min_lv then sam_lv = sam_lv + 1 end local sam_cost = 0 school_1_cost = school_1 ~= "" and you.skill_cost(school_1) school_2_cost = school_2 ~= "" and you.skill_cost(school_2) or 100 school_3_cost = school_3 ~= "" and you.skill_cost(school_3) or 100 min_cost = math.min(school_1_cost,school_2_cost,school_3_cost) if school_1_cost == min_cost then sam_cost = sam_cost + 1 end if school_2_cost == min_cost then sam_cost = sam_cost + 1 end if school_3_cost == min_cost then sam_cost = sam_cost + 1 end local spell_fail = spells.fail(spell) if spell_fail > 1 then if school_1_lv and school_2_lv == nil and school_3_lv == nil then for lv = 1, 27, 2 do if school_1_lv < lv and school_1_lv < 27 then you.set_training_target(school_1, lv) break end end elseif sam_cost > 1 and sam_lv == 1 then for lv = 1, 27 do if school_1_lv and school_1_lv < lv and school_1_cost == min_cost and school_1_lv == max_lv and school_1_lv < 27 then you.set_training_target(school_1, lv) break end if school_2_lv and school_2_lv < lv and school_2_cost == min_cost and school_2_lv == max_lv and school_2_lv < 27 then you.set_training_target(school_2, lv) break end if school_3_lv and school_3_lv < lv and school_3_cost == min_cost and school_3_lv == max_lv and school_3_lv < 27 then you.set_training_target(school_3, lv) break end end elseif sam_cost > 1 and sam_lv > 1 then for lv = 1, 27 do if school_1_lv and school_1_lv < lv and school_1_cost == min_cost and school_1_lv == min_lv and school_1_lv < 27 then you.set_training_target(school_1, lv) break end if school_2_lv and school_2_lv < lv and school_2_cost == min_cost and school_2_lv == min_lv and school_2_lv < 27 and school_1_gt == 0 then you.set_training_target(school_2, lv) break end if school_3_lv and school_3_lv < lv and school_3_cost == min_cost and school_3_lv == min_lv and school_3_lv < 27 and school_2_gt == 0 then you.set_training_target(school_3, lv) break end end else for lv = 1, 27 do if school_1_lv and school_1_lv < lv and school_1_cost == min_cost and school_1_lv < 27 then you.set_training_target(school_1, lv) break end if school_2_lv and school_2_lv < lv and school_2_cost == min_cost and school_2_lv < 27 then you.set_training_target(school_2, lv) break end if school_3_lv and school_3_lv < lv and school_3_cost == min_cost and school_3_lv < 27 then you.set_training_target(school_3, lv) break end end end end end if you.turns() ~= 0 then local ctrl_type = ... for slot, spell in pairs(you.spell_table()) do if ctrl_type == 2 then if slot == "z" or slot == "x" then ctrl_school_search(spell) end elseif ctrl_type == 3 then if slot == "z" or slot == "x" or slot == "a" then ctrl_school_search(spell) end elseif ctrl_type == 0 then if slot == "O" or slot == "P" then ctrl_school_search(spell) end else if slot == "z" then ctrl_school_search(spell) end end end end end } { function ctrl_invo() local god_list = { { name = "Cheibriados", invo = { 6, 9, 10, 15 } }, { name = "Dithmenos", invo = { 2, 0, 0, 15 } }, { name = "Dithmenos", invo = { 0, 6, 10, 15 }, remake = 32 }, { name = "Elyvilon", invo = { 3, 5, 0, 15 } }, { name = "Fedhas Madash", invo = { 2, 11, 0, 15 }, remake = 24}, { name = "Hepliaklqana", invo = { 0, 5, 10, 0 } }, { name = "Okawaru", invo = { 3, 0, 0, 10 } }, { name = "Okawaru", invo = { 3, 0, 10, 15 }, remake = 28 }, { name = "Uskayaw", invo = { 0, 0, 0, 21 } }, { name = "Zin", invo = { 3, 6, 9, 15 } }, { name = "The Shining One", invo = { 5, 0, 13, 15 } } } local invo_base = you.base_skill("Invocations") local believe = you.god() local piety = you.piety_rank() local remake_version = nil local no_remake = true for _, god in ipairs(god_list) do if god.name == believe then if god.remake then if god.remake <= version() then if not remake_version or god.remake > remake_version then remake_version = god.remake end end end end end if remake_version and remake_version <= version() then for _, god in ipairs(god_list) do if god.name == believe then if god.remake == remake_version then for rank, invo in ipairs(god.invo) do if piety <= rank then if invo ~= 0 then if invo_base < invo then you.set_training_target("Invocations", invo) no_remake = false break end end end end end end end end if no_remake then for _, god in ipairs(god_list) do if god.name == believe then if god.remake == nil then for rank, invo in ipairs(god.invo) do if piety <= rank then if invo ~= 0 then if invo_base < invo then you.set_training_target("Invocations", invo) break end end end end end end end end end } { function ctrl_evo() local function log2(x) return math.log(x) / math.log(2) end local evo_base = you.base_skill("Evocations") local tin = 1 local water = 1 local evo_tin = {} local evo_water = {} local evo_beast = {} local evo_spider = {} for slot = 0, 51 do key = items.inslot(slot) if key then check_tin = key.name():find("tin.*tremor") check_water = key.name():find("phial.*floo") for evo = 6, 27, 0.1 do local each_boom = math.floor(1 + 2 * log2(1 + evo / 6)) local evo_boom = math.ceil(evo) if check_tin and each_boom > tin then tin = each_boom if evo_boom > evo then table.insert(evo_tin, evo_boom) end end local base_dur = math.floor(2.1 + 2 * evo / 5) local evo_dur = math.ceil(evo) if check_water and base_dur > water then water = base_dur if evo_dur > evo then table.insert(evo_water, evo_dur) end end end if version() >= 26 then check_beast = key.name():find("box.*beast") if check_beast then evo_beast = { 9, 15, 21 } end end if version() >= 31 then check_spider = key.name():find("sack.*spider") if check_spider then evo_spider = { 14, 18, 21 } end end end end local evo_blink = false local evo_invi = false for _, evo_abil in ipairs(you.ability_table()) do if evo_abil == "Evoke Blink" then evo_blink = true end if evo_abil == "Evoke Invisibility" then evo_invi = true end end local memo_blink = spells.memorised("Blink") if evo_blink then if memo_blink then evo_blink = false else evo_blink = 12 end end local memo_invi = spells.memorised("Invisibility") if evo_invi then if version() < 32 then if memo_invi then evo_invi = false else evo_invi = 22 end else evo_invi = 12 end end if evo_blink and evo_base < evo_blink then you.set_training_target("Evocations", evo_blink) elseif evo_invi and evo_invi == 12 and evo_base < evo_invi then you.set_training_target("Evocations", evo_invi) elseif evo_base < 6 then you.set_training_target("Evocations", 6) else local evo_all = {} if next(evo_tin) then for _, evo in ipairs(evo_tin) do table.insert(evo_all, evo) end end if next(evo_water) then for _, evo in ipairs(evo_water) do table.insert(evo_all, evo) end end if next(evo_beast) then for _, evo in ipairs(evo_beast) do table.insert(evo_all, evo) end end if next(evo_spider) then for _, evo in ipairs(evo_spider) do table.insert(evo_all, evo) end end if evo_invi then table.insert(evo_all, evo_invi) end if next(evo_all) then table.sort(evo_all) for _, evo in ipairs(evo_all) do if evo_base < evo then you.set_training_target("Evocations", evo) break end end end end end } { function ctrl_trans() local form_now = you.transform() local form_base = you.base_skill("Shapeshifting") local form_target = you.get_training_target("Shapeshifting") local form_list = { [7] = { min = 0, form = { "beast" } }, [14] = { min = 7, form = { "flux" } }, [19] = { min = 10, form = { "blade", "maw", "snake" } }, [25] = { min = 16, form = { "statue", "dragon" } }, [27] = { min = 23, form = { "storm", "death" } } } for target, list in pairs(form_list) do for _, form in ipairs(list.form) do if form_now == form then if form_base < target then if you.mutation_overview():find("reduced hp") then if you.train_skill("Shapeshifting") == 0 then you.train_skill("Shapeshifting", 2) you.set_training_target("Shapeshifting", list.min) break end else you.set_training_target("Shapeshifting", target) break end end end end end end } { function ctrl_skill() if you.race() ~= "Gnoll" then if you.turns() == 0 then you.train_skill("Fighting", 2) ctrl_weapon() you.train_skill("Armour", 0) you.train_skill("Shields", 0) you.train_skill("Dodging", 0) you.train_skill("Stealth", 2) you.train_skill("Spellcasting", 0) for _, schools in pairs(ctrl_school_list()) do you.train_skill(schools, 0) end if version() >= 31 then you.train_skill("Shapeshifting", 0) end you.train_skill("Invocations", 0) you.train_skill("Evocations", 0) you.train_skill("Throwing", 0) else ctrl_weapon() ctrl_shield() set_target("Fighting") if you.race() ~= "Draconian" and you.race() ~= "Felid" and you.race() ~= "Octopode" then set_target("Armour") end if you.race() ~= "Felid" then set_target("Throwing") end set_target("Dodging") set_target("Stealth") if you.god() ~= "Trog" then set_target("Spellcasting") end if you.race() ~= "Demigod" then ctrl_invo() end ctrl_evo() ctrl_trans() end end end } { local bin_head = true local bin_hand = true local bin_foot = true local bin_back = true local bin_buck = true local bin_dagg = true local bin_staf = true function ctrl_bag() local acq_slot = false local exp_slot = false local fully_id_not = false local id_slot = nil local cu_slot = nil local tele_slot = nil local heal_slot = nil local useless_scroll_slot = nil local useless_potion_slot = nil local bin_hat_slot = nil local bin_hel_slot = nil local bin_hand_slot = nil local bin_foot_slot = nil local bin_back_slot = nil local bin_buck_slot = nil local bin_dagg_slot = nil local bin_staf_slot = nil for slot = 0, 51 do key = items.inslot(slot) if key then acq = key.name():find("scroll.*acq") exp = key.name():find("potion.*exp") id = key.name():find("scroll.*id") cu = key.name():find("potion.*cu") tele = key.name():find("scroll.*tele") heal = key.name():find("potion.*heal") useless_scroll = key.name():find("scroll.*noise") useless_potion = key.name():find("potion.*degen") no_bin_hat = key.name():find("hat") no_bin_hel = key.name():find("helmet") no_bin_hand = key.name():find("pair.*glov") no_bin_foot = key.name():find("pair.*boots") no_bin_bard = key.name():find("barding") no_bin_back = key.name():find("cloak") no_bin_buck = key.name():find("buck") no_bin_dagg = key.name():find("dagg") no_bin_staf = key.name():find("staff") fully_id = key.fully_identified if acq then if slot ~= 17 then if items.inslot(17) then local find_bin_slot = false for bin_slot = 0, 51 do if not items.inslot(bin_slot) then items.swap_slots(bin_slot, 17) find_bin_slot = true break end end if not find_bin_slot then items.swap_slots(slot, 17) end else items.swap_slots(slot, 17) end end acq_slot = true end if exp then if slot ~= 16 then if items.inslot(16) then local find_bin_slot = false for bin_slot = 0, 51 do if not items.inslot(bin_slot) then items.swap_slots(bin_slot, 16) find_bin_slot = true break end end if not find_bin_slot then items.swap_slots(slot, 16) end else items.swap_slots(slot, 16) end end exp_slot = true end if fully_id == false then fully_id_not = true end if id then id_slot = slot end if cu then cu_slot = slot end if tele then tele_slot = slot end if heal then heal_slot = slot end if useless_scroll then useless_scroll_slot = slot end if useless_potion then useless_potion_slot = slot end if not (key.artefact) then if not (key.branded) then if bin_foot then if no_bin_bard then bin_foot_slot = slot elseif no_bin_foot then bin_foot_slot = slot end end if bin_back and no_bin_back then bin_back_slot = slot end if bin_hand and no_bin_hand then bin_hand_slot = slot end if bin_head and no_bin_hat then bin_hat_slot = slot end if bin_head and no_bin_hel then bin_hel_slot = slot end if bin_buck and no_bin_buck then bin_buck_slot = slot end if bin_dagg and no_bin_dagg then bin_dagg_slot = slot end if bin_staf and no_bin_staf then bin_staf_slot = slot end end end end end if you.feel_safe() then if useless_scroll_slot then items.inslot(useless_scroll_slot).drop() end if useless_potion_slot then items.inslot(useless_potion_slot).drop() end if you.transform() == "" or you.transform() == "Death" then if bin_foot then if items.equipped_at("Boots") then bin_foot = false elseif bin_foot_slot then items.inslot(bin_foot_slot).wear() bin_foot = false end end if bin_back then if items.equipped_at("Cloak") then bin_back = false elseif bin_back_slot then items.inslot(bin_back_slot).wear() bin_back = false end end if bin_hand then if you.has_claws() ~= 0 then bin_hand = false elseif items.equipped_at("Gloves") then bin_hand = false elseif bin_hand_slot then items.inslot(bin_hand_slot).wear() bin_hand = false end end if bin_head then if items.equipped_at("Helmet") then bin_head = false elseif bin_hat_slot then items.inslot(bin_hat_slot).wear() bin_head = false elseif bin_hel_slot then items.inslot(bin_hel_slot).wear() bin_head = false end end if bin_buck then if items.equipped_at("Shield") then bin_buck = false elseif bin_buck_slot then items.inslot(bin_buck_slot).wear() bin_buck = false end end if bin_dagg then if items.equipped_at("Weapon") then bin_dagg = false elseif bin_dagg_slot then items.inslot(bin_dagg_slot).wield() bin_dagg = false end end if bin_staf then if items.equipped_at("Weapon") and items.equipped_at("Weapon").name():find("staff") then bin_staf = false bin_dagg = false elseif bin_staf_slot then items.inslot(bin_staf_slot).wield() bin_staf = false bin_dagg = false end end end end local function ctrl_slot(name,slot) if name and name ~= slot then if items.inslot(slot) then local find_bin_slot = false for bin_slot = 0, 51 do if not items.inslot(bin_slot) then items.swap_slots(bin_slot, slot) find_bin_slot = true break end end if not find_bin_slot then items.swap_slots(name, slot) end else items.swap_slots(name, slot) end end end local function ctrl_swap(name1,slot1,name2,slot2) if name1 and name1 == slot2 and name2 and name2 == slot1 then items.swap_slots(name1, name2) end ctrl_slot(name1,slot1) ctrl_slot(name2,slot2) end if not acq_slot then if you.feel_safe() then ctrl_swap(id_slot, 17, tele_slot, 43) else ctrl_swap(id_slot, 43, tele_slot, 17) end end if not exp_slot then if you.poisoned() or you.confused() then ctrl_swap(cu_slot, 16, heal_slot, 42) else ctrl_swap(cu_slot, 42, heal_slot, 16) end end end } { function ctrl_travel() local fly_1 = you.race() == "Gargoyle" and you.mutation("big wings") ~= 0 local fly_2 = you.race() == "Tengu" and you.mutation("evasive flight") ~= 0 local fly_3 = you.race() == "Djinni" and you.mutation("float") ~= 0 local fly = fly_1 or fly_2 or fly_3 local amphibious = you.race() == "Merfolk" or you.race() == "Octopode" or you.race() == "Barachi" local form_large = you.transform() == "Ice" or you.transform() == "Snake" local form_giant = you.transform() == "Dragon" local size_large = you.race() == "Troll" or you.race() == "Ogre" or you.race() == "Oni" local size_hybrid = you.race() == "Centaur" or you.race() == "Naga" or you.race() == "Palentonga" or you.race() == "Armataur" local deep = fly or amphibious or form_large or form_giant local shallow = size_large or size_hybrid if deep then if you.branch() == "Shoals" then crawl.setopt("travel_avoid_terrain = deep water") else crawl.setopt("travel_avoid_terrain = ") end elseif shallow then if version() < 30 then -- Large species move at normal speed through shallow water. crawl.setopt("travel_avoid_terrain = shallow water, deep water") else crawl.setopt("travel_avoid_terrain = deep water") end else crawl.setopt("travel_avoid_terrain = shallow water, deep water") end if you.god() == "No God" then crawl.setopt("explore_stop += altars") else crawl.setopt("explore_stop -= altars") end end } { function c_answer_prompt(prompt) if prompt == "Die?" then return false end if version() < 25 and prompt:find("Memorise Iskenderun's Mystic Blast") then return false end if version() < 27 and prompt:find("Memorise Chain Lightning") then return false end if version() < 32 and prompt:find("Memorise Teleport Other") then return false end end }