PDA

View Full Version : Anyone have a jar script for gems?



Jaimaltz
10-28-2008, 11:02 AM
For the adventure guild, storing all the gems you find in those 20 item jars. Just seeing if someone else already has one they'd share before I try to write one myself.

Also, is there a command which lists the full description when looking in a container? For example, if a jar is in my backpack, and I look in the backpack, it'll list "an opalescent jar", but if it's in my hand it'll say "an opalascent jar containing <gem name>".

Thanks.

Mr. Dallas
10-28-2008, 12:16 PM
inven full

nocturnix
10-28-2008, 12:19 PM
inven full

Learn something every day. And while we're on that note, I cant seem to remember how to sort things in a bag. sort cluster XX in my backpack doesnt work?

AestheticDeath
10-28-2008, 12:54 PM
should work

Kitsun
10-28-2008, 01:22 PM
sort cluster stone in my cloak
6 items matching "a smooth stone" were moved.
1 item matching "a green malachite stone" was moved.
1 item matching "a banded sardonyx stone" was moved.
In total, 8 items in a

Jaimaltz
10-28-2008, 02:24 PM
Thanks for inventory full, that was helpful. Is there a way to pick up a jar depending on it's contents/description. In other words, an inventory full would give something like

You are currently wearing and carrying:
a buckled burlap pack
an opalescent glass jar containing Kezmonian honey beryls
an apalescent glass jar containing red spinels
some haphip root
etc

Is there a way to do something like "get my jar containing red spinels" or an equivalent? The way I just mentioned doesn't work. I suppose I could have a script count the number of jar lines up to the one I want, and pick up the second, third, etc. as appropriate.

Thanks.

Kitsun
10-28-2008, 02:26 PM
rummage in my cloak ingredient red spinel

Jaimaltz
10-28-2008, 02:30 PM
Awesome, thanks!

nocturnix
10-28-2008, 03:05 PM
I <3 Mr. Dallas and Kitsun

Jaimaltz
10-29-2008, 11:59 PM
I finished writing the script. It is a lich script, I also put it in the repository. An alchemy component one would be just as easy to make, just replace the gems with the components. I'd be happy to do it if someone can point me to a complete list of alchemy components.



#Will stick gems into jars (will also do bottles and beakers)- useful for adventure guild gem hoarding
#Usage: ;jargem <container1> <container2> <container3> <container4>
#where container1 = Unprocessed gems - will default to greatcloak if not defined
# container2 = Your primary jar container (not full jars) - backpack if not defined
# container3 = Empty jar container - sack if not defined
# container4 = Full jar container (full jar storage) - satchel if not defined
#You can change the hardcoded ones pretty easily with a quick edit, if desired.

