PDA

View Full Version : Gem Singing?



Xaerve
12-16-2009, 11:51 AM
Anyone have one of the great lich gem singing scripts still? I checked on the new and old repos and couldn't find it.

Let me know, thanks.

-X

Smythe
12-16-2009, 08:27 PM
An oldie but a goodie I changed a bit ta use myself.

- Smythe




# This is a really simply modified (read: 2 lines added) version of "pure.lic" b/c the thing is written so horribly even I can't follow it anymore, and people like to go a cast or two further than I do. Enjoy
# Will purify the contents of your container with 1004 (purification song), while being conscious of mana and checking for orbs/rechargables; defaults to stopping at a 'safe' point, but enter 'full' as the first command line variable and it will go until the gem shatters or is fully purified
# Added capability -- enter 'quick' as the first command line variable and it will only sing to the gem once to find orbs / rechargables

gemdb = [ "faenor-bloom", "star ruby", "aetherstone", "agate", "ambergris", "azurite", "beryl", "bloodjewel", "bloodstone", "bluerock", "caederine", "cordierite", "deathstone", "doomstone", "dreamstone", "eostone", "firestone", "galena", "geode", "hyacinth", "onyx", "pyrite", "peridot", "rhimar", "riftshard", "riftstone", "rosepar", "wyrdshard", "spinel", "shard", "faenor", "blazestar", "despanal", "feystone", "diamond", "emerald", "ruby", "pearl", "sapphire", "opal", "jacinth", "garnet", "moonstone", "stone", "topaz", "gem", "coral", "sunstone", "starstone", "quartz", "heliodor", "glimaerstone", "carbuncle", "turquoise", "chalcedony", "tourmaline", "obsidian", "zircon", "amethyst", "lapis lazuli", "amber" ]

