# This rcfile is elliptic's DCSS bot "qw", the first (and thus far only) bot # to win DCSS with no human assistance. A substantial amount of code here was # contributed by elliott or borrowed from N78291's bot "xw", and many others # have contributed as well. # For brief instructions and the most up-to-date version of qw, see # https://github.com/elliptic/qw. ## qw's settings: # # Set this to true when playing online. : DELAYED = true # Delay per action in milliseconds. # Set this to at least 100 or so when playing online. : DELAY_TIME = 125 # whether to start playing immediately when a new game is started # unfortunately this doesn't work if the game starts with a -more- : AUTO_START = true # experimental: do second lair rune branch before depths : EARLY_SECOND_RUNE = true # experimental: wait to do Orc until after D:15 : LATE_ORC = true # lair rune preferences, current options are: # * random - no preference, chooses randomly # * nowater - does Snake/Spider first # * smart - currently prefers Spider > Snake/Swamp > Shoals # * dsmart - Swamp/Spider > Snake > Shoals (DsBe data) : RUNE_PREFERENCE = "random" # plan for post-V:5, should end with zot # maximal example: "tso,tomb,hells,pan,slime,abyss,zig,zot" : ENDGAME_PLAN = "zot" # depth to attempt to dive in ziggurats : ZIG_DIVE = 27 # burn books with Trog, may theoretically cause navigation problems : BURN_BOOKS = true # enable certain somewhat spammy notes : SPAM = false # tab just takes a single action (for testing) : SINGLE_STEP = false # panic (stop) at full inventory : FULL_INVENTORY_PANIC = true # quit after this number of turns while stuck : QUIT_TURNS = 1000 # use a shield at all cost : SHIELD_CRAZY = true # acceptable gods (join whichever one we find first) # gods who have been at least partially implemented: BCHLMOQRTUXY1 # gods who are actually pretty decent on qw: CMORT : GOD_LIST = { "Trog", } # use faded altar, abandoning if we don't get one of the gods in GOD_LIST : FADED_ALTAR = false # cycle through combos using c_persist.options : COMBO_CYCLE = false # combos to cycle through - uses the same syntax as the regular combo option # with an optional "^" suffix to overwrite the GOD_LIST # list above. Here are some sample choices: : COMBO_CYCLE_LIST = "DDFi.waraxe^M, DDBe.handaxe^T, GrBe.handaxe^T, GrFi.waraxe^O, MiFi.waraxe^O" # Choose randomly between these combos. This will not apply if the COMBO_CYCLE # option was on in your _previous_ game. combo = GrBe.handaxe # For random berserkers, use these combos: #combo = CeBe.handaxe, DDBe.handaxe, DEBe.handaxe, DrBe.handaxe, DsBe.handaxe #combo += FeBe.claws, FoBe.handaxe, GrBe.handaxe, GhBe.claws, HaBe.falchion #combo += HEBe.falchion, HOBe.handaxe, HuBe.handaxe, KoBe.mace, MfBe.spear #combo += MiBe.handaxe, MuBe.handaxe, NaBe.handaxe, OgBe.mace, OpBe.handaxe #combo += SpBe.shortsword, TeBe.handaxe, TrBe.claws, VSBe.handaxe, VpBe.handaxe # For a totally random combo (with chosen weapon type), hyperqwcombo.rc can # be created using hyperqwcombogen.sh and used: #combo = #include += hyperqwcombo.rc ## The accomplishments of qw: # online wins: CeFi^O DDBe DDFi^C DDFi^O DDFi^Q DDFi^Y DDGl^M DDGl^R DrFi^O # DsBe FoFi^O GhFi^O GrBe HOBe HuBe MfBe MiBe MiFi^C MiFi^O # MiFi^Q MiFi^R MiFi^Y MuFi^O NaBe OgFi^O TeBe TrBe VSBe # offline wins: HaFi^O HEBe HEFi^O VpBe VpFi^O # (offline) runes: DgFi FeFi^O KoBe KoFi^O OpBe OpFi^O ##################################### # enum values :/ : ENUM_MONS_PANDEMONIUM_LORD = 344 : ATT_FRIENDLY = 4 : ATT_NEUTRAL = 1 : ATT_HOSTILE = 0 : LOS = 7 : if you.race() == "Barachi" then : LOS = 8 : end ##################################### # miscellaneous simple options name = qw restart_after_game = false note_chat_messages = true bold_brightens_foreground = true equip_bar = true ability_menu = false view_delay = 0 use_animations = darken_beyond_range = false clear_messages = true travel_delay = -1 explore_delay = -1 rest_delay = -1 travel_key_stop = false default_manual_training = true autopickup_no_burden = false auto_exclude = hp_warning = 0 show_more = false show_newturn_mark = false list_rotten = false force_more_message = show_travel_trail = false skill_focus = false autoinscribe += slay:mikee autoinscribe += (inedible|mutagenic|forbidden).*(chunk|corpse):noeat flush.failure = false char_set = ascii cset = cloud:xa4 cset = item_orb:0 use_fake_player_cursor = true equip_unequip = true dump_order = header,hiscore,stats,misc,mutations,skills,spells,inventory dump_order += overview dump_order += messages,screenshot,monlist,kills,notes,vaults,skill_gains,action_counts dump_order += xp_by_level ood_interesting = 6 note_hp_percent = 25 note_skill_levels = 1,3,6,9,12,15,18,21,24,27 note_all_spells = true fire_order = launcher, rock, javelin, tomahawk auto_eat_chunks = false read_persist_options = true message_colour ^= mute:Unknown command #################################### # not sure exactly how important or correct these settings are explore_stop = explore_stop += items,branches,portals,stairs,altars explore_stop += greedy_visited_item_stack,greedy_pickup_smart stop := runrest_stop_message ignore := runrest_ignore_message stop = ignore = ignore += .* runrest_ignore_poison = 3:15 runrest_ignore_monster += butterfly:1 runrest_ignore_monster += orb of destruction:1 #################################### # These keys are useful to answer prompts and aren't critical for manual play bindkey = [Y] CMD_NO_CMD_DEFAULT bindkey = [N] CMD_NO_CMD_DEFAULT bindkey = [B] CMD_NO_CMD_DEFAULT bindkey = [C] CMD_NO_CMD_DEFAULT bindkey = [.] CMD_NO_CMD_DEFAULT bindkey = [^D] CMD_LUA_CONSOLE #################################### # Don't get interrupted! : chk_interrupt_activity["blurry vision"] = function (iname, cause, extra) : return nil : end #################################### # autopickup is all handled via lua autopickup = autopickup_exceptions = ################################################################ # now the lua, beginning with global variables { -- some global variables: local initialized = false local time_passed local update_coroutine local do_dummy_action local dump_count = you.turns() + 100 - (you.turns() % 100) local skill_count = you.turns() - (you.turns() % 5) local danger local immediate_danger local cloudy local where local where_shafted_from = nil local expect_new_location local expect_portal local automatic = false local ignore_list = { } local failed_move = { } local invisi_count = 0 local next_delay = 100 local dd_hw_meter = 0 local sigmund_dx = 0 local sigmund_dy = 0 local invisi_sigmund = false local sgd_timer = -200 local stuck_turns = 0 local stepped_on_lair = false local stepped_on_tomb = false local lair_step_mode = false -- are these still necessary? local did_move = false local move_count = 0 local did_move_towards_monster = 0 local target_memory_x local target_memory_y local last_wait = 0 local wait_count = 0 local old_turn_count = you.turns()-1 local hiding_turn_count = -100 local travel_destination = nil local game_status = "normal" local have_message = false local read_message = true local monster_array local enemy_list local upgrade_phase = false local tactical_step local tactical_reason local is_waiting local did_first_turn = false local stairdance_count = {} local clear_exclusion_count = {} local v5_entry_turn local last_swamp_fail_count = -1 local swamp_rune_reachable = false local offlevel_travel = true local last_min_delay_skill = 18 local only_linear_resists = false local no_spells = false local level_map local stair_dists local waypoint_parity local cur_where local prev_where local did_waypoint = false local good_stair_list local target_stair local last_flee_turn = -100 local ABYSSAL_RUNE = false local SLIMY_RUNE = false local PAN_RUNE = false local HELL_RUNE = false local GOLDEN_RUNE = false local TSO_CONVERSION = false local LUGONU_CONVERSION = false local WILL_ZIG = false local MIGHT_BE_GOOD = false local endgame_plan_list = {} local which_endgame_plan = 1 local dislike_pan_level = false local prev_hatch_dist = 1000 local prev_hatch_x local prev_hatch_y -- options to set while qw is running -- maybe should add more mutes for watchability function set_options() crawl.setopt("confirm_butcher = always") crawl.setopt("pickup_mode = multi") crawl.setopt("message_colour += mute:Search for what") crawl.setopt("message_colour += mute:Can't find anything") crawl.setopt("message_colour += mute:Drop what") crawl.setopt("message_colour += mute:Okay, then") crawl.setopt("message_colour += mute:Use which ability") crawl.setopt("message_colour += mute:Read which item") crawl.setopt("message_colour += mute:Drink which item") crawl.setopt("message_colour += mute:not good enough") crawl.setopt("message_colour += mute:Attack whom") crawl.setopt("message_colour += mute:move target cursor") crawl.setopt("message_colour += mute:Aim:") crawl.setopt("message_colour += mute:You reach to attack") crawl.enable_more(false) end function unset_options() crawl.setopt("always_confirm_butcher = auto") crawl.setopt("pickup_mode = auto") crawl.setopt("message_colour -= mute:Search for what") crawl.setopt("message_colour -= mute:Can't find anything") crawl.setopt("message_colour -= mute:Drop what") crawl.setopt("message_colour -= mute:Okay, then") crawl.setopt("message_colour -= mute:Use which ability") crawl.setopt("message_colour -= mute:Read which item") crawl.setopt("message_colour -= mute:Drink which item") crawl.setopt("message_colour -= mute:not good enough") crawl.setopt("message_colour -= mute:Attack whom") crawl.setopt("message_colour -= mute:move target cursor") crawl.setopt("message_colour -= mute:Aim:") crawl.setopt("message_colour -= mute:You reach to attack") crawl.enable_more(true) end ------------------------------------- -- equipment valuation and autopickup -- We assign a numerical value to all armour/weapon/jewellery, which -- is used both for autopickup (so it has to work for unIDed items) and -- for equipment selection. A negative value means we prefer an empty slot. -- The valuation functions either return a pair of numbers - minimum -- minimum and maximum potential value - or the current value. Here -- value should be viewed as utility relative to not wearing anything in -- that slot. For the current value calculation, we can specify an equipped -- item and try to simulate not wearing it (for resist values). -- We pick up an item if its max value is greater than our currently equipped -- item's min value. We swap to an item if it has a greater cur value. -- if cur, return the current value instead of minmax -- if it2, pretend we aren't equipping it2 -- if sit = "hydra", assume we are fighting a hydra at lowish XL -- = "extended", assume we are in (or about to enter) Pan -- if TSO_CONVERSION, we need this weapon to be TSO-friendly -- = "bless", assume we want to bless the weapon with TSO eventually ---------------------------------------- -- skill selection local skill_list = {"Fighting","Short Blades","Long Blades","Axes","Maces & Flails", "Polearms","Staves","Unarmed Combat","Bows","Crossbows", "Throwing","Slings","Armour","Dodging","Shields", "Invocations","Evocations","Stealth","Spellcasting", "Conjurations","Hexes","Charms","Summonings","Necromancy", "Translocations","Transmutations","Fire Magic","Ice Magic", "Air Magic","Earth Magic","Poison Magic"} function ready() -- magic("V" .. letter(c) .. ".") make a comand, V is the key, letter(c) is the item sellected, potion, scroll etc -- you.have_rune(name) -- view.feature_at(dx,dy) -- view.is_safe_square(x,y) -- magic("s") -- view.clout_at(x,y) -- my edit --Verified --crawl.mpr(crawl.dump_char()) --crawl.mpr(you.hp()) --crawl.mpr(you.turns()) --crawl.mpr(you.where()) --crawl.mpr(you.race()) --crawl.mpr(you.god()) --crawl.mpr(you.strength()) --crawl.mpr(you.dexterity()) --crawl.mpr(you.intelligence()) --Verified --crawl.mpr(you.confused()) --crawl.mpr(you.transform()) --crawl.mpr(you.poison_survival()) --crawl.mpr(you.poisoned()) --crawl.mpr(you.slowed()) --crawl.mpr(you.petrified()) --crawl.mpr(you.hunger_name()) --crawl.mpr(you.mesmerised()) --crawl.mpr(you.berzerk()) --crawl.mpr("skillz") --crawl.take_note("note") --local recent_messages = crawl.messages(20) --if recent_messages:find("Your surroundings suddenly seem different") then -- crawl.mpr("printing stuff") --crawl.formatted_mpr("Set counter to what? ", "prompt") --local res = crawl.c_input_line() --crawl.mpr(res) --end my edit end }