gemdb = [ "banded agate", "blue lace agate", "chameleon agate", "cloud agate", "fire agate", "frost agate", "moss agate", "mottled agate", "tigereye agate", "deep purple amethyst", "azurite", "azure blazestar", "crimson blazestar", "golden blazestar", "emerald blazestar", "bloodjewel", "bloodstone", "bright bluerock", "red carbuncle", "chalcedony", "ridge coral", "paw coral", "flower coral", "black coral", "blue coral", "pink coral", "red coral", "blue cordierite", "corestone", "cinnabar crystal", "glaesine crystal", "quartz crystal", "rock crystal", "dragonmist crystal", "tigerfang crystal", "deathstone", "scarlet despanal", "blue diamond", "dragon\'s-tear diamond", "dwarf-cut diamond", "black diamond", "yellow diamond", "uncut diamond", "maernstrike diamond", "star-of-tamzyrr diamond", "star diopside", "doomstone", "black dreamstone", "blue dreamstone", "green dreamstone", "pink dreamstone", "red dreamstone", "yellow dreamstone", "white dreamstone", "gold dust", "dragonfire emerald", "dragon\'s-tear emerald", "dwarf-cut emerald", "uncut emerald", "eye-of-Koar emerald", "star emerald", "blue eostone", "olivine faenor-bloom", "bronze fang", "copper fang", "gold fang", "iron fang", "mithril fang", "platinum fang", "silver fang", "steel fang", "urglaes fang", "violet feystone", "periwinkle feystone", "firestone", "almandine garnet", "red garnet", "green garnet", "spessartine garnet", "wyrm\'s-eye garnet", "ametrine gem", "aquamarine gem", "chrysoberyl gem", "blue gem", "red gem", "beryl gem", "chrysoprase gem", "lilac glimaerstone", "cerulean glimaerstone", "clear glimaerstone", "golden glimaerstone", "green glimaerstone", "peach glimaerstone", "smoky glimaerstone", "ultramarine glimaerstone", "petrified haon", "yellow heliodor", "yellow hyacinth", "polished ivory", "fiery jacinth", "brown jade", "green jade", "white jade", "black jasper", "red jasper", "yellow jasper", "blue lapis", "black marble", "green marble", "pink marble", "white marble", "mica", "mithril-bloom", "pale blue moonstone", "cats-eye moonstone", "golden moonstone", "opaline moonstone", "pale green moonstone", "silvery moonstone", "mother-of-pearl", "gold nugget", "platinum nugget", "obsidian", "spiderweb obsidian", "banded onyx", "black onyx", "piece of onyx", "aster opal", "black opal", "boulder opal", "dragonfire opal", "fire opal", "moonglae opal", "white opal", "frost opal", "purple opal", "green ora-bloom", "firemote orb", "shadowglass orb", "fire pearl", "iridescent pearl", "black pearl", "grey pearl", "pink pearl", "white pearl", "peridot", "pyrite", "blue quartz", "carnelian quartz", "eye quartz", "citrine quartz", "rose quartz", "rainbow quartz", "tangerine quartz", "golden rhimar-bloom", "riftshard", "riftstone", "rosespar", "dragon\'s-tear ruby", "dwarf-cut ruby", "star ruby", "uncut ruby", "sylvarraend ruby", "sandsilver", "blue sapphire", "blue shimmarglin sapphire", "clear sapphire", "dragonsbreath sapphire", "dragonseye sapphire", "blue mermaid\'s-tear sapphire", "dwarf-cut sapphire", "green sapphire", "lavender shimmarglin sapphire", "pale water sapphire", "pink sapphire", "star sapphire", "violet sapphire", "yellow sapphire", "umber sard", "sardonyx", "shimmertine shard", "viridian soulstone", "black sphene", "brown sphene", "white sphene", "yellow sphene", "spherine", "blue spinel", "pink spinel", "red spinel", "violet spinel", "sardonyx stone", "alexandrite stone", "adventure stone", "malachite stone", "labradorite stone", "morganite stone", "rhodocrosite stone", "jet stone", "turquoise stone", "sunstone", "sapphire talon", "purple thunderstone", "blue topaz", "clear topaz", "golden topaz", "errisian topaz", "imperial topaz", "pink topaz", "smoky topaz", "black tourmaline", "blue tourmaline", "clear tourmaline", "green tourmaline", "pink tourmaline", "spiderweb turquoise", "argent vultite-bloom", "wyrdshard", "brown zircon", "clear zircon", "green zircon", "snowflake zircon", "yellow zircon" ]

if script.vars.find { |val| val =~ /\bhelp\b/i }
echo("Will stick gems into jars (will also do bottles and beakers) - useful for adventure guild gem hoarding")
echo("Usage: ;jargem <container1> <container2> <container3> <container4>")
echo(" container1 = Unprocessed gems - greatcloak if not defined")
echo(" container2 = Primary jar container (not full jars) - backpack if not defined")
echo(" container3 = Empty jar container - sack if not defined")
echo(" container4 = Full jar container - satchel if not defined")
echo("You can change the hardcoded ones pretty easily with a quick edit if desired.")
exit
end

script.vars.shift
gemsack = script.vars.shift
primejarsack = script.vars.shift
emptyjarsack = script.vars.shift
fulljarsack = script.vars.shift

# Here is where you would edit, if you want to change the hardcoded containers
if gemsack.nil? then gemsack = "greatcloak" end
if primejarsack.nil? then primejarsack = "backpack" end
if emptyjarsack.nil? then emptyjarsack = "sack" end
if fulljarsack.nil? then fulljarsack = "satchel" end

