Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- Documentation: https://elanthipedia.play.net/sell-pouches
- =end
- custom_require.call(%w(common common-items))
- class SellPouches
- include DRC
- include DRCI
- def initialize
- arg_definitions = [
- [
- { name: 'trader', regex: /\d+/, variable: true, description: 'Container the pouches to be sold are located.' },
- { name: 'container', regex: /\d+/, variable: true, description: 'Name of the Trader doing the selling.' },
- { name: 'dispose', regex: /\d+/, variable: true, optional: true, description: 'Place to put the pouches when returned. (Can be your own container).' }
- ]
- ]
- args = parse_args(arg_definitions)
- EquipmentManager.new.empty_hands
- @pouch_adj = get_settings.gem_pouch_adjective
- @trader = args.trader
- @container = args.container
- @dispose = args.dispose || 'bucket'
- @pouches = rummage('C pouch', @container)
- sell
- end
- def sell
- @pouches.each do |pouch|
- case DRC.bput("get suede pouch in my #{@container}", 'You get', 'What were')
- when 'You get'
- result = bput("give my #{@pouch_adj} pouch to #{@trader}", 'You offer', 'What is it')
- if result =~ /What is it/i
- echo "Exiting, Trader is invalid."
- exit
- end
- waitfor ('offers you')
- pause 1.5
- bput('accept tip', 'You accept', 'But you have no tip')
- case DRC.bput("accept", 'You accept', 'You have no offers')
- when "You accept"
- result = bput("put my pouch in #{@dispose}", 'You put', 'I could not')
- bput('drop my pouch', 'You drop') if result =~ /I could not/i
- end
- when 'What were'
- bput('accept tip', 'You accept', 'But you have no tip')
- return
- end
- end
- bput('accept tip', 'You accept', 'But you have no tip')
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment