PDA

View Full Version : Senseing Script



stormtov
08-27-2008, 12:55 PM
Ok, this is just the first line or two of a script that will eventually tell me all the herbs that grow in that room. Unfortunately i'm already stuck, just can't seem to get matchfind to work. Anyways here is the script:

====
put "sense"

condition1, condition2 = matchfind "You scan your surroundings, considering the various flora and fauna found here (and noting those which are absent). The indications of the ? climate and the ? environment are clearly evident to your seasoned eye."

echo "#{condition2} and #{condition2}"
====
It never makes it past the matchwait. Here is the readout from in game when using sense:
====
H>sense
You scan your surroundings, considering the various flora and fauna found here (and noting those which are absent). The indications of the temperate climate and the cultivated environment are clearly evident to your seasoned eye. You also see a glaesine arch.
Roundtime: 6 sec.
====
Have had problems getting matchfind to work quite a few times now and it's getting annoying. There something obvious i'm missing?

Oh and also as im posting don't spose anyone has a herb list arranged by what climate/terrain it grows in?

NocturnalRob
08-27-2008, 01:07 PM
http://imagecache2.allposters.com/images/pic/TEE_AMER/KK520~Karate-Kid-Bow-to-your-Sensei-Posters.jpg

Imperarx
08-28-2008, 03:34 PM
Couple of things.

Which version of lich are you running? 3.57, or earlier? Also, I'd trim down your matchline to just what you need.

con1, con2 = matchfind "indications of the ? climate and the ? environment are clearly evident"

It's unlikely you'd catch that line from another output, and since you're checking directly after your input, it shouldn't be a problem. If I had a ranger, I'd be happy to test your script for you, but that's one class I don't play.

stormtov
08-29-2008, 08:11 PM
Good call on shortening the match, works fine now. Next problem is i have no idea how to format the herb list, all i get is one big block of text.
====
--- Lich: sense active.
[sense]>sense
You scan your surroundings, considering the various flora and fauna found here (and noting those which are absent). The indications of the temperate climate and the cultivated environment are clearly evident to your seasoned eye. You also see a glaesine arch.
Roundtime: 6 sec.
HR>
[sense: Sovyn Clove Violet Genkew mushroom Spearmint Leaf Rose Amaranth Anenome Begonia Blaestoneberry Bougainvillea Clematis Daisy Foxglove Gardenia Honeysuckle Hosta Hydrangea Imeara's Lace Iris Jasmine Larkspur Lavender Mournbloom Peony Snapdragon Sunflower Tuberose Verbena Blue Trafel Mushroom Daggerstalk Mushroom Flathead Mushroom Soft White Mushroom Trollfear Mushroom (night) Withered Black Mushroom]
--- Lich: sense finished.
====
Does the job but kinda ugly.

May as well include the code in case it helps:
====
tempcult = "Sovyn Clove; Violet; Genkew mushroom; Spearmint Leaf; Rose; Amaranth; Anenome; Begonia; Blaestoneberry; Bougainvillea; Clematis; Daisy; Foxglove; Gardenia; Honeysuckle; Hosta; Hydrangea; Imeara's Lace; Iris; Jasmine; Larkspur; Lavender; Mournbloom; Peony; Snapdragon; Sunflower; Tuberose; Verbena; Blue Trafel Mushroom; Daggerstalk Mushroom; Flathead Mushroom; Soft White Mushroom; Trollfear Mushroom (night); Withered Black Mushroom;".split(";")

put "sense"

condition1, condition2 = matchfind "The indications of the ? climate and the ? environment are clearly evident to your seasoned eye."

if condition1 == "temperate" and condition2 == "cultivated"
echo "#{tempcult}"
end

Imperarx
08-30-2008, 12:45 AM
what are you looking for, for each herb to be on a separate line? Tell me something more about how you'd like it to look, and I think we can get it to show up the way you want.

stormtov
08-30-2008, 08:42 AM
Just listing them would be better then what they are now but preferably if they could be done in several aligned columns that would be much better(kinda like the format names get listed in who you use the "who" command in game).