fput "look in my #{gemsack}"
mytest = waitfor("nothing in there", "you see", "could not find what")
if mytest =~ /nothing in there/
echo ("There are no gems in your unprocessed gem container")
exit
end
if mytest =~ /could not find what/
echo ("You don't seem to have a #{gemsack}, you will need to either give this script arguments or change the hardcoded containers")
exit
end
fput "look in my #{gemsack}"
contents = waitfor("In the .+ you see").gsub(/ and (?:an|a|some)/, ',')
gems = contents.scan(/\b(?:#{gemdb.join('|')})(?=,|\.)/)
result = String.new
quantity = gems.length

until (quantity == 0)
gem = gems.shift
if gem =~ /pale blue sapphire/
gem = 'pale sapphire'
elsif gem =~ /pale blue moonstone/
gem = 'pale moonstone'
elsif gem =~ /pale green moonstone/
gem = 'pale moonstone'
elsif gem =~ /deep purple amethyst/
gem = 'deep amethyst'
elsif gem =~ /blue shimmarglin sapphire/
gem = 'blue sapphire'
elsif gem =~ /lavender shimmarglin sapphire/
gem = 'lavender sapphire'
end

quantity = quantity - 1
fput "take my #{gem} from my #{gemsack}"
result = waitfor("You remove", "Get what", "need a free hand")
if result =~ /need a free hand/
fput "stow all"
end
if result =~ /You remove/
status = 1
while status == 1
status = 0
contain = nil
put "rummage in my #{primejarsack} ingredient #{gem}"
newresult = waitfor("jar", "bottle", "beaker", "seem to locate any ingredient like that")
if newresult =~ /jar/
contain = 'jar'
elsif newresult =~ /bottle/
contain = 'bottle'
elsif newresult =~ /beaker/
contain = 'beaker'
end
if newresult =~ /jar|bottle|beaker/
fput "put my #{gem} in my #{contain}"
jarresult = waitfor("into your jar", "into your beaker", "into your bottle", "to the contents of", "into your empty", "full", "better of mixing", "holding the beaker", "holding the jar", "holding the bottle")
if jarresult =~ /into your empty|into your beaker|into your jar|into your bottle|to the contents of/
fput "put my #{contain} in my #{primejarsack}"
elsif jarresult =~ /better of mixing/
fput "put my #{contain} in my #{gemsack}"
status = 1
elsif jarresult =~ /full/
fput "put my #{contain} in my #{fulljarsack}"
fput "get jar from my #{emptyjarsack}"
emptyresult = waitfor("Get what", "You remove")
if emptyresult =~ /Get what/
fput "get bottle from my #{emptyjarsack}"
botresult = waitfor("Get what", "You remove")
if botresult =~ /Get what/
fput "get beaker from my #{emptyjarsack}"
beakresult = waitfor("Get what", "You remove")
if beakresult =~ /Get what/
echo ("You are out of empty jars")
exit
else
contain = 'beaker'
fput "put my #{gem} in my #{contain}"
fput "put my #{contain} in my #{primejarsack}"
end
else
contain = 'bottle'
fput "put my #{gem} in my #{contain}"
fput "put my #{contain} in my #{primejarsack}"
end
else
contain = 'jar'
fput "put my #{gem} in my #{contain}"
fput "put my #{contain} in my #{primejarsack}"
end
end
end

if newresult =~ /seem to locate any ingredient like that/
fput "get jar from my #{emptyjarsack}"
myemptyresult = waitfor("Get what", "You remove")
if myemptyresult =~ /Get what/
fput "get bottle from my #{emptyjarsack}"
botresult = waitfor("Get what", "You remove")
if botresult =~ /Get what/
fput "get beaker from my #{emptyjarsack}"
beakresult = waitfor("Get what", "You remove")
if beakresult =~ /Get what/
echo ("You are out of empty jars")
exit
else
contain = 'beaker'
fput "put my #{gem} in my #{contain}"
fput "put my #{contain} in my #{primejarsack}"
end
else
contain = 'bottle'
fput "put my #{gem} in my #{contain}"
fput "put my #{contain} in my #{primejarsack}"
end

else
contain = 'jar'
fput "put my #{gem} in my #{contain}"
fput "put my #{contain} in my #{primejarsack}"
end
end
end
pause 1
fput "look in my #{gemsack}"
trans = matchtimeout 3, "bottle", "jar", "beaker", "nothing in there"
if trans =~ /jar/
fput "get jar from my #{gemsack}"
fput "put jar in my #{primejarsack}"
end
if trans =~ /bottle/
fput "get bottle from my #{gemsack}"
fput "put bottle in my #{primejarsack}"
end
if trans =~ /beaker/
fput "get beaker from my #{gemsack}"
fput "put beaker in my #{primejarsack}"
end
end
if result =~ /Get what/
echo ("there is a problem with your gem setup, double check, exiting")
exit
end
end
echo ("And we're done! Exiting.")
exit

onurb
11-22-2008, 02:49 PM
Thank you for posting your lich jar script, it's very handy and well written.

I did find a couple bugs that I would like to mention. Perhaps you can help me find a way to correct them.

First off, here are some minor corrections that I was able to handle on my own:

pale water sapphire = water sapphire
blue shimmarglin sapphire = shimmarglin sapphire
lavender shimmarglin sapphire = shimmarglin sapphire

Secondly, the script seems to have issues when dealing with these specific gems. For instance, it will pull out a pale blue moonstone, then it will rummage for a "pale moonstone" with the intention of finding a "blue moonstone" jar, but it ends up finding a "green moonstone" jar instead. It tries to put the blue moonstone into the green moonstone jar, but they won't mix, the script understands this, and then puts the incompatible jar into a temporary location while it rummages for the right jar again. However, the right jar dosen't exist so therefor it should pull an empty jar to put the gem in. This is where the problem occurs. It's not pulling an empty jar and the script starts going haywire at this point.

Kitsun
11-22-2008, 03:08 PM
I <3 Mr. Dallas and Kitsun

Rep me then!

Jaimaltz
11-23-2008, 05:37 PM
The blue shimmarglin sapphires were really annoying. If I set it to 'blue sapphire' it would conflict with blue sapphires, if I set it to 'shimmarglin sapphire' it would conflict with the lavender ones, and if I set it to 'blue shimmarglin sapphire' it just wouldn't work. I'm pretty sure the error handling when there's a mismatch on the gems should be working correctly now.

I think I fixed most of the problems in the script, but I've put the script in the repository and keep forgetting to keep updating the one here. I've made something like 15 revisions to it fixing minor bugs. Your best bet is to grab a fresh copy from the repository. Let me know if you still have problems with the updated one.

JustWondering
01-13-2009, 10:30 AM
Is there a non-lich version of this script available?

phantasm
01-13-2009, 03:17 PM
Here's a couple I use to store bounty gems.



#(U) Bounty Gems
#Get a # of gems from the beakers in your locker for a bounty
counter set %3

match beaker You rummage around the deep chest and remove
match nobeaker You rummage around a deep chest, but
put rummage chest ingredient %1 %2
matchwait

loop1:
loop2:
loop3:
loop4:
loop5:
loop6:
loop7:
loop8:
loop9:
loop10:
loop11:
loop12:
loop13:
beaker:
counter subtract 1
match store You give your beaker a hard shake, causing
put shake my beaker
matchwait

store:
put put %1 %2 in my pouch
goto loop%c

loop0:
put put beaker in locker
exit

nobeaker:
ECHO FAIL
exit



#(U) Bounty Gems
#Put gems in locker from container

match beaker You rummage around the deep chest and remove
match nobeaker You rummage around a deep chest, but
put rummage chest ingredient %1 %2
matchwait


beaker:
match beaker2 You remove
match done Get what?
put get %1 %2 in my pouch
matchwait

beaker2:
match beaker You add
match full beaker is full
put put my %1 %2 in my beaker
matchwait


done:
put put beaker in locker
exit

full:
put put beaker in locker
put put %1 %2 in my pouch
exit

nobeaker:
ECHO FAIL
exit