Code:
jar = ["clear beaker", "azure beaker", "wavy bottle", "prismatic bottle", "narrow bottle", "mottled bottle", "speckled bottle", "violet bottle", "rainbow bottle", "multi bottle", "silver bottle", "amber beaker", "poppy beaker", "sooty beaker",
"ten-sided jar", "ash beaker", "viridian beaker", "heptagonal jar", "octagonal jar", "dove jar", "cerulean jar", "bulbous jar", "scarlet jar", "goldenrod jar", "spherical jar", "cubical jar", "triangular jar", "pentagonal jar", "amethyst jar"]
gem = ["dragon's-tear emerald", "uncut diamond", "uncut emerald", "dragon's-tear ruby", "uncut ruby", "blue sapphire", "pink sapphire", "emerald blazestar", "scarlet despanal", "dragon's-tear diamond", "maernstrike diamond", "sylvarraend ruby",
"dragonseye sapphire", "ultramarine glimaerstone", "black opal", "lilac glimaerstone", "cerulean glimaerstone"]
i = 0
echo gem.length
while i < gem.length
fput "tap my " + gem[i]
target_line = matchtimeout 2, "You tap", "What were you referring to?"
if target_line =~ /You tap/
fput "get my " + jar[i]
target_line = matchtimeout 2, "You remove", "You already have that", "Get what?"
if target_line =~ /You remove|You already have that/
gem_line = String.new
while gem_line !~ /I could not find what you were referring to/
fput "get my " + gem[i]
fput "put my " + gem[i] + " in my " + jar[i]
gem_line = matchtimeout 2, "You put", "You add", "I could not find what you were referring to"
end
elsif target_line =~ /Get what?/
echo "You need a " + jar[i] + " to store that gem with the current settings."
end
fput "put my " + jar[i] + " in my cloak"
end
i = i + 1
end