# TEAMCAPTAIN Nattefrost
##### Crawl Init file ###############################################
# 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://github.com/crawl/crawl/blob/master/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
# Alternative vi bindings for Neo users.
# include = neo_command_keys.txt
# Override the vi movement keys with a non-command.
# include = no_vi_command_keys.txt
# Turn the shift-vi keys into safe move, instead of run.
# include = safe_move_shift.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 = 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
confirm_butcher = never
auto_eat_chunks = true
tile_menu_icons = false
default_manual_training = true
autofight_stop = 70
runrest_stop_message += Your transformation is almost over
runrest_stop_message += Your icy armour starts to melt
# Skill menu at game start by rwbarton
{
local need_skills_opened = true
function ready()
if you.turns() == 0 and need_skills_opened then
need_skills_opened = false
crawl.sendkeys("m")
end
end
}
## Pickup aux armour you haven't found yet. Does not work
{
local function autopickup(it, name)
local class = it.class(true)
if class == "armour" then
local good_slots = {cloak="Cloak", helmet="Helmet",
gloves="Gloves", boots="Boots"}
st, _ = it.subtype()
if good_slots[st] ~= nil and
items.equipped_at(good_slots[st]) == nil then
return true
end
end
return false
end
}
# ------------------------------------------------
# AUTOMATIC
# ------------------------------------------------
# -bind macro-
# ===CrystalTap -for crystal of energy
# ===MagicTap -for Sif, ChannelStaff, WucadMoo
# ===Rebuff -for sequential rebuff
# -Crystal ball of energy SLOT-
: local CrystalBall_butt = "e"
# -Source of MP channeling-
# TapSource = 1-SifMuna
# TapSource = 2-Staff
# TapSource = 3-WucadMu
: local TapSource = 3
# -Count of rebuff spells-
: local buffs_count = 3
# -Track experience change-
: local exp_tracker = true
# -High damage taking warning-
: local dmg_track = true
# ------------------------------------------------
: local ChannelStaff_Slot = 1
: local CrystalBall_mp = 0
: local botstatus = "none"
: local rebuff_order = 0
: local tapturns = 0
: local BeforeTapWeap_Slot = -1
: local old_xl = 0
: local old_xl_progress = 0
: local dmg_old_hp = 0
# ------------------------------------------------
# IN GAME BINDS
# ------------------------------------------------
: function MagicTap_Key()
: if TapSource == 1 then
: send_orders('a')
: send_orders('d')
: end
: if TapSource == 2 then
: send_orders("V" .. items.index_to_letter(ChannelStaff_Slot))
: end
: if TapSource == 3 then
: send_orders("v")
: end
: end
# ------------------------------------------------
: function Rebuff_Key(i)
: if i == 1 then
: send_orders('z')
: send_orders('w')
: end
: if i == 2 then
: send_orders('z')
: send_orders('y')
: end
: if i == 3 then
: send_orders('z')
: send_orders('r')
: end
: end
# ------------------------------------------------
# EVERY TURN FUNCTION
# ------------------------------------------------
<
function ready()
if botstatus == "crystalball2" then
if you.mp() > (CrystalBall_mp + 1) then
say("Crystal ball of energy: +" .. (you.mp() - CrystalBall_mp) .. "MP.")
else
say("Fail.")
end
botstatus = "none"
end
if botstatus == "crystalball" then botstatus = "crystalball2" end
if botstatus == "magictap" then
MagicTap_step()
if TapSource == 1 or TapSource == 3 then crawl.delay(50) end
end
if botstatus == "rebuff" then
Rebuff_step()
crawl.delay(50)
end
if dmg_track == true then
DmgTrack()
end
if exp_tracker == true then
ExpChangeTrack()
end
end
>
# ------------------------------------------------
# MP CHANNEL
# ------------------------------------------------
: function MagicTap()
: local bot_mp, bot_mmp = you.mp()
: local FeW = -1
: if FindEnemy(false) == 0 then
: botstatus = "magictap"
: tapturns = 0
: if TapSource == 2 or TapSource == 3 then BeforeTapWeap_Slot = FindEquipedWeapon() end
: else
: if bot_mp == bot_mmp then
: say("Full of magic")
: else
: if TapSource == 2 then
: FeW = FindEquipedWeapon()
: if FeW > -1 and string.find(items.inslot(FeW).name(),"staff of channeling") then
: MagicTap_Key()
: else
: Weird_ChannelStaff(TapSource)
: end
: end
: if TapSource == 3 then
: FeW = FindEquipedWeapon()
: if FeW > -1 and string.find(items.inslot(FeW).name(),"Staff of Wucad Mu") then
: MagicTap_Key()
: else
: Weird_ChannelStaff(TapSource)
: end
: end
: if TapSource == 1 then
: MagicTap_Key()
: end
: end
: end
: end
# ------------------------------------------------
: function MagicTap_step()
: local bot_mp, bot_mmp = you.mp()
: if bot_mp < bot_mmp and FindEnemy(true) == 0 then
: tapturns = tapturns + 1
: if tapturns == 1 and (TapSource == 2 or TapSource == 3) then
: Weird_ChannelStaff(TapSource)
: else
: MagicTap_Key()
: end
: else
: botstatus = "none"
: if bot_mp == bot_mmp then
: if tapturns == 0 then
: say("Full of magic")
: else
: if BeforeTapWeap_Slot > -1 then
: send_orders("w" .. items.index_to_letter(BeforeTapWeap_Slot))
: BeforeTapWeap_Slot = -1
: tapturns = tapturns + 1
: botstatus = "magictap"
: else
: say("Full of magic, for " .. tapturns .. " turns")
: tapturns = 0
: end
: end
: end
: end
: end
# ------------------------------------------------
: function Weird_ChannelStaff(ts)
: if Correct_ChannelStaff(ts) then
: send_orders("w" .. items.index_to_letter(ChannelStaff_Slot))
: else
: if ts == 2 then
: say("Have no staff of channeling!")
: end
: if ts == 3 then
: say("Have no Staff of Wucad Mu!")
: end
: botstatus = "none"
: end
: end
# ------------------------------------------------
: function Correct_ChannelStaff(ts)
: local i
: local sFind = false
: if ts == 2 then SourceName = "staff of channeling" end
: if ts == 3 then SourceName = "Staff of Wucad Mu" end
: if items.inslot(ChannelStaff_Slot) and string.find(items.inslot(ChannelStaff_Slot).name(), SourceName) then
: sFind = true
: else
: for i = 0,51 do
: it = items.inslot(i)
: if it then
: if string.find(it.name(), SourceName) then
: sFind = true
: ChannelStaff_Slot = i
: end
: end
: end
: end
: return sFind
: end
# ------------------------------------------------
: function CrystalTap()
: local bot_mp, bot_mmp = you.mp()
: if bot_mp == bot_mmp then
: say("Full of magic")
: else
: if items.inslot(items.letter_to_index(CrystalBall_butt)) and string.find(items.inslot(items.letter_to_index(CrystalBall_butt)).name(),"crystal ball of energy") then
: if bot_mp < (bot_mmp*0.26) then
: crawl.formatted_mpr("Use crystall ball of energy at " .. bot_mp .. " MP? (y/n) need " .. math.ceil(bot_mmp*0.26) .." MP." )
: crawl.flush_prev_message()
: local res = crawl.getch()
: if string.lower(string.char(res)) == "y" then
: send_orders("V" .. CrystalBall_butt)
: botstatus = "crystalball"
: CrystalBall_mp = bot_mp
: else
: say("Okay, then.")
: end
: else
: send_orders("V" .. CrystalBall_butt)
: botstatus = "crystalball"
: CrystalBall_mp = bot_mp
: end
: else
: say("Have no crystal ball of energy at [" .. CrystalBall_butt .. "] slot!")
: end
: end
: end
# ------------------------------------------------
# DAMAGE TRACK
# ------------------------------------------------
: function DmgTrack()
: local bot_hp, bot_mhp = you.hp()
: local dmg_inturn = 0
: local huge_int = 0
: local percent_hp = 0
: local percent_old_hp = 0
: local percent_hp_txt = "--%"
: if dmg_old_hp > 0 then
: if bot_hp < dmg_old_hp then
: dmg_inturn = dmg_old_hp - bot_hp
: percent_old_hp = math.ceil((dmg_old_hp*100)/bot_mhp)
: percent_hp = math.ceil((bot_hp*100)/bot_mhp)
: percent_hp_txt = percent_hp .. "%"
: if percent_hp < 30 then
: percent_hp_txt = "" .. percent_hp_txt .. ""
: elseif percent_hp < 55 then
: percent_hp_txt = "" .. percent_hp_txt .. ""
: elseif percent_hp < 75 then
: percent_hp_txt = "" .. percent_hp_txt .. ""
: end
: percent_hp_txt = percent_hp_txt .. "(" .. bot_hp .. "hp)"
: if dmg_inturn > (bot_hp*0.25) then
: say("Huge Dmg: -" .. (percent_old_hp-percent_hp) .. "%(-" .. dmg_inturn .. "hp)" .. " hp: " .. percent_hp_txt)
: dmg_old_hp = bot_hp
: crawl.flush_prev_message()
: crawl.more()
: crawl.more_autoclear(true)
: else
: if dmg_inturn > (bot_hp*0.15) then
: say("Dmg: -" .. (percent_old_hp-percent_hp) .. "%(-" .. dmg_inturn .. "hp)" .. " hp: " .. percent_hp_txt)
: else
: say("Dmg: -" .. (percent_old_hp-percent_hp) .. "%(-" .. dmg_inturn .. "hp)" .. " hp: " .. percent_hp_txt)
: end
: end
: crawl.flush_prev_message()
: end
: end
: dmg_old_hp = bot_hp
: end
# ------------------------------------------------
# EXP TRACK
# ------------------------------------------------
: function ExpChangeTrack()
: local cur_xl = you.xl()
: local cur_xl_progress = you.xl_progress()
: local cur_change = 0
: local add_percent = 0
: local add_txt=""
: if old_xl > 0 and cur_xl < 27 then
: if not (old_xl == cur_xl and old_xl_progress == cur_xl_progress) then
: add_percent = math.abs((cur_xl*100+cur_xl_progress) - (old_xl*100+old_xl_progress))
: if add_percent < 4 then
: add_txt="~"
: end
: cur_change = GetExpirience(cur_xl,cur_xl_progress) - GetExpirience(old_xl,old_xl_progress)
: if cur_change > 0 then
: say("Exp: " .. add_txt .. cur_change .. "(" .. add_percent .. "%)")
: elseif cur_change < 0 then
: say("Drained exp: " .. add_txt .. cur_change .. "(" .. add_percent .. "%)")
: end
: crawl.flush_prev_message()
: end
: end
: old_xl = cur_xl
: old_xl_progress = cur_xl_progress
: end
# ------------------------------------------------
: function GetExpirience(level,l_progress)
: local exp_points = 0
: local ExpTable = {
: [1] = '0',
: [2] = '10',
: [3] = '30',
: [4] = '70',
: [5] = '140',
: [6] = '270',
: [7] = '520',
: [8] = '1010',
: [9] = '1980',
: [10] = '3910',
: [11] = '7760',
: [12] = '15450',
: [13] = '29000',
: [14] = '48500',
: [15] = '74000',
: [16] = '105500',
: [17] = '143000',
: [18] = '186500',
: [19] = '236000',
: [20] = '291500',
: [21] = '353000',
: [22] = '420500',
: [23] = '494000',
: [24] = '573500',
: [25] = '659000',
: [26] = '750500',
: [27] = '848000'}
: exp_points = math.ceil((ExpTable[level+1] - ExpTable[level]) * l_progress / 100)
: exp_points = ExpTable[level] + exp_points
: return exp_points
: end
# ------------------------------------------------
# REBUFF
# ------------------------------------------------
: function Rebuff()
: rebuff_order = 0
: if botstatus == "none" then
: botstatus = "rebuff"
: end
: end
# ------------------------------------------------
: function Rebuff_step()
: if FindEnemy(true) == 0 then
: rebuff_order = rebuff_order + 1
: if rebuff_order > buffs_count then
: botstatus = "none"
: rebuff_order = 0
: say("Rebuff")
: else
: Rebuff_Key(rebuff_order)
: end
: else
: botstatus = "none"
: rebuff_order = 0
: end
: end
# ------------------------------------------------
# UTILS
# ------------------------------------------------
: function FindEnemy(txt)
: local x, y
: local r = 8
: local i = 0
: local mname = ""
: for x = -r,r do
: for y = -r,r do
: m = monster.get_monster_at(x, y)
: if m and not m:is_safe() then
: i = i + 1
: if i == 1 then
: mname = m:desc()
: else
: mname = mname .. ", " .. m:desc()
: end
: end
: end
: end
: if i > 0 then
: if txt == true then
: say("Enemy in LOS: " .. mname .. "")
: end
: end
: return i
: end
# ------------------------------------------------
: function say(x)
: crawl.mpr(x)
: end
# ------------------------------------------------
: function send_orders(command)
: crawl.flush_input()
: crawl.sendkeys(command)
: crawl.flush_input()
: end
# ------------------------------------------------
: function FindEquipedWeapon()
: local i
: local it
: local wfind = -1
: for i = 0,51 do
: it = items.inslot(i)
: if it and it.equipped and it.equip_type == 0 then
: wfind = i
: end
: end
: return wfind
: end
# ------------------------------------------------
: function stest()
: mtest()
: end
# ------------------------------------------------
: function mtest()
: local x, y
: local r = 8
: local i = 0
: local xxx
: for x = -r,r do
: for y = -r,r do
: m = monster.get_monster_at(x, y)
: if m then
: say("desc-" .. m:desc())
: say("Threat-" .. m:threat())
: say("attitude-" .. m:attitude())
: say("mname-" .. m:mname())
: say("type-" .. m:type())
: say("base_type-" .. m:base_type())
: say("number-" .. m:number())
: say("colour-" .. m:colour())
: say("damage_level-" .. m:damage_level())
: say("damage_desc-" .. m:damage_desc())
: crawl.flush_prev_message()
: end
: end
: end
: end
# ------------------------------------------------
#!!!##################### Invisible ###########
force_more_message = It hits you
force_more_message = It misses you
force_more_message = It closely misses you
force_more_message = It completely misses you
force_more_message = You block its attack