Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- To use this create a macro with the following function call in game
- -- ===HDAtravel
- -- This file can be included in your rc file with the following line:
- -- include += HDAtravel.rc
- # This still has plenty of bugs, submit them at:
- # https://github.com/HilariousDeathArtist/DCSSConfigFile
- # or find me on crawl.s-z.org
- confirm_butcher = never
- easy_eat_chunks = true
- auto_eat_chunks = true
- auto_drop_chunks = yes
- easy_eat_contaminated = true
- travel_delay = -1
- autoinscribe += bread ration:@e1
- autoinscribe += meat ration:@e2
- autoinscribe += chunk:@w0
- autoinscribe += staff of energy:@w1
- ##################
- # HDAtravel #
- ##################
- -- Rests up to at least 75% hp (or missing at least 30hp) and 50% mp (or missing at least 20mp)
- -- Eats chunks automatically, handled by auto_eat_chunks interface option
- -- Travels to the nearest corpse if we have no chunks and are at Very Hungry or Hungry or using Gourmand and at Full
- -- Automatically chops valid corpses if we are standing on them and we have no chunks
- -- Will stop autotravel at Near Starving
- -- Channels MP if you have staff of energy or worship Sif when you have extra chunks
- -- Casts regen out of combat if you have spare chunks and are missing hp
- -- TODO: better detection of non-edible corpses before standing on them
- -- TODO: Fix up for Vampire, Ghoul, and possibly Spriggan/Mummy
- -- NOTE: If you don't have rP you will still chop poisonous corpses, but not pick up their chunks
- : function HDAtravel()
- : local mp, max_mp = you.mp()
- : local hp, max_hp = you.hp()
- : local first_monster = next(getMonsterList())
- : local already_checked = (no_results() or dont_know_how_to_get_there())
- : local you_are_barbed = (have_barbs() and not removed_barbs())
- : local is_safe = (first_monster == nil)
- : local missing_mp = (mp < max_mp)
- : local missing_hp = (hp < max_hp)
- : local need_to_recover = should_rest(hp, mp, max_hp, max_mp)
- : local have_no_chunks = have_no_chunks()
- : local you_are_sif = string.find(you.god(), "Sif")
- : local you_are_yred = string.find(you.god(), "Yred")
- : local you_are_zin = string.find(you.god(), "Zin")
- : local you_are_good = string.find(you.god(), "Shining") or string.find(you.god(), "Elyvilon") or you_are_zin
- : local sacrifice_god = you_worship_sacrifice_god()
- : local you_are_mummy = string.find(you.race(), "Mummy")
- : local you_are_vampire = string.find(you.race(), "Vampire")
- : local you_are_bloodless = you.hunger_name() == "bloodless"
- : local you_are_ghoul = string.find(you.race(), "Ghoul")
- : local you_are_bloodless = you.hunger_name() == "bloodless"
- : local you_do_not_eat = string.find(you.race(), "Spriggan") or you_are_mummy
- : local lichform = string.find(you.transform(), "lich")
- : local bladehands = string.find(you.transform(), "blade")
- : local dragonform = string.find(you.transform(), "dragon")
- : local melded_weapon = (bladehands or dragonform)
- : local you_are_regen = you.regenerating()
- : local you_know_sublimation = known_spells["Sublimation of Blood"] and (spells.fail("Sublimation of Blood") < 20) and (mp>3)
- : local you_know_animate_skeleton = known_spells["Animate Skeleton"] and (spells.fail("Animate Skeleton") < 20) and (mp>1)
- : local you_know_animate_dead = known_spells["Animate Dead"] and (spells.fail("Animate Dead") < 20) and (mp>4)
- : local chunks_are_equipped = is_weapon("chunk")
- : local distort_weapon = is_weapon("distort")
- : local vamp_weapon = is_weapon("vamp") and not chunks_are_equipped
- : local have_a_weapon = weapon_in_inventory()
- : local gourmand_and_hungry = you_are_gourmand() and not (you_are_very_full() or you_are_engorged() or you_are_ghoul)
- : local ghoul_missing_hp = you_are_ghoul and ((hp < (max_hp - 5)) or you.rot() > 0)
- : local want_to_eat = (you_are_hungry() or gourmand_and_hungry or ghoul_missing_hp) and not you_do_not_eat
- : local have_spare_chunks = not have_no_chunks and not you_are_hungry()
- : local you_have_staff_of_energy = is_in_inventory("staff of energy")
- : local have_potion_of_blood = is_in_inventory("potion of blood") or is_in_inventory("potions of blood")
- : local staff_of_energy_is_equipped = is_weapon("staff of energy")
- : local staff_of_power_is_equipped = is_weapon("staff of power")
- : local staff_of_energy_letter = find_item_letter("staff of energy")
- : local chunks_letter = find_item_letter("chunk")
- : local you_are_hungerless = you_are_mummy or lichform
- : local no_food_issues = (you_are_hungerless or have_spare_chunks)
- : local should_channel_mp = ((max_mp - mp) > 5) and no_food_issues
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement