Dartellum

mechlore.lic

Jun 21st, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. custom_require.call(%w(common common-travel common-items))
  2.  
  3. class Mechlore
  4.  
  5. include DRC
  6. include DRCI
  7. include DRCT
  8.  
  9. def initialize
  10. @settings = get_settings
  11. walk_to(@settings.saferoom)
  12. count = 0
  13. @equipment_manager.empty_hands
  14. fput "remove #{@settings.hand_armor}"
  15. fput "stow #{@settings.hand_armor}"
  16. pause 1
  17. release_invisibility
  18. while DRSkill.getxp('Mechanical Lore') < 30
  19. if @settings.braid_item
  20. braid_to_fail(@settings.braid_item)
  21. else
  22. braid_to_fail(DRSkill.getrank('Outdoorsmanship') < 110 ? 'grass' : 'vine')
  23. end
  24. end
  25. @equipment_manager.empty_hands
  26. fput "get my #{@settings.hand_armor}"
  27. fput "wear my #{@settings.hand_armor}"
  28. fput ("dump junk")
  29. end
  30.  
  31. def braid_to_fail(item)
  32. return if left_hand || right_hand
  33. return unless forage?(item)
  34. loop do
  35. waitrt?
  36.  
  37. case bput("braid my #{item}", 'You need to have more', 'Roundtime', 'You need both hands to do that', 'You can\'t braid the .* into your braided', 'is already as long as you can make it', 'You are in no condition')
  38. when 'Roundtime'
  39. rt = reget(10, 'Roundtime').last.scan(/\d+/).first.to_i
  40. break if rt >= 8 || DRSkill.getxp('Mechanical Lore') >= 30
  41. when 'is already as long as you can make it'
  42. waitrt?
  43. break
  44. when 'You need both hands to do that', /into your braided/
  45. waitrt?
  46. empty_trash
  47. return
  48. when 'You are in no condition'
  49. wait_for_script_to_complete('safe-room')
  50. walk_to(@settings.saferoom)
  51. @equipment_manager.empty_hands
  52. return
  53. else
  54. break unless forage?(item)
  55. end
  56. end
  57. pause 1
  58. waitrt?
  59. bput("pull my #{item}", 'You tug and pull')
  60. pause 1
  61. waitrt?
  62. empty_trash
  63. end
  64.  
  65. def empty_trash
  66. trash_nouns = get_data('items').trash_nouns
  67.  
  68. if trash_nouns.any? { |noun| /\b#{noun}/i =~ GameObj.right_hand.noun } && !@equipment_manager.is_listed_item?(right_hand)
  69. dispose_trash(right_hand)
  70. end
  71.  
  72. if trash_nouns.any? { |noun| /\b#{noun}/i =~ GameObj.left_hand.noun } && !@equipment_manager.is_listed_item?(left_hand)
  73. dispose_trash(left_hand)
  74. end
  75. fput('dump junk')
  76. end
  77.  
  78.  
  79. end
  80.  
  81. before_dying do
  82. fput('drop my grass')
  83. end
  84.  
  85. Mechlore.new
Add Comment
Please, Sign In to add comment