Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- custom_require.call(%w(common common-travel common-items))
- class Mechlore
- include DRC
- include DRCI
- include DRCT
- def initialize
- @settings = get_settings
- walk_to(@settings.saferoom)
- count = 0
- @equipment_manager.empty_hands
- fput "remove #{@settings.hand_armor}"
- fput "stow #{@settings.hand_armor}"
- pause 1
- release_invisibility
- while DRSkill.getxp('Mechanical Lore') < 30
- if @settings.braid_item
- braid_to_fail(@settings.braid_item)
- else
- braid_to_fail(DRSkill.getrank('Outdoorsmanship') < 110 ? 'grass' : 'vine')
- end
- end
- @equipment_manager.empty_hands
- fput "get my #{@settings.hand_armor}"
- fput "wear my #{@settings.hand_armor}"
- fput ("dump junk")
- end
- def braid_to_fail(item)
- return if left_hand || right_hand
- return unless forage?(item)
- loop do
- waitrt?
- 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')
- when 'Roundtime'
- rt = reget(10, 'Roundtime').last.scan(/\d+/).first.to_i
- break if rt >= 8 || DRSkill.getxp('Mechanical Lore') >= 30
- when 'is already as long as you can make it'
- waitrt?
- break
- when 'You need both hands to do that', /into your braided/
- waitrt?
- empty_trash
- return
- when 'You are in no condition'
- wait_for_script_to_complete('safe-room')
- walk_to(@settings.saferoom)
- @equipment_manager.empty_hands
- return
- else
- break unless forage?(item)
- end
- end
- pause 1
- waitrt?
- bput("pull my #{item}", 'You tug and pull')
- pause 1
- waitrt?
- empty_trash
- end
- def empty_trash
- trash_nouns = get_data('items').trash_nouns
- if trash_nouns.any? { |noun| /\b#{noun}/i =~ GameObj.right_hand.noun } && !@equipment_manager.is_listed_item?(right_hand)
- dispose_trash(right_hand)
- end
- if trash_nouns.any? { |noun| /\b#{noun}/i =~ GameObj.left_hand.noun } && !@equipment_manager.is_listed_item?(left_hand)
- dispose_trash(left_hand)
- end
- fput('dump junk')
- end
- end
- before_dying do
- fput('drop my grass')
- end
- Mechlore.new
Add Comment
Please, Sign In to add comment