Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $partialjarsack = GameObj.inv.find { |obj| obj.name =~ /#{UserVars.partialjarsack}/}
- $fulljarsack = GameObj.inv.find { |obj| obj.name =~ /#{UserVars.fulljarsack}/}
- $emptyjarsack = GameObj.inv.find { |obj| obj.name =~ /#{UserVars.emptyjarsack}/}
- $overflowsack = GameObj.inv.find { |obj| obj.name =~ /#{UserVars.overflowsack}/}
- $gemsack = GameObj.inv.find { |obj| obj.name =~ /#{UserVars.gemsack}/}
- $reagentsack = GameObj.inv.find { |obj| obj.name =~ /#{UserVars.reagentsack}/}
- $lootsack = GameObj.inv.find { |obj| obj.name =~ /#{UserVars.lootsack}/}
- $jararray = Array.new
- $gemlist = Array.new
- $gemcount = Array.new
- $jarcount = nil
- $loc = nil
- $total = nil
- $gems_i_have = nil
- $gem_color = script.vars[1]
- $gem_type = script.vars[2]
- gem_im_looking_for = $gem_color + $gem_type
- def count
- put "look in #{$gemsack}"
- sleep 1
- more_line = $line[/<.*>/]
- $gemsack.contents.each { |obj|
- if obj.type =~ /gem|reagent/
- $gemlist << obj.name
- $total += 1
- end
- }
- for gem in $gemlist.uniq
- count = $gemlist.count(gem)
- $gemcount << [gem, count, more_line]
- end
- GameObj.inv.each {|obj|
- obj.contents.each { |i|
- if (i.noun =~ /^(?:jar|bottle|beaker)$/)
- if i.after_name.nil?
- next
- else
- $jarcount += 1
- look_result = dothistimeout "look in ##{i.id}", 3, /^Inside .*? you see [0-9]+ portion/
- if look_result =~ /^Inside .*? you see ([0-9]+) portion/ then
- count = $1.to_i
- $loc = $line[/<.*>/]
- end
- name = i.after_name.gsub(/^containing |large |medium |small |tiny |some /, '')
- name = name.split(//)
- name.pop
- name = name.join
- listed = false
- for gem in $gemcount
- if gem[0].include?(name)
- gem[1] += count
- gem << $loc
- listed = true
- $total = $total + count
- break
- end
- end
- if listed == false
- $gemcount << [name, count, $loc]
- $total += count
- end
- end
- end
- }
- }
- echo count
- for gem in $gemcount
- if gem[0] =~ /#{$gem_color} #{$gem_type}/
- puts "#{gem[0].ljust(30)} #{gem[1]}"
- $gems_i_have = gem[1]
- send_to_script "lnet", "chat to #{$person} I have #{gem[1]} #{gem[0]}"
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement