Renian
03-13-2008, 06:41 AM
This script of mine, which I intend to add to hunting scripts, doesn't seem to realize that it has matches.
#testloot
f = File.new("c:/Lich/scripts/loot.dat", "r")
$array = f.readlines
f.close
f2 = File.new("c:/Lich/scripts/misc.dat", "r")
$misc = f2.readlines
f2.close
def loot()
#fput "loot"
#target_line = matchtimeout 3, "You search", "Could not find"
#if target_line =~ /You search/
checkloot.each do |maybeloot|
echo "Found a possible."
$array.each do |loot|
echo "Comparing " + loot + " and " + maybeloot
if maybeloot == loot
echo "Got one!"
$other = false
fput "get " + loot
$misc.each do |other|
if other == loot
$other = true
end
if $other != true && other != loot
$other = false
end
end
if $other == true
fput "put " + loot + " in my cloak"
target_line = matchtimeout 2, "won't fit", "You put"
if target_line == "won't fit"
fput "put " + loot + " in my backpack"
end
else
fput "put " + loot + " in my pouch"
end
end
end
end
#end
end
loot()
Here's the output.
[Ant Hill Table]
On the inner side of one of the table legs, a small nest is visible. Dozens of ants scurry about on the floor as they indulge happily in spilled brew and ale from the previous messy patrons. Serving as a most unique centerpiece, a piece of amber has been cut into the shape of a star and holds the fossilized remains of several unknown tiny creatures. You also see a golden beryl gem.
[loottest: Found a possible.]
[loottest: Comparing dust
and gem]
[loottest: Comparing sapphire
and gem]
[loottest: Comparing diamond
and gem]
[loottest: Comparing emerald
and gem]
[loottest: Comparing ruby
and gem]
[loottest: Comparing gem
and gem]
[loottest: Comparing chest
and gem]
[loottest: Comparing box
and gem]
[loottest: Comparing trunk
and gem]
[loottest: Comparing strongbox
and gem]
[loottest: Comparing coffer
and gem]
[loottest: Comparing flask
and gem]
[loottest: Comparing ring
and gem]
[loottest: Comparing crystal
and gem]
[loottest: Comparing deathstone
and gem]
[loottest: Comparing brooch
and gem]
[loottest: Comparing stein
and gem]
[loottest: Comparing sphere
and gem]
[loottest: Comparing pitcher
and gem]
[loottest: Comparing blazestar
and gem]
[loottest: Comparing chalcedony
and gem]
[loottest: Comparing glimaerstone
and gem]
[loottest: Comparing lapis lazuli
and gem]
[loottest: Comparing pearl
and gem]
[loottest: Comparing topaz
and gem]
[loottest: Comparing blazestar
and gem]
[loottest: Comparing obsidian
and gem]
[loottest: Comparing wand
and gem]
[loottest: Comparing coral
and gem]
[loottest: Comparing heliodor
and gem]
[loottest: Comparing peridot
and gem]
[loottest: Comparing quartz
and gem]
[loottest: Comparing moonstone
and gem]
[loottest: Comparing faenor-bloom
and gem]
[loottest: Comparing dreamstone
and gem]
[loottest: Comparing stone
and gem]
[loottest: Comparing turquoise
and gem]
[loottest: Comparing zircon
and gem]
[loottest: Comparing band
and gem]
[loottest: Comparing bracelet
and gem]
[loottest: Comparing talisman
and gem]
[loottest: Comparing crown
and gem]
[loottest: Comparing garnet
and gem]
[loottest: Comparing statue
and gem]
[loottest: Comparing palimpsest
and gem]
[loottest: Comparing paper
and gem]
[loottest: Comparing scroll and gem]
#testloot
f = File.new("c:/Lich/scripts/loot.dat", "r")
$array = f.readlines
f.close
f2 = File.new("c:/Lich/scripts/misc.dat", "r")
$misc = f2.readlines
f2.close
def loot()
#fput "loot"
#target_line = matchtimeout 3, "You search", "Could not find"
#if target_line =~ /You search/
checkloot.each do |maybeloot|
echo "Found a possible."
$array.each do |loot|
echo "Comparing " + loot + " and " + maybeloot
if maybeloot == loot
echo "Got one!"
$other = false
fput "get " + loot
$misc.each do |other|
if other == loot
$other = true
end
if $other != true && other != loot
$other = false
end
end
if $other == true
fput "put " + loot + " in my cloak"
target_line = matchtimeout 2, "won't fit", "You put"
if target_line == "won't fit"
fput "put " + loot + " in my backpack"
end
else
fput "put " + loot + " in my pouch"
end
end
end
end
#end
end
loot()
Here's the output.
[Ant Hill Table]
On the inner side of one of the table legs, a small nest is visible. Dozens of ants scurry about on the floor as they indulge happily in spilled brew and ale from the previous messy patrons. Serving as a most unique centerpiece, a piece of amber has been cut into the shape of a star and holds the fossilized remains of several unknown tiny creatures. You also see a golden beryl gem.
[loottest: Found a possible.]
[loottest: Comparing dust
and gem]
[loottest: Comparing sapphire
and gem]
[loottest: Comparing diamond
and gem]
[loottest: Comparing emerald
and gem]
[loottest: Comparing ruby
and gem]
[loottest: Comparing gem
and gem]
[loottest: Comparing chest
and gem]
[loottest: Comparing box
and gem]
[loottest: Comparing trunk
and gem]
[loottest: Comparing strongbox
and gem]
[loottest: Comparing coffer
and gem]
[loottest: Comparing flask
and gem]
[loottest: Comparing ring
and gem]
[loottest: Comparing crystal
and gem]
[loottest: Comparing deathstone
and gem]
[loottest: Comparing brooch
and gem]
[loottest: Comparing stein
and gem]
[loottest: Comparing sphere
and gem]
[loottest: Comparing pitcher
and gem]
[loottest: Comparing blazestar
and gem]
[loottest: Comparing chalcedony
and gem]
[loottest: Comparing glimaerstone
and gem]
[loottest: Comparing lapis lazuli
and gem]
[loottest: Comparing pearl
and gem]
[loottest: Comparing topaz
and gem]
[loottest: Comparing blazestar
and gem]
[loottest: Comparing obsidian
and gem]
[loottest: Comparing wand
and gem]
[loottest: Comparing coral
and gem]
[loottest: Comparing heliodor
and gem]
[loottest: Comparing peridot
and gem]
[loottest: Comparing quartz
and gem]
[loottest: Comparing moonstone
and gem]
[loottest: Comparing faenor-bloom
and gem]
[loottest: Comparing dreamstone
and gem]
[loottest: Comparing stone
and gem]
[loottest: Comparing turquoise
and gem]
[loottest: Comparing zircon
and gem]
[loottest: Comparing band
and gem]
[loottest: Comparing bracelet
and gem]
[loottest: Comparing talisman
and gem]
[loottest: Comparing crown
and gem]
[loottest: Comparing garnet
and gem]
[loottest: Comparing statue
and gem]
[loottest: Comparing palimpsest
and gem]
[loottest: Comparing paper
and gem]
[loottest: Comparing scroll and gem]