-- Utility Functions { function version() return tonumber(string.sub(crawl.version("major"), 3, 4)) end } -- Equipment Auto-pickup Function { add_autopickup_func(function(it, name) if it.is_useless then return false end if it.artefact then if name:find("%*Rage") then if you.god() == "Trog" or (you.god() == "Ashenzari" and you.piety_rank() >= 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 else return false 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) } -- Travel Control Function { 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 else crawl.setopt("travel_avoid_terrain = deep water") end if you.god() == "No God" then crawl.setopt("explore_stop += altars") else crawl.setopt("explore_stop -= altars") end 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 } -- Spell Fail Rate Check { safe = 10 spellTable = {} function checkSpellFailRate() for index, spellName in pairs(you.spells()) do fail = spells.fail(spellName) if rawget(spellTable, spellName) == nil then spellTable[spellName] = 0 end if rawget(spellTable, spellName) == 0 and fail < safe then crawl.mpr(string.format("%s spell is stabilized!", spellName)) spellTable[spellName] = 1 end end end } -- Prompt Handling Functions { function c_answer_prompt(prompt) if prompt == "Die?" or prompt == "Annotate level on other end of current stairs?" or prompt == "Are you sure you want to leave the Dungeon? This will make you lose the game!" 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 if prompt:find("vortices") or prompt:find("vortex") or prompt:find("battlesphere") then return true end if prompt:find("Really.*into that cloud of flame?") and you.res_fire() == 3 then return true end if prompt:find("Really.*into that cloud of freezing vapour?") and you.res_cold() == 3 then return true end end } -- Initialize skill menu on game start { local need_skills_opened = true function skill() if you.turns() == 0 and need_skills_opened then need_skills_opened = false crawl.sendkeys("m") end end } -- Main ready function { function ready() --ctrl_travel() ctrl_spell() ctrl_skill() ctrl_bag() checkSpellFailRate() end } ### 편리하고 안전한 던전 탐험을 위한 메시지 로그창 최적화 ####################################################################### ## 너무 긴 메시지 넘기기 show_more = true ## 매뉴얼 다 썼을 때 다음장 출력 force_more_message += You have finished your manual ## 변신 풀릴 때 다음장 출력 force_more_message += Your transformation is almost over. ## 특이한 상황이 발생하면 강제적으로 -다음 장-을 띄워주는 기능 force_more_message += Ouch! That really hurt! force_more_message += LOW HITPOINT WARNING force_more_message += The mighty Pandemonium lord .* resides here force_more_message += Your transformation is almost over force_more_message += A sentinel's mark forms upon you force_more_message += god:(sends|finds|silent|anger) force_more_message += watched by something force_more_message += flickers and vanishes! force_more_message += You feel yourself slow down force_more_message += hell_effect: force_more_message += You feel less protected from missiles force_more_message += skill increases to level ## 디스펠언데드 피격시 force_more_message += You convulse ## 조트함정 발동 force_more_message += (blundered into a|invokes the power of) Zot ## 데스도어 관련 confirm_action += Death's Door # 데스도어 지속 만료 경고 force_more_message += time is quickly running out flash_screen_message += time is quickly running out ## 데미지 18이상 들어온 공격에 –more- force_more_message += you!! force_more_message += you with.*!! ## 위험한 상황이나 급박한 변화인 경우 more 출력 force_more_message -= You finish merging with the rock force_more_message += You have reached level force_more_message += You fall through a shaft force_more_message += You enter a teleport trap force_more_message += You are suddenly yanked force_more_message += interdimensional caravan force_more_message += distant snort force_more_message += You hear the loud beating of a very distant drum force_more_message += Found a gateway leading out of the Abyss force_more_message += Found a gateway leading deeper into the Abyss force_more_message += Found .* abyssal rune of Zot force_more_message += Careful! force_more_message += You are starting to lose your buoyancy force_more_message += You miscast Flight force_more_message += filled with .* inner flame force_more_message += grabs you force_more_message += starts rolling force_more_message += looks more exp force_more_message += vile air hits you force_more_message += engulfs you in water force_more_message += breathes miasma force_more_message += You feel your flesh start force_more_message += Found * staircase leading down force_more_message += You are engulfed in seething chaos force_more_message += You are slowing down force_more_message += You are confused force_more_message += fire storm spell force_more_message += Your guardian golem overheats force_more_message += offers itself force_more_message += volcano erupts force_more_message += Uskayaw prepares the audience for your solo force_more_message += Something reaches out for you force_more_message += You become entangled in the net force_more_message += wield.* blowgun force_more_message += (the weather|forecast) force_more_message += you cannot.* because force_more_message += pie hits you force_more_message += goes berserk force_more_message += venomous gases force_more_message += vanishes in a puff force_more_message += weaves a glowing orb force_more_message += Your transformation is almost over force_more_message += The ironbrand convoker begins to recite a word of recall force_more_message += Something unseen opens the door force_more_message += Your unholy channel is weakening runrest_stop_message += Your unholy channel is weakening ## 유니크 몬스터가 출현했을 때 more를 강제로 띄워줌 force_more_message += (?!An|As|You|There)(?-i:[A-Z]{1}[a-z]+).*(come.*into.*view|open.*door|break.*door) ## 위험한 몬스터 출현 시 more를 강제로 띄워줌 # 패치로 위험한 몬스터가 추가되면 맞춰서 수정해줘야함 force_more_message += ((giant|floating|shining) eye|eye of draining).*into view force_more_message += (moth of wrath|ghost moth|torpor snail).*into view force_more_message += (guardian serpent|draconian shifter|convoker).*into view force_more_message += (flayed ghost|royal mummy|mummy priest|fiend|tzitzimitl).*into view force_more_message += (tormentor|curse toe|curse skull).*into view force_more_message += (hellion|hell sentinel|deep elf sorcerer).*into view force_more_message += (deep elf high priest|scorcher).*into view force_more_message += (ancient lich|orb of fire|executioner|juggernaut|shrike).*into view force_more_message += (wretched star|lurking horror).*into view force_more_message += (neqoxec|cacodemon|doom hound).*into view force_more_message += 27-headed.* comes? into view force_more_message += (radroach|entropy weaver|meliai).*into view force_more_message += (salamander tyrant|ironbound frostheart).*into view force_more_message += (walking crystal tome|walking divine tome|walking earthen tome|walking frostbound tome).*into view ## 몬스터가 위험한 몬스터로 변신 시 more를 강제로 띄워줌 # 패치로 위험한 몬스터가 추가되면 맞춰서 수정해줘야함 force_more_message += changes into.*((giant|floating|shining) eye|eye of draining) force_more_message += changes into.*(moth of wrath|ghost moth|torpor snail) force_more_message += changes into.*(guardian serpent|draconian shifter|convoker) force_more_message += changes into.*(flayed ghost|royal mummy|mummy priest|fiend|tzitzimitl) force_more_message += changes into.*(tormentor|curse toe|curse skull) force_more_message += changes into.*(hellion|hell sentinel|deep elf sorcerer) force_more_message += changes into.*(deep elf high priest|scorcher) force_more_message += changes into.*(ancient lich|orb of fire|executioner|juggernaut|shrike) force_more_message += changes into.*(wretched star|lurking horror) force_more_message += changes into.*(neqoxec|cacodemon|doom hound) force_more_message += changes into.*(radroach|entropy weaver|meliai) force_more_message += changes into.*(salamander tyrant|ironbound frostheart) force_more_message += changes into.*(walking crystal tome|walking divine tome|walking earthen tome|walking frostbound tome) ## 왜곡무기 장비한 몬스터, 춤추는 왜곡무기 출현 시 more를 띄워주고 화면이 번쩍이는 효과를 줌 force_more_message += It is wielding.*of distortion force_more_message += She is wielding.*of distortion force_more_message += He is wielding.*of distortion force_more_message += wielding.* distortion.* comes? into view flash_screen_message += It is wielding.*of distortion flash_screen_message += She is wielding.*of distortion flash_screen_message += He is wielding.*of distortion flash_screen_message += wielding.* distortion.* comes? into view flash_screen_message += distortion.* comes? into view ## Portals 관련 more 출력 force_more_message += ticking.*clock force_more_message += dying ticks force_more_message += distant snort force_more_message += coins.*counted force_more_message += tolling.*bell force_more_message += roar of battle force_more_message += creaking.*portcullis force_more_message += portcullis is probably force_more_message += wave of frost force_more_message += crackling.*melting force_more_message += hiss.*sand force_more_message += sound.*rushing water force_more_message += rusting.*drain force_more_message += drain falling apart force_more_message += heat about you force_more_message += falling.*rocks force_more_message += rumble.*avalanche of rocks force_more_message += crackle.*arcane power force_more_message += crackle.*magical portal force_more_message += distant wind force_more_message += whistling.*wind force_more_message += rapidly growing quiet ## 기타 유용 more 출력 # 몬스터 목격시 멈춤 # force_more_message += (?-i:[A-Z]).* comes? into view force_more_message += Found a gate leading to another region of Pandemonium force_more_message += You found a shaft runrest_stop_message += You found a shaft flash_screen_message += You are slowing down flash_screen_message += wielding.* distortion.* comes? into view flash_screen_message += Ashenzari invites you to partake flash_screen_message += Ru believes you are ready to make a new sacrifice flash_screen_message += Vehumet offers you knowledge ## 종족 중 상관 없는 디버프 무시하고 나머지는 걸리게 : if you.race() ~= "Gargoyle" and you.race() ~= "Ghoul" and you.race() ~= "Mummy" and you.race() ~= "Djinni" then force_more_message += dream sheep.* comes? into view :end : if you.race() ~= "Gargoyle" then force_more_message += plume of calc :end ## 원하는 레벨 스킬 도달 시 more 출력 force_more_message += Training target.*for.*reached! ## 잘 살펴봐야 하는 메시지인 경우 다른 색으로 표현 msc := message_colour channel.monster_damage = plain channel.god = plain channel.monster_spell = plain channel.monster_enchant = plain channel.friend_spell = darkgrey channel.friend_enchant = darkgrey channel.monster_warning = yellow channel.timed_portal = lightgreen ## Danger msc ^= red: you shout at msc ^= red: carrying a wand msc ^= red: distortion.* comes? into view msc ^= red: floating eye.* comes? into view msc ^= red: You are slowing down msc ^= red: you cannot.* because msc ^= red: (the weather|forecast) msc ^= red: you will pay msc ^= magenta: cacodemon.* comes? into view msc ^= magenta: neqoxec.* comes? into view msc ^= magenta: wretched star.* comes? into view msc ^= magenta: shining eye.* comes? into view : if you.race() == "Mummy" then msc ^= red: golden eye : end ## Kills (is there a universal way to colour this?) ## msc ^= brown: you kill msc ^= brown: you destroy msc ^= brown: dies msc ^= brown: you blow up msc ^= brown: is destroyed ## Misc msc ^= green: more experienced msc ^= green: pick up a manual msc ^= green: you have finished your manual msc ^= green: Training target msc ^= darkgrey: you are exhausted msc ^= yellow: is nearby msc ^= yellow: there are.* nearby msc ^= darkgrey: You now have ## mute useless messages ## msc ^= mute: begine reading ### CNC 서버 모듈 ############################################################################################################ ## 사운드 관련 sound_on = true sound_volume = 0.5 sound_pack += https://osp.nemelex.cards/build/latest.zip:["init.txt"] one_SDL_sound_channel = true sound_fade_time = 0.5 ## 기타 인터페이스 관련 redirect_chat = true show_gold_status = true disable_clear_chat = true lab_use_click_to_send_chat = true ### 그래픽 및 UI 관련 ################################################################################################################## ## 작은 스크린 용 폰트 설정 #tile_font_crt_family = Arial #tile_font_stat_family = Arial #tile_font_msg_family = Arial #tile_font_tip_family = Arial #tile_font_lbl_family = Arial #tile_font_stat_size = 11 #tile_font_msg_size = 11 #tile_font_crt_size = 11 #tile_font_tip_size = 11 #tile_font_lbl_size = 11 #msg_max_height = 5 ## 모바일 키보드 활성화 #tile_web_mobile_input_helper = true ## 폰트를 바꾸기 # Consolas, DejaVu Sans Mono, Arial, Open Sans tile_font_crt_family = Consolas tile_font_stat_family = Consolas tile_font_msg_family = Consolas tile_font_tip_family = Consolas tile_font_lbl_family = Consolas ## 타일 크기 tile_viewport_scale = 1.3 ## 타일을 몬스터 종족 타일로 변경 tile_show_player_species = false ## 투사체 애니매이션 view_delay = 200 ## 메뉴 순서 sort_menus = true:equipped,identified,basename,art,ego,glowing,qualname,curse,charged,slot ## EN0N's Mini-Map Color Scheme 미니맵 색 꾸미기 tile_upstairs_col = green tile_downstairs_col = red tile_branchstairs_col = #ffa500 tile_door_col = #c27149 tile_wall_col = #5a524c tile_explore_horizon_col = #aaaaaa tile_floor_col = #1e1b1a tile_item_col = #1e1b1a tile_feature_col = #d4be21 tile_plant_col = #4b6d39 tile_water_col = #0b5d79 tile_deep_water_col = #1212b3 tile_trap_col = #f447ff tile_transporter_col = #ff5656 tile_transporter_landing_col = #59ff89 tile_lava_col = #5f0a00 ### 자동줍기 관련 ############################################################################################################# ae := autopickup_exceptions ## Allows easily dropping multiple items drop_mode += multi ## Always show the full list of items when you pick up a stack pickup_mode += multi ## Allows followers to pick up ANYTHING (take care not to lose artefacts) default_friendly_pickup += all ## Set Alias for Autopickup Exceptions ae += useless_item, dangerous_item, evil_item ## Autopickup artefacts and God's gift ae += scrolls? of (amn|noise) ae += >ring of (protection from (mag|fire|cold)|mag|ste|ice|fire|pos|wil|wiz) ae += >ring of (dex|int|str) #ae ^= scroll.*(torment|vulnerability|imolation) ae ^= >potion.*berserk ae ^= >potion.*lignification ## 확인 된 지팡이는 줍지 않도록 함 ae += >staff of (fire|cold|air|earth|conj|alchem|death) ## 확인 된 아뮬렛은 줍지 않도록 함 ae += >amulet of (faith|regen|reflect|the acrobat|guardian|magic) ## 종족이 문어가 아닐 경우 확인 된 반지는 줍지 않도록 함 : if you.race() ~= "Octopode" then ae += >ring of protection from (magic|fire|cold) ae += >ring of (fire|ice|pois|positive|resist corr|see) ae += >ring of (mag|flight|wiz|int|str|dex|slay|prot|eva) : end ## 종족이 오우거, 트롤 일 경우 바위도 자동줍기 목록에 포함시킴 ## : if you.race() == "Ogre" or you.race() == "Troll" then ae += ## . , 에 계단 오르고, 내리고 지정 macros += M . > macros += M , < ## 마법 편의 macros += M z Z macros += M 1 za\{13} macros += M 2 zb\{13} ## for BaIE #ae +=