if script.vars[1] =~ /\btransfer\b/i then fput("look in my #{script.vars[2]}").scan(/\b(?:#{gemdb.join('|')})(?=,|\.)/).each { |gem| if gem =~ /lapis lazuli/ then gem = "lapis" end; fput "take my #{gem} from my #{script.vars[2]}"; fput "put my #{gem} in my #{script.vars[3]}" }; exit
elsif script.vars[1] =~/\bsell\b/i then fput("look in my #{script.vars[2]}").scan(/\b(?:#{gemdb.join('|')})(?=,|\.)/).each { |gem| if gem =~ /lapis lazuli/ then gem = "lapis" end; fput "take my #{gem} from my #{script.vars[2]}"; fput "sell my #{gem}" }; exit end

loresong = ", I ask this of you;Show the purpose beneath your hue"
#loresong = ", shining in my hand;Give your purpose in this land"


if script.vars.find { |val| val =~ /\bhelp\b/i }
echo("Syntax: ;gemsing (container) (done_container) (orb_container)")
echo("You can also define your 'lootsack', 'gemsack' and 'puregemsack' containers (type ';settings' for info)")
echo("If you don't specify a container for orb gems, they won't be separated")
echo("You can specify as the first variable either full (sing until pure) or quick (check only for orbs / rechargables")
echo("You can also enter: #{$clean_lich_char}gemsing transfer (from) (to) to transfer any gems from (from) container to (to) container")
echo("Or, you can enter: #{clean_lich_char}gemsing sell (from) to sell any gems (from) a container")
exit
end
unless (script.vars.empty?)
if (Lich.lootsack.empty? or Lich.gemsack.empty?)
unless script.vars[2]
echo("Error! You must either have your 'lootsack'/'gemsack' settings defined, or provide the container names on the command line!")
echo("Syntax: ;gemsing (container) (done_container) (orb_container)")
echo("If the container for orb gems is omitted, they'll be put in whatever container you provide for 'done_container'")
exit
end
end
respond; respond "Value of variables is #{script.vars}"; respond
respond; respond "Value of first variable is #{script.vars.first} and #{script.vars[1]}"; respond
respond; respond "Value of second variable is #{script.vars[2]}"; respond
if (script.vars[1] =~ /full/i || script.vars[1] =~ /quick/i)
script.vars.shift
tempo = script.vars.shift
lootsack = script.vars.shift
gemsack = script.vars.shift
orbsack = script.vars.shift
if orbsack.nil? then orbsack = gemsack.dup end
else
script.vars.shift
lootsack = script.vars.shift
gemsack = script.vars.shift
orbsack = script.vars.shift
if orbsack.nil? then orbsack = gemsack.dup end
end
else
script.vars.shift
lootsack = Lich.lootsack.clone
gemsack = Lich.gemsack.clone
orbsack = Lich.puregemsack.clone
end

fput "look in my #{lootsack}"
contents = waitfor("In the .+ you see").gsub(/ and (?:an|a|some)/, ',')
gems = contents.scan(/\b(?:#{gemdb.join('|')})(?=,|\.)/)

result = String.new
close_when_done = false
numbershattered = 0
startnumber = gems.length
madeorb = false
tick = nil; tock = nil
time_total = 0
gems.length.times {
plus_one = false
unless tock.nil?
time_total += tock - tick
avg_time = time_total.to_f / (startnumber - gems.length).to_f
end
tick = Time.now.to_f
if time_total.nonzero?
est_time_left = (avg_time * gems.length.to_f) / 60.00
est_min = ' (estimated time left is ' + est_time_left.truncate.to_s; est_sec = ((est_time_left % 1) * 0.60).to_s.sub(/.*\.(\d\d).*/, '\1')
else
est_min = ' (estimated time left is ??'; est_sec = '??'
end
if gems.length > 1
respond("#{gems.length} gems left" + est_min + ":" + est_sec + ').')
else
respond("#{gems.length} gem left" + est_min + ":" + est_sec + ').')
end
gem = gems.shift
if gem =~ /lapis lazuli/
gstore = "lapis lazuli"
gem = "lapis"
else
gstore = gem.dup
end
orbcheck = true ; oncemore = false
wait_until('Waiting on mana...') { mana(4) }
loresing = false
fput "take my #{gem} from my #{lootsack}"
until result =~ /what were you|cannot|must be holding|shatter/i
wait_until('Waiting on mana...') { mana(4) }
fput 'prep 1004' if mana(4)
fput "sing at my #{gem}" if mana(4)
result = waitfor('essence',"gem becomes more perfect","shatter","crack","must be holding","what were you","appearing smoother and more pure", "improves somewhat","cannot be", "Sing Roundtime",'Spell Hindrance')

if tempo =~ /quick/i
if result =~ /cannot|essence/
loresing = true
break
else
loresing = false
sleep 2
break
end
elsif tempo =~ /full/i
if result =~ /cannot/
(loresing = true) if orbcheck
break
elsif result =~ /crack/
orbcheck = false
end
else
if result =~ /more perfect|what were you|improves somewhat|crack|shatter|cannot be|must be holding|smoother and more pure in color/
nextline = get
if (nextline =~ /essence/) then madeorb = true; loresing = true; break end
if result =~ /smoother and more pure in color/
if plus_one
plus_one = false
oncemore = false
break
elsif oncemore
oncemore = true
plus_one = true
else
oncemore = true
end
end
(loresing = true) if (result =~ /cannot be/)
(numbershattered += 1) if (result =~ /shatter/)
if result =~ /crack|somewhat|What were|cannot|must be holding/ then break end
end
end
sleep 3
end
if loresing
wait_until('Waiting on mana...') { mana(4) }
fput("loresing " + gstore + loresong) if mana(4)
result = waitfor("pulse", "pulses", "draw power", "gem of some kind")
if result =~/pulse|draw power/
if result =~/pulse/
echo("*** THIS GEM IS MAGE RECHARGABLE ***")
exit
end
waitrt?
fput "put my #{gem} in my #{orbsack}"
# sleep 1.5
elsif result =~ /gem of some kind/
waitrt?
fput "put my #{gem} in my #{gemsack}"
# sleep 1.5
end
elsif madeorb
madeorb = false
fput "put my #{gem} in my #{orbsack}"
sleep 2.5
else
fput("put my #{gem} in my #{gemsack}") unless (result =~ /shatter/)
sleep 1.5
wait_until('Waiting on mana...') { mana(4) }
end
unless result =~ /shatter/
if waitfor('closed!', 'You put', 'what\?', 'could not find') =~ /closed!/
fput "open my #{gemsack}"
fput "put my #{gem} in my #{gemsack}"
close_when_done = true
end
end
result = String.new
tock = Time.now.to_f
}

if close_when_done
fput "close my #{gemsack}"
end
respond ""
if startnumber == 0
echo("Did not recognize any gems in your container")
else
echo("Purified #{startnumber - numbershattered} #{if (startnumber - numbershattered) == 1 then 'gem' else 'gems' end}; #{numbershattered} #{if numbershattered == 1 then 'gem was' else 'gems were' end} shattered (sung to #{startnumber} total)")
end

Cephalopod
12-16-2009, 08:49 PM
I'm disappointed that script doesn't have comments written in an RP dialect.

(neutral) Gem Singing? 12-16-2009 09:02 PM Lemme help ya wit' dat! Fewkin' idgit. - Smythe

Much better.

Xaerve
12-17-2009, 09:25 AM
Thanks.

Sam
12-17-2009, 09:42 AM
is it my PC account settings or something, or does everyone see stuff wrapped in CODE tags as a blob of wordwrapped shit?

Smythe
12-17-2009, 06:56 PM
Don't wrap here.

- Smythe