Advertisement
M-Q711599

unlimited

Jan 15th, 2020
917
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.54 KB | None | 0 0
  1.  To use this create a macro with the following function call in game
  2. -- ===HDAtravel
  3. -- This file can be included in your rc file with the following line:
  4. -- include += HDAtravel.rc
  5.  
  6. # This still has plenty of bugs, submit them at:
  7. # https://github.com/HilariousDeathArtist/DCSSConfigFile
  8. # or find me on crawl.s-z.org
  9.  
  10. confirm_butcher = never
  11. easy_eat_chunks = true
  12. auto_eat_chunks = true
  13. auto_drop_chunks = yes
  14. easy_eat_contaminated = true
  15. travel_delay = -1
  16.  
  17. autoinscribe += bread ration:@e1
  18. autoinscribe += meat ration:@e2
  19. autoinscribe += chunk:@w0
  20. autoinscribe += staff of energy:@w1
  21.  
  22. ##################
  23. #    HDAtravel   #
  24. ##################
  25.  
  26. -- Rests up to at least 75% hp (or missing at least 30hp) and 50% mp (or missing at least 20mp)
  27. -- Eats chunks automatically, handled by auto_eat_chunks interface option
  28. -- Travels to the nearest corpse if we have no chunks and are at Very Hungry or Hungry or using Gourmand and at Full
  29. -- Automatically chops valid corpses if we are standing on them and we have no chunks
  30. -- Will stop autotravel at Near Starving
  31. -- Channels MP if you have staff of energy or worship Sif when you have extra chunks
  32. -- Casts regen out of combat if you have spare chunks and are missing hp
  33. -- TODO: better detection of non-edible corpses before standing on them
  34. -- TODO: Fix up for Vampire, Ghoul, and possibly Spriggan/Mummy
  35. -- NOTE: If you don't have rP you will still chop poisonous corpses, but not pick up their chunks
  36.  
  37. : function HDAtravel()
  38. :   local mp, max_mp = you.mp()
  39. :   local hp, max_hp = you.hp()
  40. :   local first_monster = next(getMonsterList())
  41. :   local already_checked = (no_results() or dont_know_how_to_get_there())
  42. :   local you_are_barbed = (have_barbs() and not removed_barbs())
  43. :   local is_safe = (first_monster == nil)
  44. :   local missing_mp = (mp < max_mp)
  45. :   local missing_hp = (hp < max_hp)
  46. :   local need_to_recover = should_rest(hp, mp, max_hp, max_mp)
  47. :   local have_no_chunks = have_no_chunks()
  48. :   local you_are_sif = string.find(you.god(), "Sif")
  49. :   local you_are_yred = string.find(you.god(), "Yred")
  50. :   local you_are_zin = string.find(you.god(), "Zin")
  51. :   local you_are_good = string.find(you.god(), "Shining") or string.find(you.god(), "Elyvilon") or you_are_zin
  52. :   local sacrifice_god = you_worship_sacrifice_god()
  53. :   local you_are_mummy = string.find(you.race(), "Mummy")
  54. :   local you_are_vampire = string.find(you.race(), "Vampire")
  55. :   local you_are_bloodless = you.hunger_name() == "bloodless"
  56. :   local you_are_ghoul = string.find(you.race(), "Ghoul")
  57. :     local you_are_bloodless = you.hunger_name() == "bloodless"
  58. :   local you_do_not_eat = string.find(you.race(), "Spriggan") or you_are_mummy
  59. :   local lichform = string.find(you.transform(), "lich")
  60. :   local bladehands = string.find(you.transform(), "blade")
  61. :   local dragonform = string.find(you.transform(), "dragon")
  62. :   local melded_weapon = (bladehands or dragonform)
  63. :   local you_are_regen = you.regenerating()
  64. :   local you_know_sublimation = known_spells["Sublimation of Blood"] and (spells.fail("Sublimation of Blood") < 20) and (mp>3)
  65. :   local you_know_animate_skeleton = known_spells["Animate Skeleton"] and (spells.fail("Animate Skeleton") < 20) and (mp>1)
  66. :   local you_know_animate_dead = known_spells["Animate Dead"] and (spells.fail("Animate Dead") < 20) and (mp>4)
  67. :   local chunks_are_equipped = is_weapon("chunk")
  68. :   local distort_weapon = is_weapon("distort")
  69. :   local vamp_weapon = is_weapon("vamp") and not chunks_are_equipped
  70. :   local have_a_weapon = weapon_in_inventory()
  71. :   local gourmand_and_hungry = you_are_gourmand() and not (you_are_very_full() or you_are_engorged() or you_are_ghoul)
  72. :   local ghoul_missing_hp = you_are_ghoul and ((hp < (max_hp - 5)) or you.rot() > 0)
  73. :   local want_to_eat = (you_are_hungry() or gourmand_and_hungry or ghoul_missing_hp) and not you_do_not_eat
  74. :   local have_spare_chunks = not have_no_chunks and not you_are_hungry()
  75. :   local you_have_staff_of_energy = is_in_inventory("staff of energy")
  76. :   local have_potion_of_blood = is_in_inventory("potion of blood") or is_in_inventory("potions of blood")
  77. :   local staff_of_energy_is_equipped = is_weapon("staff of energy")
  78. :   local staff_of_power_is_equipped = is_weapon("staff of power")
  79. :   local staff_of_energy_letter = find_item_letter("staff of energy")
  80. :   local chunks_letter = find_item_letter("chunk")
  81. :   local you_are_hungerless = you_are_mummy or lichform
  82. :   local no_food_issues = (you_are_hungerless or have_spare_chunks)
  83. :   local should_channel_mp = ((max_mp - mp) > 5) and no_food_issues
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement