View Full Version : Lich -- Problem: Double Echoing
Danical
05-01-2007, 12:55 AM
Rather difficult to get the correct number of items, in this case, boxes in my container.
>l in cloak
In the black velvet cloak you see a sturdy mithril chest, a dragonfire emerald, an opal-inset platinum plate, a steel lockpick, a pink topaz, an ugly pine lute, a violet sapphire, a pink rhodochrosite stone, a golden wand, a star sapphire, an aged palimpsest, some polished red coral, a cats-eye moonstone, a dragonfire opal, an uncut diamond, a blue moonstone, a crystal amulet, an uncut diamond, a golden moonstone, a crystal amulet, some aloeas stem, some ephlox moss, a small green geode, a bundle of arrows, a stiletto and some calamia fruit.
>
[echo: In the cloak: a sturdy mithril chest a dragonfire emerald an opal-inset platinum plate a steel lockpick a pink topaz an ugly pine lute a violet sapphire a pink rhodochrosite stone a golden wand a star sapphire an aged palimpsest some polished red coral a cats-eye moonstone a dragonfire opal an uncut diamond a blue moonstone a crystal amulet an uncut diamond a golden moonstone a crystal amulet some aloeas stem some ephlox moss a small green geode a bundle of arrows a stiletto some calamia fruitIn the black velvet cloak you see a sturdy mithril chest, a dragonfire emerald, an opal-inset platinum plate, a steel lockpick, a pink topaz, an ugly pine lute, a violet sapphire, a pink rhodochrosite stone, a golden wand, a star sapphire, an aged palimpsest, some polished red coral, a cats-eye moonstone, a dragonfire opal, an uncut diamond, a blue moonstone, a crystal amulet, an uncut diamond, a golden moonstone, a crystal amulet, some aloeas stem, some ephlox moss, a small green geode, a bundle of arrows, a stiletto and some calamia fruit.]
What's the source of the problem and how do I fix it?
Danical
05-01-2007, 01:57 AM
Wow. This is infuriating.
This started happening around 5ish today. It effectively fucks all my lich scripts.
Danical
05-01-2007, 06:35 AM
I've had to rewrite the code a number of times. Anytime you grab something from your container and try to match the line, "You remove <so and so> from in <your container>" the script will shit out the entire contents of the container and tag the end with what you remove. I tried to work around it with scan and other various methods without any luck. I've had this problem before. How to fix?
Relevant code
until boxgot
fput "get #{box}"
boxacquire = waitfor("remove", "You pick up", "already have that")
if boxacquire =~ /remove/
boxstring = boxacquire.scan(/an? (.+) (\w+) (chest|coffer|trunk|strongbox|box)/)
$gazed = 0
loredone = false
boxgot = true
boxstate = $1
echo boxstate
boxmaterial = $2
echo boxmaterial
boxtype = $3
echo boxtype
boxdesc = "#{boxstate} #{boxmaterial} #{boxtype}"
echo boxdesc
if boxdesc =~ /(enruned|mithril)/
boxstatus = "#{boxmaterial} #{boxtype}"
detect = true
pgaze = false
else
boxstatus = "#{boxmaterial} #{boxtype}"
pgaze = true
detect = false
end
elsif boxacquire =~ /You pick up/
move "out"
fput "put #{box}"
move "go table"
elsif boxacquire =~ /Get what/
loredone = true
boxgot = true
$gazed = 2
elsif boxacquire =~ /already have that/
detect = false
pgaze = true
end
end
waitrt?
until loredone
if mana?(63) or (Spellsong.timeleft > 0.2 && mana?(6))
fput "loresing #{box}, show unto me;unveil thy purpose to see"
Output
[script]>get chest
You remove an enruned mithril chest from in your black velvet cloak.
>
[script: red dreamstone a bone-inlaid gold alloy crown a black deathstone a fine ora rod a white opal an uncut diamond a blue crystal a blue dreamstone some asterfire quartz an ugly pine lute a piece of rose quartz an uncut emerald a smooth bone wand an uncut emerald a silver lockpick a violet sapphire some asterfire quartz some dragonfire quartz a crystal wand some aloeas stem some ephlox moss a bundle of arrows a stiletto some calamia fruitYou remove an enruned]
[script: mithril]
[script: chest]
[script: red dreamstone a bone-inlaid gold alloy crown a black deathstone a fine ora rod a white opal an uncut diamond a blue crystal a blue dreamstone some asterfire quartz an ugly pine lute a piece of rose quartz an uncut emerald a smooth bone wand an uncut emerald a silver lockpick a violet sapphire some asterfire quartz some dragonfire quartz a crystal wand some aloeas stem some ephlox moss a bundle of arrows a stiletto some calamia fruitYou remove an enruned mithril chest]
[script]>loresing chest, show unto me;unveil thy purpose to see
You sing:
Danical
05-01-2007, 04:30 PM
Still broken :'(
Danical
05-01-2007, 05:31 PM
Fixed. Found a way around it. Got another problem.
Here's my gem database and code. I want to be able to only pick the things I put in the database but it seems to be picking up everything.
gemdb = [ "cupcake", "leg", "jade", "doorknob", "tart", "spherine", "egg", "thunderstone", "faenor-bloom", "aetherstone", "agate", "ambergris", "azurite", "beryl", "bloodjewel", "bloodstone", "bluerock", "caederine", "cordierite", "deathstone", "doomstone", "dreamstone", "eostone", "firestone", "galena", "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", "bark", "leaf", "potion", "nail", "coin", "spoon", "iron", "brick", "cookie", "lichen", "cloth", "muffin" ]
In the black velvet cloak you see an ugly pine lute, some aloeas stem, some ephlox moss, a bundle of arrows, a stiletto and some calamia fruit.
gems = $cloakcontainer.scan(/\b(?:#{gemdb.join('|')})(?=,|\.)/)
OUTPUT
--- Lich: jink active.
[jink: lute]
[jink: moss]
[jink: arrows]
[jink: stiletto]
[jink: fruit]
[jink]>open my coat
That is already open.
>
[jink]>get my lute from my cloak
[jink]>prep 1004
You remove an ugly pine lute from in your black velvet cloak.
>
[jink]>cast at my lute
Shaelun
05-06-2007, 04:44 PM
... I can't stand these StormFront incompatibilities; for every one I fix, two more pop up. Off-hand, it looks like the script is being passed the list of room items. Why it's ending up looking like the same line I don't know, but I'll make a note of it and try to fix it soon.
I have finals and two major software projects due this week, though, so "soon" may end up being not-so-soon.
As for the latter issue... a copy/paste of your code produces no matches at all. I mean "gems" ends up being an empty array, so I'm not exactly sure what you're running, but it apparently isn't identical to what you posted.
Celephais
05-06-2007, 04:48 PM
Stormfront passes a "<component id='room objs' ...>" for the regular window and a "<compDef id='room objs' ...>" for the room window. I didn't really read your whole problem here but that could be part of the issue for the room objects (getting sent twice) same goes for updating your cloak and the inventory windows.
Try disabling the inventory window and then run the script, see if you get double echos.
Danical
05-08-2007, 12:27 PM
No worries.
I just did a quick fix and did a delete_at(0) to get rid of the first element (the whole cloak line) of the array.
Works splendidly now.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.