Elanthipedia Items (script)

From Elanthipedia
Revision as of 13:34, 28 April 2013 by ISHARON (talk | contribs)
Jump to navigation Jump to search
Elanthipedia Items (script)
Category information
Front-end Genie
Author Isharon


This script creates Elanthipedia forms for weapons, shields, armor, and items that you appraise in shops. The results are both echoed to the game window and logged to the Appraisal file in Genie's Logs folder.

This script is intended for experienced Elanthipedia contributors only. The forms that are created by this script often require some manual editing. (See below for details.) Please check for errors before posting them to Elanthipedia.

Field values are not defined unless you are "certain" about the stat that you are appraising.

Instructions

Syntax

.ELANTH [ITEM NOUN]: You must type the entire noun. (For example, if you're appraising a greatsword, you must type greatsword; greats wouldn't work.)

When the script loads, it will send shop $shopv to check the surface that the item is on. (This is not required, but I find it helpful.) A menu will then prompt you to select the type of item you're appraising:

  1. Weapon: Melee/Thrown: most weapons (except types 2-5)
  2. Weapon: Ranged: bows, crossbows, and slings
  3. Weapon: Ammunition: for bows, crossbows, and slings
  4. Weapon: Brawling: worn brawling gear (excluding parry sticks)
  5. Weapon: Parry Stick
  6. Shield
  7. Armor/Barding
  8. Item: all other items


Required Genie Settings

You must install and use this alias to set the shop surface variable.

#alias {aps} {appraise $0 $preposition $shop quick}
#alias {es} {.eshop $0}
#alias {sh} {shop $0 on $shop}
#alias {sha} {shop $0 on $shop;appraise $0 on $shop careful}
#alias {shs} {shop;shop $shop}
#alias {sv} {#var shop $0}


The "shop surface" is the thing on which the item is placed (for example, table, second rack, or oak shelf). Every time you change shop surfaces (via the sv alias), you need to use the shs alias to set the preposition.


You must install these triggers to set the currency variable. (Appraise something once to set it.)

#trigger {^You .+ worth .+ dokoras} {#var currency Dokoras}
#trigger {^You .+ worth .+ kronars} {#var currency Kronars}
#trigger {^You .+ worth .+ lirums} {#var currency Lirums}

You must install these triggers to set the preposition variable. (Use the shs alias to set it every time you change shop surfaces.)

#trigger {^Behind .+, you see:$} {#var preposition behind}
#trigger {^In .+, you see:$} {#var preposition in}
#trigger {^On .+, you see:$} {#var preposition on}
#trigger {^Under .+, you see:$} {#var preposition under}

If you want to hear the sound effect, you need to download my sounds.

Sample Usage (Walkthrough)

Running the Script

> shop
The following items contain goods for sale:

an antique fretwork table
a huge cedar rack
a birch pedestal
an iron hook

The item that you want to appraise is on the cedar rack, so you type sv cedar rack to set the shop surface variable. (You won't see anything when you do this.)

Then you type shs to set the preposition variable (so the script knows whether to look on, in, or under the rack).

> shs
On the cedar rack, you see:

  a silver-bladed scimitar with a hilt wrapped in midnight-blue scaled leather for 13530 copper Dokoras
  a morning star studded with Adan'f tail barbs for 10824 copper Dokoras
  a granite mace sculpted like a gaunt greenish fist for 4510 copper Dokoras
  an oaken impalement stake branded with viperous coils for 9020 copper Dokoras
  a golden-bladed scimitar with a hilt wrapped in metallic-red scaled leather for 13530 copper Dokoras
  a dark crimson sword etched with spidery lightning for 8118 copper Dokoras
  a twisted black horn for 8118 copper Dokoras
  a serrated bone-white scythe hung with a pair of sluagh claws for 63140 copper Dokoras
  a steel jambiya with a hilt wrapped in membranous kartais wing for 36080 copper Dokoras
  a holy water sprinkler studded with stony basilisk fangs for 99220 copper Dokoras
  some silver-blue scythewing moth handwraps for 72160 copper Dokoras

You want to appraise the holy water sprinkler studded with stony basilisk fangs, so you type .elanth sprinkler to run the script.

ITEM TYPE:

1:	Weapon: Melee/Thrown

2:	Weapon: Ranged

3:	Weapon: Ammunition

4:	Weapon: Brawling

5:	Weapon: Parry Stick

6:	Shield

7:	Armor/Barding

8:	Item

The sprinkler is a melee weapon, so you enter 1. The script taps, shops, and appraises the sprinkler:

tap first sprinkler on cedar rack
You tap a holy water sprinkler studded with stony basilisk fangs atop a huge cedar rack.

> shop first sprinkler on cedar rack
Short: a holy water sprinkler
Cost:  99220 Dokoras
Read:  There is nothing there to read.
Look:  The holy water sprinkler resembles a steel flail, with its sturdy shaft and depending spiked ball and chain.

You can buy this item if you like.

> appraise first sprinkler on cedar rack careful
A holy water sprinkler studded with stony basilisk fangs is a two-handed blunt melee-ranged weapon.

You are certain that it could do:
  poor puncture damage
  poor slice damage
  very great impact damage

You are certain that the sprinkler is dismally balanced and is soundly suited to gaining extra attack power from your strength.

You are certain that the holy water sprinkler is of average construction, and is in pristine condition.

The holy water sprinkler is made with metal.
You are certain that the holy water sprinkler weighs exactly 56 stones.
You are certain that the holy water sprinkler is worth exactly 99220 dokoras.
Roundtime: 16 seconds.

And generates this Elanthipedia item form:

http://www.elanthipedia.com/wiki/Weapon:holy water sprinkler studded with stony basilisk fangs&action=edit
{{Weapon
|name=holy water sprinkler studded with stony basilisk fangs
|newapp=yes
|noun=sprinkler
|look=The holy water sprinkler resembles a steel flail, with its sturdy shaft and depending spiked ball and chain.
<br>'''Read''': There is nothing there to read.
|MTag=DELETE,DELETE,steel,DELETE,DELETE
|CTag=DELETE,DELETE,DELETE,DELETE,DELETE,DELETE,DELETE,DELETE,DELETE
|STag=DELETE,DELETE,basilisk,DELETE,water,DELETE,DELETE
|range=melee
|type=2HB
|type2=NOT SET
|puncture=poor
|slice=poor
|impact=very great
|balance=dismally
|suitedness=soundly
|construction=average construction
|metal=yes
|weight=56
|appcost=137,500
|wearloc=-
|sourcetype=-
|maxcharge=DELETE THIS LINE
|special=NOT SET
}}

Editing the Item Form

See Fields That Require Manual Editing (below) for details about required edits.

The URL at the top of the form is not actually part of the item page. It's there for your convenience. Copy and paste it into your browser to go to the edit page for the holy water sprinkler studded with stony basilisk fangs.

Everything that says "DELETE" in the form needs to be deleted. Those fields were not used for this item.

{{Weapon
|name=holy water sprinkler studded with stony basilisk fangs
|newapp=yes
|noun=sprinkler
|look=The holy water sprinkler resembles a steel flail, with its sturdy shaft and depending spiked ball and chain.
<br>'''Read''': There is nothing there to read.
|MTag=steel
|CTag=
|STag=basilisk,water
|range=melee
|type=2HB
|type2=NOT SET
|puncture=poor
|slice=poor
|impact=very great
|balance=dismally
|suitedness=soundly
|construction=average construction
|metal=yes
|weight=56
|appcost=137,500
|wearloc=-
|sourcetype=-
}}

You also need to delete any fields that were not set.

{{Weapon
|name=holy water sprinkler studded with stony basilisk fangs
|newapp=yes
|noun=sprinkler
|look=The holy water sprinkler resembles a steel flail, with its sturdy shaft and depending spiked ball and chain.
<br>'''Read''': There is nothing there to read.
|MTag=steel
|CTag=
|STag=basilisk,water
|range=melee
|type=2HB
|puncture=poor
|slice=poor
|impact=very great
|balance=dismally
|suitedness=soundly
|construction=average construction
|metal=yes
|weight=56
|appcost=137,500
|wearloc=-
|sourcetype=-
}}

Now that the form has been cleaned up, it's time to put on the finishing touches so that it complies with Elanthipedia standards.

  1. Since the name= field is exactly the same as the page name, delete that. If the name had been capitalized in an unusual way (such as mammoth Botolf war icon set atop a bloodstained haft of hickory), you would have left the name= field in place.
  2. This item doesn't have a read, so delete that line.
  3. Now for the tags. These are used with Elanthipedia's search function, so it's nice if they are filled out. The script recognized that this item contains steel, so it added that for you. However, it's also made of basilisk fangs, so add that. (Note: just use the singular, even if the description calls for more than one of that material.) The order of these tags does not matter.
  4. CTags are for colors. This item doesn't mention any colors, so delete that.
  5. STags are for symbols. This item doesn't really have any symbols, even though it says STag=basilisk,water. (If a material name is often used as a symbol, it may be marked in this field.) Delete that line.
  6. The shop name must be changed to whatever the Elanthipedia article for that shop is called. In this case, that's Misenseor Goods (4). (This item was also sold at previous versions of this shop, but for the sake of simplicity, we'll just use Misenseor Goods (4) in this demonstration.)

Now your form is ready for Elanthipedia. Copy and paste it to the edit page in your browser, and click "Save page."

{{Weapon
|newapp=yes
|noun=sprinkler
|look=The holy water sprinkler resembles a steel flail, with its sturdy shaft and depending spiked ball and chain.
|MTag=steel,basilisk fang,fang
|range=melee
|type=2HB
|puncture=poor
|slice=poor
|impact=very great
|balance=dismally
|suitedness=soundly
|construction=average construction
|metal=yes
|weight=56
|appcost=137,500
|wearloc=-
|sourcetype=-
}}

Working More Efficiently

You may be wondering if using this script is worth the effort. Having done my share of manual item additions, I can say that this is a big time saver. It also reduces human error on item stats. However, editing item forms is still a little work, especially if you do the MTags, CTags, and STags.

One way to speed up this process is to edit these forms in batch. Instead of appraising one item, editing the form, and then posting that item, appraise all of the items that you want to appraise in the shop and then edit your Appraisal log file. Use the find and replace function (usually Ctrl+H) to delete or edit multiple lines at once.

I recommend using Notepad++ for this, because it also supports regular expressions. You can also make your own macros and add your own shortcut keys.

Changelog

4/28/2013

  • Updated item types and sources to work with the new item template.

4/27/2013

  • Added recognition of Elothean (Asian) clothing.

11/18/2012

  • Added recognition of more item types.
  • Added recognition of more materials.

11/10/2012

  • Added recognition of more item types; shortened pauses by half a second.

11/4/2012

  • Added auto-recognition of Trader "appraisal" items.

5/19/2012

  • Added more item types.
  • Added more metatags.

5/16/2012

  • Fixed bug that prevented taps from being set on items "atop several" surfaces.

5/15/2012

  • Added more item types.
  • Added more recognition of racially named items.
  • Added more metatags.

5/13/2012

  • Added more MTags.
  • Fixed some false matches with colors, materials, and symbols.

5/4/2012

  • The script now supports the new shield hindrance and protection appraisals. Note: If you fail to get the more detailed "Paladin appraisal" (indicated by the "Your experience with shields allows a better appraisal of the protection capabilities" message), the script will not set the shield protection values and will flag the page as outdated. Please do not change this.

4/28/2012

  • Added support for Elanthipedia's new "itype" field. (This field is used to distinguish between items with the same noun.)
  • Added more recognition of item types, particularly for racial items.
  • Fixed a few bugs in item types.

4/27/2012

  • Added more recognition of item, weapon, and shield types.
  • Added more MTags and STags.
  • Fixed a few bugs in CTags and item types.

4/21/2012

  • Changed URLs from elanthipedia.com to elanthipedia.org.

1/4/2012

  • Added support for more recognition of item types.

11/14/2011

  • Added support for items on the surface. (This was preventing certain taps from being read.)

11/12/2011

  • Added more recognition of item and weapon types.
  • Added more MTags and STags.
  • Added sound effect to the end of the script.

11/9/2011

  • Added support for items that are behind a shop surface.

11/5/2011

  • Fixed some tags.
  • Added new CTag.
  • Added support for non-Kronar appraisal values.

11/4/2011

  • Added new MTags.

11/2/2011

  • Added more recognition of clothing.

09/24/2011

  • Added support for tack and barding.
  • Added two new MTag woods.

07/18/2011

  • Changed newapp=yes to newarmorapp=yes in the shield section to work with Elanthipedia's new shield template. (If you use newapp=yes for shields, Elanthipedia will think that the appraisal includes the new construction range but not the new hindrance range.)
  • Fixed shield appraisals to work with the new hindrance scale.

07/17/2011

  • Changed newapp=yes to newarmorapp=yes in the armor section to work with Elanthipedia's new armor template. (If you use newapp=yes for armor, Elanthipedia will think that the appraisal includes the new construction range but not the new protection, absorption, and hindrance ranges.)

07/02/2011

  • Added a new MTag fabric.
  • Fixed bugs with MTags and CTags.

07/01/2011

  • Added more MTag fabrics.
  • Added support for variable colors (for example, X-hued).
  • Added more CTags.
  • Added more STags.

06/29/2011

  • Fixed a bug with MTag fabrics.
  • Fixed a bug with CTags.

06/26/2011

  • Fixed a bug in the price and appraisal sections that was caused by the way Notepad++ deleted extra line breaks.
  • Script now always recognizes when armor absorption values are not equal.

06/20/2011

  • Added support for more MTags, CTags, and STags.

06/16/2011

  • Added support for more MTags, CTags, STags, and item/special types.

06/05/2011

  • Added support for more MTags, CTags, STags, and item/special types.

05/23/2011

  • The script now uses triggers to set the currency and preposition variables.
  • Added support for more MTags, CTags, STags, item/special types.

05/21/2011

  • Added support for more MTags, CTags, STags, item/special types.
  • Cambrinth type will now set even when you fail to appraise the exact amount of mana.

05/20/2011

  • Added support for special types (combat equipment).

05/19/2011

  • Added more MTags, CTags, and STags.
  • Improved output for item reads.

05/18/2011

  • Fixed bug that prevented item types from being set to "cambrinth."
  • Script fills out "area" field for armor.
  • Script fills out some MTags, CTags, and STags.

05/17/2011

  • Added support for instrument types.
  • Script now recognizes when all armor absorption values are equal.

05/16/2011

  • Added support for more fluff item types.

05/15/2011

  • Fixed some bugs with fluff item types.

04/26/2011

  • The script now includes the Elanthipedia URL for each item (assuming that the tap is the same as the page name).

04/18/2011

  • The "Appraisal" log is now saved as a text file.

04/14/2011

  • The script now recognizes appraisal values of 1 Kronar.

04/05/2011

  • The script now sets gem pouch appraisal values to 0.

04/04/2011

  • added "the" as a leading article (to be omitted from page names)
  • fixed a bug that prevented recognition of some weapon types

03/20/2011: The script has the following new features:

  • adds commas to costs and appraisal values
  • adds the currency to the cost field (requires the script above)
  • equipment construction values don't need to be edited to make them consistent with Elanthipedia's template
  • recognizes gaethzen as a type of fluff item
  • recognizes many common guild and race styles for fluff items

Fields That Require Manual Editing

Name

Delete this field unless the item tap differs from the page name (for example, in capitalization).

Quotation marks are removed by Genie, so be sure to supply them if the tap contains quotation marks.

Missing Data

Some fields that the script can't fill are left as placeholders for your convenience.

Likewise, any field with a DELETE or % in the result has not been filled by the script. (These fields are in the script, because the script sometimes has values for them.) These fields should be deleted unless you know the appropriate value.


Look/Read

Delete this line: <br>'''Read''': There is nothing there to read.
(It is only used if there is an actual read.)

Quotation marks are removed by Genie, so be sure to supply them if the look contains quotation marks.

Metatags

If there is more than one match for the same category, it will add the last match. I made the shorter words match first, which causes the script to match the longest, most specific version (e.g., glacier emerald instead of emerald).

If a match is appears in both the tap and the look, the script will use the one in the tap.

You can manually add additional tags.

If a category is not set, it will say DELETE.

MTags

The script will add up to five different material tags (one per category). The categories are:

  1. mtags: special/magical properties (e.g., chakrel and soulstones).
  2. mtagg: stones (including gems)
  3. mtagm: metals
  4. mtagw: wood
  5. mtagf: fabrics/textiles and leather

CTags

The script will add up to eight different color tags (one per category). The categories are:

  1. ctagr: shades of red
  2. ctago: shades of orange
  3. ctagy: shades of yellow
  4. ctagg: shades of green
  5. ctagb: shades of blue
  6. ctagv: shades of violet
  7. ctagn: shades of grey (including black and white)
  8. ctagm: rainbow/multicolored

STags

The script will add up to seven different symbol tags (one per category). The categories are:

  1. stagp: profession/guild
  2. stagg: gods/Immortals
  3. staga: animals and mythical creatures
  4. stagh: healing herbs
  5. stage: elements
  6. stagr: races
  7. stagl: locations and heavenly bodies

Item Types

The script will add up to seven different item types (one per category). The categories are:

  1. typefunction: the item's basic function, such as clothing, jewelry, crafting, and instruments.
  2. typecon: for containers and pocketed items
  3. typemagic: cambrinth, gaethzen, and some other magic
  4. typeguild: items with obvious guild functions or styles
  5. typerace: items with obvious race functions or styles

If a type category is not set, it will say DELETE.


Ticket Prices

If the price is in tickets, you need to add the word "Tickets" after the price. For example:

{{ShopItem|t=w|throwing dagger with a buzzard hilt|2 Tickets}}

Swappable Weapons

This script supports thrown weapons, but it does not fully support swappable weapons, such as bastard swords. (It will only generate the damage and balance/power fields for one side of the weapon.)

The easiest way to handle this situation is to let the form supply the one side's values, save changes, and click the "edit with form" button to supply the other side's values.

Brawling Weapons

Replace "quite a bit of" with "quite a bit."

Shields

If you fail to get the more detailed "Paladin appraisal" (indicated by the "Your experience with shields allows a better appraisal of the protection capabilities" message), the script will not set the shield protection values and will flag the page as outdated. Please do not change this.

Armor/Barding

Armor

area: This field is defined by the script, but you need to delete the word(s) DELETE from the "area" field.

Absorption: The absorption fields are filled out twice, and some values need to be deleted.

For most armor, absorption is the same for all damage types. When this is the case, keep the absorbance field and delete the following fields:

  • |punctureab=
  • |sliceab=
  • |impactab=
  • |fireab=
  • |coldab=
  • |electricab=


If absorption values are not the same for every damage type, the script output will be |absorbance=VALUES NOT EQUAL. Delete the absorbance field and use the six specific values (punctureab=, sliceab=, etc.) instead.

Barding

Stats: Barding (horse armor) appraisals do not include most of the standard armor stats, so there are several unset variables. Delete the lines for hindrance, protection, and absorption. (Keep construction.)

Weight: There is no information about weight when appraising barding in shops, so the weight variable will not be set. Delete the weight line.

Coverage areas: The coverage areas of "arms" and "legs" are correct. Elanthipedia will automatically display "front legs" and "rear legs" if you have the special type set to tack. (The script does this for you.)

Script

put #class rp on
put #class combat off
put #class arrive off

var source $roomname
var appcostl 0
var appcostd 0
var newshieldapp no
action goto end when ^I could not find what (you|you were) referring to\.$
var numbers first|second|third|fourth|fifth|sixth|seventh|eighth|ninth|tenth|eleventh
var numbers.index 0

action setvariable tap $2 when ^You tap (a|an|some|the) (.+) (atop|behind|inside|under) (an?|several|\bsome\b|\bthe\b|\btwo\b)
action setvariable short $2 when ^Short: (a|an|some|the) (.+)
action setvariable look $1 when ^Look:  (.+)
action setvariable look - when ^Look:  You see nothing unusual\.$
action setvariable read $1 when ^Read:\s+(.+)$
action setvariable typefunction tack when ^This is specifically designed to be worn by a horse\.$
action setvariable special tack when ^This is specifically designed to be worn by a horse\.$
action setvariable typecon container when ^The .+ (are|is) a container, and can be opened and closed\.$
action setvariable typecon container when ^The .+ (are|is) a container\.$
action setvariable typecon container when ^The .+ (are|is) pocketed, and can be opened and closed\.$
action setvariable typecon container when ^The .+ (are|is) pocketed\.$
action setvariable typecon container when ^The gem pouch is made for easy storage of gems
action setvariable typeguild trader style when ^The .+ (are|is) obviously a specially made item\.$
action setvariable special trader style when ^The .+ (are|is) obviously a specially made item\.$
action setvariable wearloc $2 when ^It appears that .+ can be worn (around|in|on) the (.+)\.$
action setvariable wearloc $1 when ^It appears that .+ can be draped over the (.+)\.$
action setvariable wearloc generic when ^It appears that .+ can be worn\.$
action setvariable wearloc belt when ^It appears that .+ can be worn attached to a belt\.$
action setvariable wearloc belt when ^The gem pouch is made for easy storage of gems
action setvariable wearloc ear when ^It appears that .+ can be worn in one ear
action setvariable wearloc ears when ^It appears that .+ can be worn in both ears
action setvariable wearloc hair (placed) when ^It appears that .+ can be worn in the hair\.$
action setvariable wearloc pants when ^It appears that .+ can be worn like pants or a skirt\.$
action setvariable wearloc shirt+ when ^It appears that .+ can be worn as a shirt or robe, even with armor\.$
action setvariable wearloc shirt- when ^It appears that .+ can be worn like a shirt or robe\.$
action setvariable wearloc shoulder when ^It appears that .+ can be slung over one shoulder\.$
action setvariable weight $1 when ^You are certain that .+ weighs exactly (\d+) (stones?)\.$
action setvariable lsize $1;setvariable wsize $2;setvariable hsize $3 when ^You compare your .+ with the .+ yardstick several times and are certain the length measures (\w+) spans?, the width measures (\w+) spans? and the height measures (\w+) spans?\.$
action setvariable ilsize $1;setvariable iwsize $2;setvariable ihsize $3;setvariable csize $4 when ^You compare your .+ with the .+ yardstick several times and are certain the interior length measures (\w+) spans?, the interior width measures (\w+) spans?, the interior height measures (\w+) spans? and the .+ appears capable of holding about (\d+) stones of weight\.$
action setvariable appcostk $2 when ^You are certain that .+ (is|are) worth exactly (\d+) kronars\.$
action setvariable appcostk 1 when ^You are certain that .+ (is|are) worth exactly 1 kronar\.$
action setvariable appcostk 0 when ^You are certain that .+ (is|are) worth exactly nothing\.$
action setvariable appcostk 0 when ^There doesn't appear to be anything in the gem pouch\.$
action setvariable appcostl $2 when ^You are certain that .+ (is|are) worth exactly (\d+) lirums\.$
action setvariable appcostl 1 when ^You are certain that .+ (is|are) worth exactly 1 lirum\.$
action setvariable appcostd $2 when ^You are certain that .+ (is|are) worth exactly (\d+) dokoras\.$
action setvariable appcostd 1 when ^You are certain that .+ (is|are) worth exactly 1 dokora\.$
action setvariable costi $1 when ^Cost:  (\d+)
action setvariable maxcharge $1 when ^You are certain that the .+ holds? exactly (\d+) mana\.$
action setvariable metal yes when ^The .+ (is|are) made with metal\.$

action setvariable wtype1 LE when (is a|are a|and) light edged .+ weapon
action setvariable wtype1 ME when (is a|are a|and) medium edged .+ weapon
action setvariable wtype1 HE when (is a|are a|and) heavy edged .+ weapon
action setvariable wtype1 2HE when (is a|are a|and) two-handed edged .+ weapon
action setvariable wtype1 LB when (is a|are a|and) light blunt .+ weapon
action setvariable wtype1 MB when (is a|are a|and) medium blunt .+ weapon
action setvariable wtype1 HB when (is a|are a|and) heavy blunt .+ weapon
action setvariable wtype1 2HB when (is a|are a|and) two-handed blunt .+ weapon
action setvariable wtype1 SL when (is|are) a sling .+ weapon
action setvariable wtype1 StS when (is|are) a staff sling .+ weapon
action setvariable wtype1 SB when (is|are) a short bow .+ weapon
action setvariable wtype1 LoB when (is|are) a long bow .+ weapon
action setvariable wtype1 CB when (is|are) a composite bow .+ weapon
action setvariable wtype1 LX when (is|are) a light crossbow .+ weapon
action setvariable wtype1 HX when (is|are) a heavy crossbow .+ weapon
action setvariable wtype1 SS when (is a|are a|and) short staff .+ weapon
action setvariable wtype1 QS when (is a|are a|and) quarter staff .+ weapon
action setvariable wtype1 PI when (is a|are a|and) pike .+ weapon
action setvariable wtype1 HAL when (is a|are a|and) halberd .+ weapon
action setvariable wtype2 LT when (is|are) a light thrown and .+ weapon
action setvariable wtype2 HT when (is|are) a heavy thrown and .+ weapon

action setvariable range melee when melee-ranged weapon
action setvariable range pole when pole-ranged weapon
action setvariable puncture $1 when ^\s+(.*) puncture damage
action setvariable slice $1 when ^\s+(.*) slice damage
action setvariable impact $1 when ^\s+(.*) impact damage
action setvariable puncturetype Yes when ^\s+(.*) puncture damage increase
action setvariable slicetype Yes when ^\s+(.*) slice damage increase
action setvariable impacttype Yes when ^\s+(.*) impact damage increase
action setvariable balance $1 when .+ is (.*) balanced
action setvariable power $1 when .+ is (.*) suited

action setvariable stype lsh when is large in size\.$
action setvariable stype msh when is medium in size\.$
action setvariable stype ssh when is small in size\.$
action setvariable newshieldapp yes when ^Your experience with shields allows a better appraisal of the protection capabilities\.$
action setvariable sprotection $1 when .+ offers (.*) protection
action setvariable smin $1 when ^You are certain that .+ offers (.*) to .+ protection\.
action setvariable smax $1 when ^You are certain that .+ offers .+ to (.*) protection\.
action setvariable shindrance $1 when .+ it imposes? (.*) maneuvering hindrance.

action setvariable atype cloth armor when (is|are) cloth armor\.$|cloth\.$
action setvariable atype leather armor when (is|are) leather armor\.$
action setvariable atype bone armor when (is|are) bone armor\.$
action setvariable atype light chain when (is|are) light chain\.$
action setvariable atype heavy chain when (is|are) heavy chain\.$
action setvariable atype light plate when (is|are) light plate\.$
action setvariable atype heavy plate when (is|are) heavy plate\.$
action setvariable abpuncture $1 when .+ \s(.*) for puncture attacks
action setvariable abslice $1 when .+ \s(.*) for slice attacks
action setvariable abimpact $1 when .+ \s(.*) for impact attacks
action setvariable abfire $1 when .+ \s(.*) for fire attacks
action setvariable abcold $1 when .+ \s(.*) for cold attacks
action setvariable abelectrical $1 when .+ \s(.*) for electrical attacks
action setvariable appuncture $1 when .+ \s(.*) protection and .+ damage absorption for puncture attacks
action setvariable apslice $1 when .+ \s(.*) protection and .+ damage absorption for slice attacks
action setvariable apimpact $1 when .+ \s(.*) protection and .+ damage absorption for impact attacks
action setvariable apfire $1 when .+ \s(.*) protection and .+ damage absorption for fire attacks
action setvariable apcold $1 when .+ \s(.*) protection and .+ damage absorption for cold attacks
action setvariable apelectrical $1 when .+ \s(.*) protection and .+ damage absorption for electrical attacks
action setvariable aapuncture $1 when .+ protection and (.*) damage absorption for puncture attacks
action setvariable aaslice $1 when .+ protection and (.*) damage absorption for slice attacks
action setvariable aaimpact $1 when .+ protection and (.*) damage absorption for impact attacks
action setvariable aafire $1 when .+ protection and (.*) damage absorption for fire attacks
action setvariable aacold $1 when .+ protection and (.*) damage absorption for cold attacks
action setvariable aaelectrical $1 when .+ protection and (.*) damage absorption for electrical attacks
action setvariable ahindrance $1 when .+ appears? to impose (.*), offering
action setvariable mhindrance $1 when .+ appears? to impose (.*) maneuvering hindrance and
action setvariable shindrance $1 when .+ appears? to impose .+ maneuvering hindrance and (.*) stealth hindrance
action setvariable ahead head when ^\s+head$
action setvariable aeyes eyes when ^\s+right eye$
action setvariable aneck neck when ^\s+neck$
action setvariable achest chest when ^\s+chest$
action setvariable aback back when ^\s+back$
action setvariable aabdomen abdomen when ^\s+abdomen$
action setvariable aarms arms when ^\s+right arm$
action setvariable aarms arms when ^\s+right front leg$
action setvariable alegs legs when ^\s+right leg$
action setvariable alegs legs when ^\s+right rear leg$
action setvariable ahands hands when ^\s+right hand$

action setvariable construction $2 when ^You are certain that the .+ (is|are) (.*) (against|to) damage, and
action setvariable construction extremely weak when ^You are certain that the .+ (is|are) extremely weak, and
action setvariable construction very delicate when ^You are certain that the .+ (is|are) very delicate, and
action setvariable construction quite fragile when ^You are certain that the .+ (is|are) quite fragile, and
action setvariable construction rather flimsy when ^You are certain that the .+ (is|are) rather flimsy, and
action setvariable construction particularly weak when ^You are certain that the .+ (is|are) particularly weak, and
action setvariable construction average construction when ^You are certain that the .+ (is|are) of average construction, and
action setvariable construction very strong when ^You are certain that the .+ (is|are) very strong, and

echo
echo ITEM TYPE:
echo
echo 1:	Weapon: Melee/Thrown
echo
echo 2:	Weapon: Ranged
echo
echo 3:	Weapon: Ammunition
echo
echo 4:	Weapon: Brawling
echo
echo 5:	Weapon: Parry Stick
echo
echo 6:	Shield
echo
echo 7:	Armor/Barding
echo
echo 8:	Item
echo
echo Enter Type Number:

matchre WeaponApp1 ^1
matchre WeaponApp2 ^2
matchre WeaponApp3 ^3
matchre WeaponApp4 ^4
matchre WeaponApp5 ^5
matchre ShieldApp ^6
matchre ArmorApp ^7
matchre ItemApp ^8
matchwait

WeaponApp1:
var number %numbers(%numbers.index)
gosub AppraiseWeapon1
math numbers.index add 1
if %numbers.index > 11 then goto end
goto WeaponApp1

WeaponApp2:
var number %numbers(%numbers.index)
gosub AppraiseWeapon2
math numbers.index add 1
if %numbers.index > 11 then goto end
goto WeaponApp2

WeaponApp3:
var number %numbers(%numbers.index)
gosub AppraiseWeapon3
math numbers.index add 1
if %numbers.index > 11 then goto end
goto WeaponApp3

WeaponApp4:
var number %numbers(%numbers.index)
gosub AppraiseWeapon4
math numbers.index add 1
if %numbers.index > 11 then goto end
goto WeaponApp4

WeaponApp5:
var number %numbers(%numbers.index)
gosub AppraiseWeapon5
math numbers.index add 1
if %numbers.index > 11 then goto end
goto WeaponApp5

ShieldApp:
var number %numbers(%numbers.index)
gosub AppraiseShield
math numbers.index add 1
if %numbers.index > 11 then goto end
goto ShieldApp

ArmorApp:
var number %numbers(%numbers.index)
gosub AppraiseArmor
math numbers.index add 1
if %numbers.index > 11 then goto end
goto ArmorApp

ItemApp:
var number %numbers(%numbers.index)
gosub AppraiseItem
math numbers.index add 1
if %numbers.index > 11 then goto end
goto ItemApp

number1:
var number first
return
number2:
var number second
return
number3:
var number third
return
number4:
var number fourth
return
number5:
var number fifth
return
number6:
var number sixth
return
number7:
var number seventh
return
number8:
var number eighth
return
number9:
var number ninth
return
number10:
var number tenth
return
number11:
var number eleventh
return

AppraiseWeapon1:
gosub VarBlank
pause 1
send tap %number %1 $preposition $shop
waitforre ^You
send shop %number %1 $preposition $shop
waitforre ^Short:
send appraise %number %1 $preposition $shop careful
wait
pause .5
if %appcostl > 0 then evalmath appcostk round(%appcostl/0.8)
if %appcostd > 0 then evalmath appcostk round(%appcostd/0.7216)
gosub CommaAppcost
gosub CommaCost
gosub Tagset
gosub Specialset
gosub Itypeset
echo http://www.elanthipedia.org/wiki/Weapon:%tap&action=edit
echo
echo {{Weapon
echo |name=%tap
echo |newapp=yes
echo |noun=%1
echo |look=%look
echo <br>'''Read''': There is nothing there to read.
echo |MTag=%mtags,%mtagg,%mtagm,%mtagw,%mtagf
echo |CTag=%ctagr,%ctago,%ctagy,%ctagg,%ctagb,%ctagv,%ctagn,%ctagm,%ctagx
echo |STag=%stagp,%stagg,%staga,%stagh,%stage,%stagr,%stagl
echo |range=%range
echo |type=%wtype1
echo |type2=%wtype2
echo |puncture=%puncture
echo |slice=%slice
echo |impact=%impact
echo |balance=%balance
echo |suitedness=%power
echo |construction=%construction
echo |metal=%metal
echo |weight=%weight
echo |lsize=%lsize
echo |wsize=%wsize
echo |hsize=%hsize
echo |appcost=%appcost
echo |wearloc=%wearloc
echo |sourcetype=-
echo |maxcharge=%maxcharge
echo |special=%special
echo |itype=%itype
echo }}
put #log >Appraisal.txt http://www.elanthipedia.org/wiki/Weapon:%tap&action=edit
put #log >Appraisal.txt {{Weapon
put #log >Appraisal.txt |name=%tap
put #log >Appraisal.txt |newapp=yes
put #log >Appraisal.txt |noun=%1
put #log >Appraisal.txt |look=%look
put #log >Appraisal.txt <br>'''Read''': There is nothing there to read.
put #log >Appraisal.txt |MTag=%mtags,%mtagg,%mtagm,%mtagw,%mtagf
put #log >Appraisal.txt |CTag=%ctagr,%ctago,%ctagy,%ctagg,%ctagb,%ctagv,%ctagn,%ctagm,%ctagx
put #log >Appraisal.txt |STag=%stagp,%stagg,%staga,%stagh,%stage,%stagr,%stagl
put #log >Appraisal.txt |range=%range
put #log >Appraisal.txt |type=%wtype1
put #log >Appraisal.txt |type2=%wtype2
put #log >Appraisal.txt |puncture=%puncture
put #log >Appraisal.txt |slice=%slice
put #log >Appraisal.txt |impact=%impact
put #log >Appraisal.txt |balance=%balance
put #log >Appraisal.txt |suitedness=%power
put #log >Appraisal.txt |construction=%construction
put #log >Appraisal.txt |metal=%metal
put #log >Appraisal.txt |weight=%weight
put #log >Appraisal.txt |lsize=%lsize
put #log >Appraisal.txt |wsize=%wsize
put #log >Appraisal.txt |hsize=%hsize
put #log >Appraisal.txt |appcost=%appcost
put #log >Appraisal.txt |wearloc=%wearloc
put #log >Appraisal.txt |sourcetype=-
put #log >Appraisal.txt |maxcharge=%maxcharge
put #log >Appraisal.txt |special=%special
put #log >Appraisal.txt |itype=%itype
put #log >Appraisal.txt }}
put #log >Appraisal.txt
return

AppraiseWeapon2:
gosub VarBlank
pause 1
send tap %number %1 $preposition $shop
waitforre ^You
send shop %number %1 $preposition $shop
waitforre ^Short:
send appraise %number %1 $preposition $shop careful
wait
pause .5
if %appcostl > 0 then evalmath appcostk round(%appcostl/0.8)
if %appcostd > 0 then evalmath appcostk round(%appcostd/0.7216)
gosub CommaAppcost
gosub CommaCost
if (matchre ("%wtype1", "(SB|LoB|CB)")) then var ammo arrow
if (matchre ("%wtype1", "(LX|HX)")) then var ammo bolt
if (matchre ("%wtype1", "(SL|StS)")) then var ammo rock
if (matchre ("%wtype1", "(LT|HT)")) then var ammo thrown
gosub Tagset
gosub Specialset
gosub Itypeset
echo http://www.elanthipedia.org/wiki/Weapon:%tap&action=edit
echo
echo {{Weapon
echo |name=%tap
echo |newapp=yes
echo |noun=%1
echo |look=%look
echo <br>'''Read''': There is nothing there to read.
echo |MTag=%mtags,%mtagg,%mtagm,%mtagw,%mtagf
echo |CTag=%ctagr,%ctago,%ctagy,%ctagg,%ctagb,%ctagv,%ctagn,%ctagm,%ctagx
echo |STag=%stagp,%stagg,%staga,%stagh,%stage,%stagr,%stagl
echo |range=ranged
echo |ammo=%ammo
echo |ammocap=
echo |rangedRT=
echo |type=%wtype1
echo |puncture=-
echo |balance=%balance
echo |suitedness=%power
echo |construction=%construction
echo |metal=%metal
echo |weight=%weight
echo |lsize=%lsize
echo |wsize=%wsize
echo |hsize=%hsize
echo |appcost=%appcost
echo |wearloc=%wearloc
echo |sourcetype=-
echo |maxcharge=%maxcharge
echo |special=%special
echo |itype=%itype
echo }}
put #log >Appraisal.txt http://www.elanthipedia.org/wiki/Weapon:%tap&action=edit
put #log >Appraisal.txt {{Weapon
put #log >Appraisal.txt |name=%tap
put #log >Appraisal.txt |newapp=yes
put #log >Appraisal.txt |noun=%1
put #log >Appraisal.txt |look=%look
put #log >Appraisal.txt <br>'''Read''': There is nothing there to read.
put #log >Appraisal.txt |MTag=%mtags,%mtagg,%mtagm,%mtagw,%mtagf
put #log >Appraisal.txt |CTag=%ctagr,%ctago,%ctagy,%ctagg,%ctagb,%ctagv,%ctagn,%ctagm,%ctagx
put #log >Appraisal.txt |STag=%stagp,%stagg,%staga,%stagh,%stage,%stagr,%stagl
put #log >Appraisal.txt |range=ranged
put #log >Appraisal.txt |ammo=%ammo
put #log >Appraisal.txt |ammocap=
put #log >Appraisal.txt |rangedRT=
put #log >Appraisal.txt |type=%wtype1
put #log >Appraisal.txt |puncture=-
put #log >Appraisal.txt |balance=%balance
put #log >Appraisal.txt |suitedness=%power
put #log >Appraisal.txt |construction=%construction
put #log >Appraisal.txt |metal=%metal
put #log >Appraisal.txt |weight=%weight
put #log >Appraisal.txt |lsize=%lsize
put #log >Appraisal.txt |wsize=%wsize
put #log >Appraisal.txt |hsize=%hsize
put #log >Appraisal.txt |appcost=%appcost
put #log >Appraisal.txt |wearloc=%wearloc
put #log >Appraisal.txt |sourcetype=-
put #log >Appraisal.txt |maxcharge=%maxcharge
put #log >Appraisal.txt |special=%special
put #log >Appraisal.txt |itype=%itype
put #log >Appraisal.txt }}
put #log >Appraisal.txt
return

AppraiseWeapon3:
gosub VarBlank
pause 1
send tap %number %1 $preposition $shop
waitforre ^You
send shop %number %1 $preposition $shop
waitforre ^Short:
send appraise %number %1 $preposition $shop careful
wait
pause .5
if %appcostl > 0 then evalmath appcostk round(%appcostl/0.8)
if %appcostd > 0 then evalmath appcostk round(%appcostd/0.7216)
gosub CommaAppcost
gosub CommaCost
if (matchre ("%1", "(arrows?)")) then var wtype1 arrow
if (matchre ("%1", "(bolts?|quadrellos?|quarrels?|pulzones?)")) then var wtype1 bolt
if (matchre ("%1", "(bullets?|clumps?|lumps?|pellets?|rocks?)")) then var wtype1 rock
gosub Tagset
gosub Specialset
gosub Itypeset
echo http://www.elanthipedia.org/wiki/Weapon:%tap&action=edit
echo
echo {{Weapon
echo |name=%tap
echo |newapp=yes
echo |noun=%1
echo |look=%look
echo <br>'''Read''': There is nothing there to read.
echo |MTag=%mtags,%mtagg,%mtagm,%mtagw,%mtagf
echo |CTag=%ctagr,%ctago,%ctagy,%ctagg,%ctagb,%ctagv,%ctagn,%ctagm,%ctagx
echo |STag=%stagp,%stagg,%staga,%stagh,%stage,%stagr,%stagl
echo |type=%wtype1
echo |puncture=%puncture
echo |slice=%slice
echo |impact=%impact
echo |balance=-
echo |construction=%construction
echo |metal=%metal
echo |weight=%weight
echo |lsize=%lsize
echo |wsize=%wsize
echo |hsize=%hsize
echo |appcost=%appcost
echo |wearloc=%wearloc
echo |sourcetype=-
echo |maxcharge=%maxcharge
echo |special=%special
echo |itype=%itype
echo }}
put #log >Appraisal.txt http://www.elanthipedia.org/wiki/Weapon:%tap&action=edit
put #log >Appraisal.txt {{Weapon
put #log >Appraisal.txt |name=%tap
put #log >Appraisal.txt |newapp=yes
put #log >Appraisal.txt |noun=%1
put #log >Appraisal.txt |look=%look
put #log >Appraisal.txt <br>'''Read''': There is nothing there to read.
put #log >Appraisal.txt |MTag=%mtags,%mtagg,%mtagm,%mtagw,%mtagf
put #log >Appraisal.txt |CTag=%ctagr,%ctago,%ctagy,%ctagg,%ctagb,%ctagv,%ctagn,%ctagm,%ctagx
put #log >Appraisal.txt |STag=%stagp,%stagg,%staga,%stagh,%stage,%stagr,%stagl
put #log >Appraisal.txt |type=%wtype1
put #log >Appraisal.txt |puncture=%puncture
put #log >Appraisal.txt |slice=%slice
put #log >Appraisal.txt |impact=%impact
put #log >Appraisal.txt |balance=-
put #log >Appraisal.txt |construction=%construction
put #log >Appraisal.txt |metal=%metal
put #log >Appraisal.txt |weight=%weight
put #log >Appraisal.txt |lsize=%lsize
put #log >Appraisal.txt |wsize=%wsize
put #log >Appraisal.txt |hsize=%hsize
put #log >Appraisal.txt |appcost=%appcost
put #log >Appraisal.txt |wearloc=%wearloc
put #log >Appraisal.txt |sourcetype=-
put #log >Appraisal.txt |maxcharge=%maxcharge
put #log >Appraisal.txt |special=%special
put #log >Appraisal.txt |itype=%itype
put #log >Appraisal.txt }}
put #log >Appraisal.txt
return

AppraiseWeapon4:
gosub VarBlank
pause 1
send tap %number %1 $preposition $shop
waitforre ^You
send shop %number %1 $preposition $shop
waitforre ^Short:
send appraise %number %1 $preposition $shop careful
wait
pause .5
if %appcostl > 0 then evalmath appcostk round(%appcostl/0.8)
if %appcostd > 0 then evalmath appcostk round(%appcostd/0.7216)
gosub CommaAppcost
gosub CommaCost
if (matchre ("%1", "(handwraps?|knuckleguards?|knuckles?)")) then var wtype1 hands
if (matchre ("%tap", "(elbow)")) then var wtype1 elbows
if (matchre ("%tap", "(knee)")) then var wtype1 knees
if (matchre ("%1", "(footwraps?)")) then var wtype1 feet
gosub Tagset
gosub Specialset
gosub Itypeset
echo http://www.elanthipedia.org/wiki/Weapon:%tap&action=edit
echo
echo {{Weapon
echo |name=%tap
echo |newapp=yes
echo |brawl=yes
echo |noun=%1
echo |look=%look
echo <br>'''Read''': There is nothing there to read.
echo |MTag=%mtags,%mtagg,%mtagm,%mtagw,%mtagf
echo |CTag=%ctagr,%ctago,%ctagy,%ctagg,%ctagb,%ctagv,%ctagn,%ctagm,%ctagx
echo |STag=%stagp,%stagg,%staga,%stagh,%stage,%stagr,%stagl
echo |type=%wtype1
echo |puncture=%puncture
echo |puncturetype=yes
echo |slice=%slice
echo |slicetype=yes
echo |impact=%impact
echo |impacttype=yes
echo |balance=-
echo |construction=%construction
echo |metal=%metal
echo |weight=%weight
echo |lsize=%lsize
echo |wsize=%wsize
echo |hsize=%hsize
echo |appcost=%appcost
echo |sourcetype=-
echo |maxcharge=%maxcharge
echo |special=%special
echo |itype=%itype
echo }}
put #log >Appraisal.txt http://www.elanthipedia.org/wiki/Weapon:%tap&action=edit
put #log >Appraisal.txt {{Weapon
put #log >Appraisal.txt |name=%tap
put #log >Appraisal.txt |newapp=yes
put #log >Appraisal.txt |brawl=yes
put #log >Appraisal.txt |noun=%1
put #log >Appraisal.txt |look=%look
put #log >Appraisal.txt <br>'''Read''': There is nothing there to read.
put #log >Appraisal.txt |MTag=%mtags,%mtagg,%mtagm,%mtagw,%mtagf
put #log >Appraisal.txt |CTag=%ctagr,%ctago,%ctagy,%ctagg,%ctagb,%ctagv,%ctagn,%ctagm,%ctagx
put #log >Appraisal.txt |STag=%stagp,%stagg,%staga,%stagh,%stage,%stagr,%stagl
put #log >Appraisal.txt |type=%wtype1
put #log >Appraisal.txt |puncture=%puncture
put #log >Appraisal.txt |puncturetype=yes
put #log >Appraisal.txt |slice=%slice
put #log >Appraisal.txt |slicetype=yes
put #log >Appraisal.txt |impact=%impact
put #log >Appraisal.txt |impacttype=yes
put #log >Appraisal.txt |balance=-
put #log >Appraisal.txt |construction=%construction
put #log >Appraisal.txt |metal=%metal
put #log >Appraisal.txt |weight=%weight
put #log >Appraisal.txt |lsize=%lsize
put #log >Appraisal.txt |wsize=%wsize
put #log >Appraisal.txt |hsize=%hsize
put #log >Appraisal.txt |appcost=%appcost
put #log >Appraisal.txt |wearloc=%wearloc
put #log >Appraisal.txt |sourcetype=-
put #log >Appraisal.txt |maxcharge=%maxcharge
put #log >Appraisal.txt |special=%special
put #log >Appraisal.txt |itype=%itype
put #log >Appraisal.txt }}
put #log >Appraisal.txt
return

AppraiseWeapon5:
gosub VarBlank
pause 1
send tap %number %1 $preposition $shop
waitforre ^You
send shop %number %1 $preposition $shop
waitforre ^Short:
send appraise %number %1 $preposition $shop careful
wait
pause .5
if %appcostl > 0 then evalmath appcostk round(%appcostl/0.8)
if %appcostd > 0 then evalmath appcostk round(%appcostd/0.7216)
gosub CommaAppcost
gosub CommaCost
gosub Tagset
gosub Specialset
gosub Itypeset
echo http://www.elanthipedia.org/wiki/Weapon:%tap&action=edit
echo
echo {{Weapon
echo |brawl=yes
echo |name=%tap
echo |newapp=yes
echo |noun=%1
echo |look=%look
echo <br>'''Read''': There is nothing there to read.
echo |MTag=%mtags,%mtagg,%mtagm,%mtagw,%mtagf
echo |CTag=%ctagr,%ctago,%ctagy,%ctagg,%ctagb,%ctagv,%ctagn,%ctagm,%ctagx
echo |STag=%stagp,%stagg,%staga,%stagh,%stage,%stagr,%stagl
echo |type=parry
echo |puncture=-
echo |puncturetype=No
echo |slicetype=No
echo |impacttype=No
echo |balance=%balance
echo |suitedness=%power
echo |construction=%construction
echo |metal=%metal
echo |weight=%weight
echo |lsize=%lsize
echo |wsize=%wsize
echo |hsize=%hsize
echo |appcost=%appcost
echo |sourcetype=-
echo |maxcharge=%maxcharge
echo |special=%special
echo |itype=%itype
echo }}
put #log >Appraisal.txt http://www.elanthipedia.org/wiki/Weapon:%tap&action=edit
put #log >Appraisal.txt {{Weapon
put #log >Appraisal.txt |brawl=yes
put #log >Appraisal.txt |name=%tap
put #log >Appraisal.txt |newapp=yes
put #log >Appraisal.txt |noun=%1
put #log >Appraisal.txt |look=%look
put #log >Appraisal.txt <br>'''Read''': There is nothing there to read.
put #log >Appraisal.txt |MTag=%mtags,%mtagg,%mtagm,%mtagw,%mtagf
put #log >Appraisal.txt |CTag=%ctagr,%ctago,%ctagy,%ctagg,%ctagb,%ctagv,%ctagn,%ctagm,%ctagx
put #log >Appraisal.txt |STag=%stagp,%stagg,%staga,%stagh,%stage,%stagr,%stagl
put #log >Appraisal.txt |type=parry
put #log >Appraisal.txt |puncture=-
put #log >Appraisal.txt |puncturetype=No
put #log >Appraisal.txt |slicetype=No
put #log >Appraisal.txt |impacttype=No
put #log >Appraisal.txt |balance=%balance
put #log >Appraisal.txt |suitedness=%power
put #log >Appraisal.txt |construction=%construction
put #log >Appraisal.txt |metal=%metal
put #log >Appraisal.txt |weight=%weight
put #log >Appraisal.txt |lsize=%lsize
put #log >Appraisal.txt |wsize=%wsize
put #log >Appraisal.txt |hsize=%hsize
put #log >Appraisal.txt |appcost=%appcost
put #log >Appraisal.txt |wearloc=%wearloc
put #log >Appraisal.txt |sourcetype=-
put #log >Appraisal.txt |maxcharge=%maxcharge
put #log >Appraisal.txt |special=%special
put #log >Appraisal.txt |itype=%itype
put #log >Appraisal.txt }}
put #log >Appraisal.txt
return

AppraiseShield:
gosub VarBlank
pause 1
send tap %number %1 $preposition $shop
waitforre ^You
send shop %number %1 $preposition $shop
waitforre ^Short:
send appraise %number %1 $preposition $shop careful
wait
pause .5
if %newshieldapp = no then var smin NOT SET
if %newshieldapp = no then var smax NOT SET
if %appcostl > 0 then evalmath appcostk round(%appcostl/0.8)
if %appcostd > 0 then evalmath appcostk round(%appcostd/0.7216)
gosub CommaAppcost
gosub CommaCost
gosub Tagset
gosub Specialset
gosub Itypeset
echo http://www.elanthipedia.org/wiki/Shield:%tap&action=edit
echo
echo {{Shield
echo |newshieldapp=%newshieldapp
echo |name=%tap
echo |noun=%1
echo |look=%look
echo <br>'''Read''': There is nothing there to read.
echo |MTag=%mtags,%mtagg,%mtagm,%mtagw,%mtagf
echo |CTag=%ctagr,%ctago,%ctagy,%ctagg,%ctagb,%ctagv,%ctagn,%ctagm,%ctagx
echo |STag=%stagp,%stagg,%staga,%stagh,%stage,%stagr,%stagl
echo |type=%stype
echo |hindrance=%shindrance
echo |minprotection=%smin
echo |maxprotection=%smax
echo |puncture=%puncture
echo |slice=%slice
echo |impact=%impact
echo |balance=%balance
echo |suitedness=%power
echo |construction=%construction
echo |metal=%metal
echo |weight=%weight
echo |lsize=%lsize
echo |wsize=%wsize
echo |hsize=%hsize
echo |appcost=%appcost
echo |sourcetype=-
echo |maxcharge=%maxcharge
echo |special=%special
echo |itype=%itype
echo }}
put #log >Appraisal.txt http://www.elanthipedia.org/wiki/Shield:%tap&action=edit
put #log >Appraisal.txt {{Shield
put #log >Appraisal.txt |newshieldapp=%newshieldapp
put #log >Appraisal.txt |name=%tap
put #log >Appraisal.txt |noun=%1
put #log >Appraisal.txt |look=%look
put #log >Appraisal.txt <br>'''Read''': There is nothing there to read.
put #log >Appraisal.txt |MTag=%mtags,%mtagg,%mtagm,%mtagw,%mtagf
put #log >Appraisal.txt |CTag=%ctagr,%ctago,%ctagy,%ctagg,%ctagb,%ctagv,%ctagn,%ctagm,%ctagx
put #log >Appraisal.txt |STag=%stagp,%stagg,%staga,%stagh,%stage,%stagr,%stagl
put #log >Appraisal.txt |type=%stype
put #log >Appraisal.txt |hindrance=%shindrance
put #log >Appraisal.txt |minprotection=%smin
put #log >Appraisal.txt |maxprotection=%smax
put #log >Appraisal.txt |puncture=%puncture
put #log >Appraisal.txt |slice=%slice
put #log >Appraisal.txt |impact=%impact
put #log >Appraisal.txt |balance=%balance
put #log >Appraisal.txt |suitedness=%power
put #log >Appraisal.txt |construction=%construction
put #log >Appraisal.txt |metal=%metal
put #log >Appraisal.txt |weight=%weight
put #log >Appraisal.txt |lsize=%lsize
put #log >Appraisal.txt |wsize=%wsize
put #log >Appraisal.txt |hsize=%hsize
put #log >Appraisal.txt |appcost=%appcost
put #log >Appraisal.txt |sourcetype=-
put #log >Appraisal.txt |maxcharge=%maxcharge
put #log >Appraisal.txt |special=%special
put #log >Appraisal.txt |itype=%itype
put #log >Appraisal.txt }}
put #log >Appraisal.txt
return

AppraiseArmor:
gosub VarBlank
pause 1
send tap %number %1 $preposition $shop
waitforre ^You
send shop %number %1 $preposition $shop
waitforre ^Short:
send appraise %number %1 $preposition $shop careful
wait
pause .5
if %appcostl > 0 then evalmath appcostk round(%appcostl/0.8)
if %appcostd > 0 then evalmath appcostk round(%appcostd/0.7216)
gosub CommaAppcost
gosub CommaCost
if %aapuncture = %aaslice && %aapuncture = %aaimpact && %aapuncture = %aafire && %aapuncture = %aacold && %aapuncture = %aaelectrical then var absorbance %aapuncture
gosub Tagset
gosub Specialset
gosub Itypeset
echo http://www.elanthipedia.org/wiki/Armor:%tap&action=edit
echo
echo {{Armor
echo |name=%tap
echo |newarmorapp=yes
echo |noun=%1
echo |look=%look
echo <br>'''Read''': There is nothing there to read.
echo |MTag=%mtags,%mtagg,%mtagm,%mtagw,%mtagf
echo |CTag=%ctagr,%ctago,%ctagy,%ctagg,%ctagb,%ctagv,%ctagn,%ctagm,%ctagx
echo |STag=%stagp,%stagg,%staga,%stagh,%stage,%stagr,%stagl
echo |type=%atype
echo |area=%ahead,%aeyes,%aneck,%achest,%aback,%aabdomen,%aarms,%alegs,%ahands
echo |hindrance=%mhindrance
echo |stealth=%shindrance
echo |puncture=%appuncture
echo |slice=%apslice
echo |impact=%apimpact
echo |fire=%apfire
echo |cold=%apcold
echo |electric=%apelectrical
echo |absorbance=%absorbance
echo |punctureab=%aapuncture
echo |sliceab=%aaslice
echo |impactab=%aaimpact
echo |fireab=%aafire
echo |coldab=%aacold
echo |electricab=%aaelectrical
echo |construction=%construction
echo |metal=%metal
echo |appcost=%appcost
echo |weight=%weight
echo |lsize=%lsize
echo |wsize=%wsize
echo |hsize=%hsize
echo |sourcetype=-
echo |maxcharge=%maxcharge
echo |special=%special
echo |itype=%itype
echo }}
put #log >Appraisal.txt http://www.elanthipedia.org/wiki/Armor:%tap&action=edit
put #log >Appraisal.txt {{Armor
put #log >Appraisal.txt |name=%tap
put #log >Appraisal.txt |newarmorapp=yes
put #log >Appraisal.txt |noun=%1
put #log >Appraisal.txt |look=%look
put #log >Appraisal.txt <br>'''Read''': There is nothing there to read.
put #log >Appraisal.txt |MTag=%mtags,%mtagg,%mtagm,%mtagw,%mtagf
put #log >Appraisal.txt |CTag=%ctagr,%ctago,%ctagy,%ctagg,%ctagb,%ctagv,%ctagn,%ctagm,%ctagx
put #log >Appraisal.txt |STag=%stagp,%stagg,%staga,%stagh,%stage,%stagr,%stagl
put #log >Appraisal.txt |type=%atype
put #log >Appraisal.txt |area=%ahead,%aeyes,%aneck,%achest,%aback,%aabdomen,%aarms,%alegs,%ahands
put #log >Appraisal.txt |hindrance=%mhindrance
put #log >Appraisal.txt |stealth=%shindrance
put #log >Appraisal.txt |puncture=%appuncture
put #log >Appraisal.txt |slice=%apslice
put #log >Appraisal.txt |impact=%apimpact
put #log >Appraisal.txt |fire=%apfire
put #log >Appraisal.txt |cold=%apcold
put #log >Appraisal.txt |electric=%apelectrical
put #log >Appraisal.txt |absorbance=%absorbance
put #log >Appraisal.txt |punctureab=%aapuncture
put #log >Appraisal.txt |sliceab=%aaslice
put #log >Appraisal.txt |impactab=%aaimpact
put #log >Appraisal.txt |fireab=%aafire
put #log >Appraisal.txt |coldab=%aacold
put #log >Appraisal.txt |electricab=%aaelectrical
put #log >Appraisal.txt |construction=%construction
put #log >Appraisal.txt |metal=%metal
put #log >Appraisal.txt |appcost=%appcost
put #log >Appraisal.txt |weight=%weight
put #log >Appraisal.txt |lsize=%lsize
put #log >Appraisal.txt |wsize=%wsize
put #log >Appraisal.txt |hsize=%hsize
put #log >Appraisal.txt |sourcetype=-
put #log >Appraisal.txt |maxcharge=%maxcharge
put #log >Appraisal.txt |special=%special
put #log >Appraisal.txt |itype=%itype
put #log >Appraisal.txt }}
put #log >Appraisal.txt
return

AppraiseItem:
gosub VarBlank
pause 1
send tap %number %1 $preposition $shop
waitforre ^You
send shop %number %1 $preposition $shop
waitforre ^Short:
send appraise %number %1 $preposition $shop careful
wait
pause .5
if %appcostl > 0 then evalmath appcostk round(%appcostl/0.8)
if %appcostd > 0 then evalmath appcostk round(%appcostd/0.7216)
gosub CommaAppcost
gosub CommaCost
gosub Tagset
gosub Typeset
echo http://www.elanthipedia.org/wiki/Item:%tap&action=edit
echo
echo {{Item
echo |name=%tap
echo |noun=%1
echo |look=%look
echo <br>'''Read''': There is nothing there to read.
echo |MTag=%mtags,%mtagg,%mtagm,%mtagw,%mtagf
echo |CTag=%ctagr,%ctago,%ctagy,%ctagg,%ctagb,%ctagv,%ctagn,%ctagm,%ctagx
echo |STag=%stagp,%stagg,%staga,%stagh,%stage,%stagr,%stagl
echo |type=%typefunction,%typecon,%typemagic,%typeguild,%typerace
echo |wearloc=%wearloc
echo |weight=%weight
echo |lsize=%lsize
echo |wsize=%wsize
echo |hsize=%hsize
echo |ilsize=%ilsize
echo |iwsize=%iwsize
echo |ihsize=%ihsize
echo |csize=%csize
echo |appcost=%appcost
echo |sourcetype=-
echo |maxcharge=%maxcharge
echo |metal=%metal
echo }}
put #log >Appraisal.txt http://www.elanthipedia.org/wiki/Item:%tap&action=edit
put #log >Appraisal.txt {{Item
put #log >Appraisal.txt |name=%tap
put #log >Appraisal.txt |noun=%1
put #log >Appraisal.txt |look=%look
put #log >Appraisal.txt <br>'''Read''': There is nothing there to read.
put #log >Appraisal.txt |MTag=%mtags,%mtagg,%mtagm,%mtagw,%mtagf
put #log >Appraisal.txt |CTag=%ctagr,%ctago,%ctagy,%ctagg,%ctagb,%ctagv,%ctagn,%ctagm,%ctagx
put #log >Appraisal.txt |STag=%stagp,%stagg,%staga,%stagh,%stage,%stagr,%stagl
put #log >Appraisal.txt |type=%typefunction,%typecon,%typemagic,%typeguild,%typerace
put #log >Appraisal.txt |wearloc=%wearloc
put #log >Appraisal.txt |weight=%weight
put #log >Appraisal.txt |lsize=%lsize
put #log >Appraisal.txt |wsize=%wsize
put #log >Appraisal.txt |hsize=%hsize
put #log >Appraisal.txt |ilsize=%ilsize
put #log >Appraisal.txt |iwsize=%iwsize
put #log >Appraisal.txt |ihsize=%ihsize
put #log >Appraisal.txt |csize=%csize
put #log >Appraisal.txt |appcost=%appcost
put #log >Appraisal.txt |sourcetype=-
put #log >Appraisal.txt |maxcharge=%maxcharge
put #log >Appraisal.txt |metal=%metal
put #log >Appraisal.txt }}
put #log >Appraisal.txt
return

VarBlank:
var metal no
var maxcharge DELETE THIS LINE
var wearloc -
var lsize NOT SET
var wsize NOT SET
var hsize NOT SET
var ilsize DELETE
var iwsize DELETE
var ihsize DELETE
var csize DELETE
var appcost NOT SET
var mtags DELETE
var mtagg DELETE
var mtagm DELETE
var mtagw DELETE
var mtagf DELETE
var ctagr DELETE
var ctago DELETE
var ctagy DELETE
var ctagg DELETE
var ctagb DELETE
var ctagv DELETE
var ctagn DELETE
var ctagm DELETE
var ctagx DELETE
var stagp DELETE
var stagg DELETE
var staga DELETE
var stagh DELETE
var stage DELETE
var stagr DELETE
var stagl DELETE
var wtype2 NOT SET
var puncturetype No
var slicetype No
var impacttype No
var absorbance VALUES NOT EQUAL
var ahead DELETE
var aeyes DELETE
var aneck DELETE
var achest DELETE
var aback DELETE
var aabdomen DELETE
var aarms DELETE
var alegs DELETE
var ahands DELETE
var construction NOT SET
var typefunction -
var typecon DELETE
var typemagic DELETE
var typeguild DELETE
var typerace DELETE
var special NOT SET
var itype NOT SET
return

Tagset:
if (matchre ("%look", "((\w+)(?=[- ](colored|highlighted|hued|tinted|toned)))")) then var ctagx $1
if (matchre ("%look", "(acolyte|adventurer|alchemist|amazon|apothecary|\barchers?\b|armorsmith|assassin|bandit|Barbarian|\bBards?\b|barmaid|bartender|beggar|blacksmith|blasphemer|bowm[ae]n|\bbrewers?\b|brigand|buccaneer|burglar|captain|celebrant|champion|\bchefe?s?\b|citizen|clergy|clergy(man|woman)|Cleric|combatant|commoner|convict|criminal|diviner|doctor|druid|duelist|ecclesiastic|elemancer|elementalist|embalmer|Empath|enchanter|enchantress|engineer|executioner|farmer|felon|fencer|forester|gladiator|hangm[ae]n|healer|herald|heretic|\bheroe?s?\b|hierophant|highwaym[ae]n|historian|hunter|huntsm[ae]n|Inquisitor|inquisitress|judge|justiciar|knight|locksmith|lumberjack|\bmages?\b|marshal|martyr|mastermind|\bmedics?\b|medicine (m[ae]n|wom[ae]n)|merchant|messenger|minister|minstrel|\bmonks?\b|Moon Mage|mortician|mystic|navigator|Necromancer|nurse|outlaw|Paladin|pastor|peddler|philosopher|physician|pilgrim|pirate|\bpoets?\b|preacher|priest|prisoner|prophet|psychic|Ranger|researcher|rogue|\bsages?\b|sailor|scholar|\bseers?\b|sham[ae]n|shepherd|smuggler|sniper|soldier|spiritualist|surgeon|swashbuckler|Thief|Thieves|Trader|travell?er|undertaker|urchin|villager|villain|warrior|Warrior Mage|weaponsmith|weaver|\bwitche?s?\b|wizard|woodcutter|woodsm[ae]n)")) then var stagp $1
if (matchre ("%look", "(Adan'?f|Dwarf|Dwarves|\bElfs?\b|Elothean|\bElves\b|Gnome|Gor'?Tog|Gorbesh|Halfling|Human|Kaldar|Lohogi'?hhs'?ur|Lohogi'?tel'?tegreis|mer-?(folk|m[ae]n|people|wom[ae]n)|Ocular|\bOlvis?\b|Prydaen|Rakash|S'?Kra ?Mur|S'?Kra'?ur)")) then var stagr $1
if (matchre ("%look", "(adderstone|aevanstone|\bagate\b|alabaster|alexandrite|almiris|\bamber\b|ambergris|amethyst|amlothite|andalusite|anloral|anthracite|aquamarine|arkose|aurora opal|aurora tourmaline|autumn jasper|axinite|azurite|basalt|beryl|black diamond|blood rubies|blood ruby|bloodgem|bloodstone|blue diamond|\bbones?\b|brain coral|calav[ae]rite|carnelian|cat'?s? eye|ceramic|chalcedonies|chalcedony|chalk|champagne diamond|cherry opal|chrysoberyl|chrysoprase|cinnabar|citrine|\bclay\b|claystone|cloud rubies|cloud ruby|\bcoal\b|coral|crimson sapphire|crystal|Crystalline dragon tear|dafora pearl|Dalterein diamond|damaryn pearl|damilyo pearl|dawgolite|diamond|diopside|diorite|dolomite|draconic opal|dragon fire opal|dragon'?s blood rubies|dragon'?s blood ruby|dragon'?s eye rubies|dragon'?s eye ruby|dragon'?s heart rubies|dragon'?s heart ruby|dragon'?s scale sapphire|dragonfire amber|durgauldite|dwalgim|elanthite|elbaite|eldring|Eluned'?s tear sapphire|emerald|er'?qutrite|erythrite|estrildite|eventide moonstone|fang pearl|feldspar|fire maiden topaz|fire pearl|firesilk opal|flame coral|flame opal|flint|fool's gold|forest'?s heart garnet|frost opal|frostfire opal|frostflare opal|garnet|geshi pearl|glacier emerald|\bglass\b|gloamstone|glowstone|gneiss|granite|grazhite|Hav'?roth'?s ambrosia|hawk'?s? eye|haze sapphire|heartstone|hematite|idopun pearl|Ilithi emerald|ilmenite|imperial rubies|imperial ruby|imperial sapphire|imperial topaz|iolite|ismenite|ivory|jackal'?s heart pearl|\bjade\b|jadeite|jasper|kaolinite|katamba'?s spire|katambite|kunzite|kyanite|lantholite|lapis|lapis lazuli|larimar|lasmodi|lilac diamond|limestone|lion'?s heart topaz|lotus flower sapphire|malachite|\bmarble\b|merewaldite|mermaid'?s tear sapphire|midnight rubies|midnight ruby|mistglass|molten-core diamond|moon pearl|moonspun rubies|moonspun ruby|moonstone|morganite|morleenite|mudstone|Musparan gold sapphire|mystic topaz|nacre|nature'?s canopy emerald|neitrice|night diamond|nightfire opal|nightstone|nimbus garnet|obsidian|ocean jasper|ocean'?s deep emerald|olivine|onyx|\bopals?\b|orchid alexandrite|pearl|penhetite|peridot|phantom sapphire|pink diamond|pitch pearlporcelain|porphyry|pumice|pyrite|quartz|rhodochrosite|rhodonite|royal zoluren topaz|rubies|\bruby\b|runestone|saffron topaz|sana'?ati heart|sandstone|sapphire|scheelite|schist|scrimshaw|sea[- ]glass|selenite|seordstone|serpent'?s heart rubies|serpent'?s heart ruby|shale|shrike'?s eye sapphire|sjatmal|sky opal|slate|smoke rubies|smoke ruby|smoky diamond|smoky topaz|snow opal|soapstone|sodalite|spiderweb jasper|spinel|star rubies|star ruby|star sapphire|starfire topaz|starlight rubies|starlight ruby|star-stone|summer'?s heart sapphire|sunset opal|sunstone|svelae|szeldite|Taisidon emerald|Taisidon pearl|talan pearl|tanzanite|Teiro'?s hate rubies|Teiro'?s hate ruby|tempest sapphire|thealstone|tiger'?s? eye|topaz|tourmaline|tsavorite|turquoise|twilight sapphire|vela'?tohr tourmaline|verenite|violet'?s heart amethyst|volcano'?s heart citrine|waermodi|water opal|white diamond|white Zoluren sapphire|wild horse jasper|winter emerald|winter opal|wulfenite|Xibar topaz|xibarite|yavasite|yoakenite|zenith spinel|zircon)")) then var mtagg $1
if (matchre ("%look", "(aluminum|animite|anlora[- ]avtoma|audrualm|black gold|blue gold|brass|bronze|chrome|\bcopper\b|covellite|crown gold|Damascus steel|damite|darkstone|electrum|gilded|glaes|gold|green gold|grey gold|haralun|hepatizon|icesteel|iridium|\biron\b|kertig|\blead\b|lumium|moen takibena|moonsilver|nickel|niello|niniam|oravir|orichalcum|palladium|pewter|pink gold|platinum|purple gold|\bred gold\b|rose gold|\bsilver\b|silver-gilt|silversteel|spangold|\bsteel\b|tantalum|\btin\b|titanium|tyrium|vardite|verdigris copper|white gold|zinc)")) then var mtagm $1
if (matchre ("%look", "(animal|\bbeasts?\b|insect|aardvark|adder|albatross|alfar|alligator|alpaca|alphyn|anchovy|antelope|antler|\bapes?\b|apparition|arachnid|armadillo|\bass\b|aurochs|badger|bagwyn|banshee|barnacle|barracuda|basilisk|\bbats?\b|\bbears?\b|beaver|\bbees?\b|beetle|behemoth|bird|bison|black widow|blackbird|bloodworm|blue ?jay|\bboars?\b|boggart|boobrie|\bbucks?\b|buffalo|\bbulls?\b|bumble ?bee|burro|bustard|butterflies|butterfly|buzzard|calopus|camel|camelopard|canary|capybara|caracal|cardinal|\bcats?\b|caterpillar|cattle|celpeze|centaur|centipede|chameleon|cheetah|chimera|chimpanzee|chinchilla|chipmunk|cicada|civet|\bclams?\b|cobra|\bcocks?\b|cockatrice|cockroach|collie|condor|coney|cottontail|cougar|\bcows?\b|coyote|\bcrabs?\b|crane|cricket|crocodile|\bcrows?\b|curlew|damselfly|\bdeers?\b|demon|\bdevils?\b|\bdingos?\b|\bdoe\b|\bdogs?\b|dolphin|donkey|\bdoves?\b|\bdragons?\b|dragonfly|dryad|duck|eagle|echidna|\beels?\b|elephant|\belk\b|ermine|\bewes?\b|\bfae\b|fairy|falcon|\bfauns?\b|ferret|fiend|\bfinchs?\b|fish|\bfleas?\b|flies|flounder|\bfly\b|\bfox\b|\bfrog\b|gazelle|gecko|genie|gerbil|\bghosts?\b|\bghouls?\b|gidii|giraffe|goat|goblin|goose|gopher|gorilla|goshawk|gr[iy]ff[io]n|gr[iy]ph[io]n|grasshopper|greyhound|groundhog|grouse|guinea pig|hamster|\bhares?\b|harpy|\bhawks?\b|hedgehog|heron|\bherring\b|hinny|hippocamp|hippogr[iy]ff|hippogr[iy]ph|\bhogs?\b|honey ?bee|hornet|horse|hound|hydra|hyena|\bibexs?\b|iguana|\bimps?\b|impala|inkhorne|jackal|jaguar|kangaroo|katydid|kelpie|kestrel|king ?snake|kingfisher|kirin|kitten|kobold|ladybug|\blamb\b|\blarks?\b|leech|lemming|lemur|leopard|\blions?\b|lioness|lizard|llama|lobster|locust|\blynxs?\b|maggot|magpie|mammoth|manatee|manta ray|manticore|mantis|marmot|marten|martlet|mastiff|meerkat|merelew|mermaid|merman|mink|minnow|minotaur|mockingbird|mongoose|monkey|moose|mosquito|\bmoth\b|mouflon|mountain lion|mouse|\bmules?\b|musimon|muskox|nightingale|\bnyads?\b|ocelot|octopus|onager|opossum|osprey|ostrich|\botters?\b|\bowls?\b|\boxe?n?\b|oyster|panther|parakeet|parrot|partridge|peacock|pegasus|pelican|pheasant|phoenix|\bpigs?\b|pigeon|pika|platypus|polecat|popinjay|porcupine|possum|prairie ?dog|prawn|primate|puma|puppy|python|quail|rabbit|raccoon|\brams?\b|raptor|\brats?\b|raven|reindeer|remora|rhinoceros|robin|rooster|salamander|salmon|sardine|satyr|scarab|scorpion|seagull|selkie|serpent|shark|sheep|shrew|shrike|shrimp|skeleton|\bskulls?\b|snail|snake|snowbeast|sparrow|specter|sphinx|\bspider\b|\bspirits?\b|springbok|\bsprites?\b|squirrel|stag|starling|stoat|stork|sturgeon|swallow|\bswans?\b|swine|swordfish|talbot|tarantula|termite|terrapin|thrush|tiger|tityrus|\btoads?\b|tortoise|toucan|troll|trout|turkey|turtle|undead|unicorn|viper|vole|vulture|walrus|\bwasps?\b|weasel|welkin|werewolf|whale|wildcat|\bwings?\b|winged horse|\bwolfs?\b|wolverine|woodchuck|wraith|wren|wyvern|\byaks?\b|\byales?\b|yeehar|zebra|zombie)")) then var staga $1
if (matchre ("%look", "(asketine|avaes|celstite|chakrel|dhhresh|hafaltu|iheaneu'a|imnera|indakar|ithridu|keismin|lemicule|negnetha|soulstone|sraeth|xibaryl|zengalmi)")) then var mtags $1
if (matchre ("%look", "(herb|aevaes|aloe|belladonna|blocil|\bcebi\b|Datura|draconeaia|eghmok|foxglove|genich|georin|glaysker|hemlock|hisan|hulij|hulnik|ithor|jadice|junliar|lujeakave|muljin|nemoih|nightshade|nilos|nuloe|ojhenik|plovik|\bquns?\b|riolur|sufil|yelith)")) then var stagh $1
if (matchre ("%look", "(rainbow|iridescent|pavonine|polychromatic)")) then var ctagm $1
if (matchre ("%look", "([cs]endal|angora|armure|\bbatik\b|batiste|bison[- ]hide|boar[- ]hide|bombazine|broadcloth|brocade|buckskin|burlap|canvas|cashmere|chiffon|cloth[- ]of[- ]gold|cloth[- ]of[- ]silver|cotton|cowhide|crinoline|cuirbouilli|damask|deerskin|doeskin|eolienne\b|\bermine|faille|feather\b|\bfelt|flannel|fleece\b|\bfur|gingham|goldweave|grogram|grosgrain|haircloth\b|\bhemp|horsehair|ialalhe|jacquard|jute|khaki|khiynit|kidskin\b|\blace|lambskin|lava samite|leather|linen|longcloth|muslin|oilcloth|oilskin|ramshorn|rawhide|sackcloth\b|sailcloth\b|\bsamite|\bsatin\b|seersucker\b|\bserge|\bshagreen|sharkskin\b|sheepskin|\bsilk|silverweave|sinew|snakeskin|snowflake tulle|straw|suede|sunkissed chiffon\b|taffeta|\btulle\b|tweed\b|\btwine|\bvelvet|velveteen\b|voile|\bwool|worsted|zibeline|(blood|bluefire|dragonfire|duchess|Elothean|Elven|fae woven|fire|ice|marble|moon|Musparan|night|night[rw]eaver|nightstalker|oceanmist|seafoam|shade|shadow|spider|starlight|steel|storm|Velaka|water|windstorm) ?(brocade|gossamer|lace|linen|satin|silk|snowlace|velvet|wool))")) then var mtagf $1
if (matchre ("%look", "(\bAesry\b|Aesry Surlaenis'?a|Ain Ghazal|Amlothi|Arthe Dale|bayou|Belarritaco|Boar Clan|\bbogs?\b|canyon|Chyolvea Tayeu'?a|comet|constellation|Crossing|Dawgolesh|\bdeserts?\b|Dirge|Durgaulda|El'?Bain'?s|Elanthia|Empire|Er'?qutra|Estrilda|Faldesu|Fayrin'?s Rest|\bfens?\b|forest(?![- ]green)|Forfedhdar|Fornsted|grassland|Grazhir|Gwenalion|Hara'?jaal|Hekemhhg|Hibarnhvidar|iceberg|Ilaya Taipa|Ilithi|Irasushen|\bislands?\b|Ismenia|Jantspyre|jungle|Kaerna Village|\bKatamba\b|Kermoria|Knife Clan|\blakes?\b|Langenfirth|Leth Deriel|M'?Riss|marsh|meadow|Mer'?Kresh|Merewalda|\bmoons?\b|morass|Morleena|mountain|Muspar'?i|Nenav Dalar|\boceans?\b|Oxenwaithe|Penhetia|Pi'?Qanah|\bplanets?\b|prairie|Qi'?Reshalia|quagmire|rainforest|Ratamipak|\bRatha\b|Raven'?s Point|\bReshal\b|Reshalia|\brivers?\b|Riverhaven|Rossman'?s Landing|Sarasunath|savanna|Sawstwar|\bseas?\b|Segoltha|Shamilho|\bShard\b|shrubland|Siksraja|\bstars?\b|Steelclaw Clan|steppe|Stone Clan|\bsuns?\b|sunburst|Surlaenis|swamp|Szeldia|taiga|Taisgath|The Crossing|Therenborough|Therengia|Throne City|Tiger Clan|tundra|Velaka|Verena|volcano|wetland|Wolf Clan|woodland|\bXibar\b|Yavash|Yoakena|Zaulfung|Zhamikhh|Zoluren)")) then var stagl $1
if (matchre ("%look", "(\bblue\b|azure|bluish|\bceil\b|cerulean|cobalt|\bcyan\b|cyaneous|indigo|\bteal\b|turquoise|ultramarine)")) then var ctagb $1
if (matchre ("%look", "(\bebon\b|alabaster|argent|arsenic|\bashen\b|beige|\bblack\b|camouflage|cinereous|colorless|\bcream\b|eggshell|eisen|feldgrau|glaucous|gr[ae]y|ivory|pellucid|platinum|\bsable\b|silver|taupe\b|white)")) then var ctagn $1
if (matchre ("%look", "(\belements?\b|\ba?ether\b|\bair\b|\bearth\b|electricity|\bfires?\b|\bflames?\b|\bice\b|inferno|lightning|\bpyre\b|\bsnow\b|snowflake|thunder|water|\bwind\b)")) then var stage $1
if (matchre ("%look", "(\bgods?\b|Immortal|Alamhif\b|Albreda\b|Aldauth|Aliesa|Aniek|Asketi|Be'?ort|Berengaria|Botolf|Chadatru|Coshivi|Damaris|Demrris|Dergati|Divyaush|Drogor|Eerayn|Eimeuz|Elide|Eluned|Enelne|\bEu|Everild|Eylhaar|Faenella|Faiyka|Firulf|Gizzbolf|Glacis|Glythtide|Harawep|Hav'?roth|Hodierna|Huldah|\bIdon|Iladza|Issendar|Kerenhappuch|Kertigen|Kirmhara|Krigglin|Kuniyo|Lemicus|Meraud|Merion|Misiumos|Mrod|Murrula|Orisas|Peri'?el|Phelim|Rutilor|Saemaus|Shariza|Sieben|Sildua|Spangklud|Sraxaec|Tamsine|Tenemlor|Thirteen|Tieheq|Triquetra|Trothfang|Truffenyi|Urrem'?tier|Ushnish|World Dragon|Xosiurion|Zachriedek)")) then var stagg $1
if (matchre ("%look", "(\bgreen\b|asparagus|blue[- ]green|celadon|chartreuse|\blime\b|olivaceous|olive[- ]drab|smalt|\bvert\b|viridian|yellow[- ]green)")) then var ctagg $1
if (matchre ("%look", "(\borange\b|bronze|brown|copper|fiery|ochre|\bpeach\b|persimmon|red[- ]orange|reddish[- ]orange|russet|sepia|sienna|\bsorrel\b|\btan\b|tangerine|tawny|tenne|\bumber\b|yellow[- ]orange)")) then var ctago $1
if (matchre ("%look", "(\bred\b|auburn|blood[- ]red|burgundy|cardinal|carmine|carnelian|cerise|chestnut|claret|coquelicot|crimson|gules|haematic|incarnadine|magenta|maroon|murrey|orange[- ]red|\bpink\b|\breddish\b|\brosy\b|rubiginose|rubiginous|ruddy|sanguine|scarlet|vermilion|vinaceous)")) then var ctagr $1
if (matchre ("%look", "(\bviolet\b|aubergine|eggplant|fuchsia|lavender|lilac|mauve|orchid|periwinkle|purple|purplish|purpure|red[- ]violet|thistle|violescent)")) then var ctagv $1
if (matchre ("%look", "(\bwooden\b|paper|acacia|acanth|adderwood|aganylosh'?a|\balder\b|\bapple\b|\bash\b|aspen|balsa|bamboo|basswood|beech|birch|blackwood|bloodwood|boxwood|bricklebranch|burlwood|cedar|cherrywood|chestnut|cocobolo|copperleaf|copperwood|\bcork\b|cottonwood|cypress|deobar|desert palm|diamondwood|dogwood|dragonwood|driftwood|e'?erdream|ebonwood|\bebony\b|\belder\b|\belm\b|eucalyptus|\bfir\b|flamethorn|flamewood|fruitwood|gethwood|gloomwood|goldbark|goldenoak|halmik|haon|hardwood|hawthorn|hhr'?lav'?geluhh|hickory|huljik|ironwood|juniper|khor-?vela|lacewood|laurel|lemonwood|linden|linwood|lunat|mahogany|maple|mikkhalbamar|mistwood|modwir|\boak\b|\bosage\b|palmwood|papyrus|parchment|pearwood|\bpine\b|plumwood|plumwood|poplar|purpleheart|redwood|\breed\b|rosewood|rowan|sana'?ati|sandalwood|sanrisi|satinwood|shaal|silverwillow|silverwood|smokewood|softwood|spruce|taborwood|\bteak\b|vellum|walnut|whitethorn|wiirwood|willow|witchclaw|wormwood|wyndewood|\byew\b)")) then var mtagw $1
if (matchre ("%look", "(\byellow\b|\bamber\b|aurulent|champagne|\becru\b|flaxen|gold|green[- ]yellow|jonquil|lemon|red[- ]gold|saffron|xanthic)")) then var ctagy $1
if (matchre ("%tap", "((\w+)(?=[- ](colored|highlighted|hued|tinted|toned)))")) then var ctagx $1
if (matchre ("%tap", "(acolyte|adventurer|alchemist|amazon|apothecary|\barchers?\b|armorsmith|assassin|bandit|Barbarian|\bBards?\b|barmaid|bartender|beggar|blacksmith|blasphemer|bowm[ae]n|\bbrewers?\b|brigand|buccaneer|burglar|captain|celebrant|champion|\bchefe?s?\b|citizen|clergy|clergy(man|woman)|Cleric|combatant|commoner|convict|criminal|diviner|doctor|druid|duelist|ecclesiastic|elemancer|elementalist|embalmer|Empath|enchanter|enchantress|engineer|executioner|farmer|felon|fencer|forester|gladiator|hangm[ae]n|healer|herald|heretic|\bheroe?s?\b|hierophant|highwaym[ae]n|historian|hunter|huntsm[ae]n|Inquisitor|inquisitress|judge|justiciar|knight|locksmith|lumberjack|\bmages?\b|marshal|martyr|mastermind|\bmedics?\b|medicine (m[ae]n|wom[ae]n)|merchant|messenger|minister|minstrel|\bmonks?\b|Moon Mage|mortician|mystic|navigator|Necromancer|nurse|outlaw|Paladin|pastor|peddler|philosopher|physician|pilgrim|pirate|\bpoets?\b|preacher|priest|prisoner|prophet|psychic|Ranger|researcher|rogue|\bsages?\b|sailor|scholar|\bseers?\b|sham[ae]n|shepherd|smuggler|sniper|soldier|spiritualist|surgeon|swashbuckler|Thief|Thieves|Trader|travell?er|undertaker|urchin|villager|villain|warrior|Warrior Mage|weaponsmith|weaver|\bwitche?s?\b|wizard|woodcutter|woodsm[ae]n)")) then var stagp $1
if (matchre ("%tap", "(Adan'?f|Dwarf|Dwarves|\bElfs?\b|Elothean|\bElves\b|Gnome|Gor'?Tog|Gorbesh|Halfling|Human|Kaldar|Lohogi'?hhs'?ur|Lohogi'?tel'?tegreis|mer-?(folk|m[ae]n|people|wom[ae]n)|Ocular|\bOlvis?\b|Prydaen|Rakash|S'?Kra ?Mur|S'?Kra'?ur)")) then var stagr $1
if (matchre ("%tap", "(adderstone|aevanstone|\bagate\b|alabaster|alexandrite|almiris|\bamber\b|ambergris|amethyst|amlothite|andalusite|anloral|anthracite|aquamarine|arkose|aurora opal|aurora tourmaline|autumn jasper|axinite|azurite|basalt|beryl|black diamond|blood rubies|blood ruby|bloodgem|bloodstone|blue diamond|\bbones?\b|brain coral|calav[ae]rite|carnelian|cat'?s? eye|ceramic|chalcedonies|chalcedony|chalk|champagne diamond|cherry opal|chrysoberyl|chrysoprase|cinnabar|citrine|\bclay\b|claystone|cloud rubies|cloud ruby|\bcoal\b|coral|crimson sapphire|crystal|Crystalline dragon tear|dafora pearl|Dalterein diamond|damaryn pearl|damilyo pearl|dawgolite|diamond|diopside|diorite|dolomite|draconic opal|dragon fire opal|dragon'?s blood rubies|dragon'?s blood ruby|dragon'?s eye rubies|dragon'?s eye ruby|dragon'?s heart rubies|dragon'?s heart ruby|dragon'?s scale sapphire|dragonfire amber|durgauldite|dwalgim|elanthite|elbaite|eldring|Eluned'?s tear sapphire|emerald|er'?qutrite|erythrite|estrildite|eventide moonstone|fang pearl|feldspar|fire maiden topaz|fire pearl|firesilk opal|flame coral|flame opal|flint|fool's gold|forest'?s heart garnet|frost opal|frostfire opal|frostflare opal|garnet|geshi pearl|glacier emerald|\bglass\b|gloamstone|glowstone|gneiss|granite|grazhite|Hav'?roth'?s ambrosia|hawk'?s? eye|haze sapphire|heartstone|hematite|idopun pearl|Ilithi emerald|ilmenite|imperial rubies|imperial ruby|imperial sapphire|imperial topaz|iolite|ismenite|ivory|jackal'?s heart pearl|\bjade\b|jadeite|jasper|kaolinite|katamba'?s spire|katambite|kunzite|kyanite|lantholite|lapis|lapis lazuli|larimar|lasmodi|lilac diamond|limestone|lion'?s heart topaz|lotus flower sapphire|malachite|\bmarble\b|merewaldite|mermaid'?s tear sapphire|midnight rubies|midnight ruby|mistglass|molten-core diamond|moon pearl|moonspun rubies|moonspun ruby|moonstone|morganite|morleenite|mudstone|Musparan gold sapphire|mystic topaz|nacre|nature'?s canopy emerald|neitrice|night diamond|nightfire opal|nightstone|nimbus garnet|obsidian|ocean jasper|ocean'?s deep emerald|olivine|onyx|\bopals?\b|orchid alexandrite|pearl|penhetite|peridot|phantom sapphire|pink diamond|pitch pearlporcelain|porphyry|pumice|pyrite|quartz|rhodochrosite|rhodonite|royal zoluren topaz|rubies|\bruby\b|runestone|saffron topaz|sana'?ati heart|sandstone|sapphire|scheelite|schist|scrimshaw|sea[- ]glass|selenite|seordstone|serpent'?s heart rubies|serpent'?s heart ruby|shale|shrike'?s eye sapphire|sjatmal|sky opal|slate|smoke rubies|smoke ruby|smoky diamond|smoky topaz|snow opal|soapstone|sodalite|spiderweb jasper|spinel|star rubies|star ruby|star sapphire|starfire topaz|starlight rubies|starlight ruby|star-stone|summer'?s heart sapphire|sunset opal|sunstone|svelae|szeldite|Taisidon emerald|Taisidon pearl|talan pearl|tanzanite|Teiro'?s hate rubies|Teiro'?s hate ruby|tempest sapphire|thealstone|tiger'?s? eye|topaz|tourmaline|tsavorite|turquoise|twilight sapphire|vela'?tohr tourmaline|verenite|violet'?s heart amethyst|volcano'?s heart citrine|waermodi|water opal|white diamond|white Zoluren sapphire|wild horse jasper|winter emerald|winter opal|wulfenite|Xibar topaz|xibarite|yavasite|yoakenite|zenith spinel|zircon)")) then var mtagg $1
if (matchre ("%tap", "(aluminum|animite|anlora[- ]avtoma|audrualm|black gold|blue gold|brass|bronze|chrome|\bcopper\b|covellite|crown gold|Damascus steel|damite|darkstone|electrum|gilded|glaes|gold|green gold|grey gold|haralun|hepatizon|icesteel|iridium|\biron\b|kertig|\blead\b|lumium|moen takibena|moonsilver|nickel|niello|niniam|oravir|orichalcum|palladium|pewter|pink gold|platinum|purple gold|\bred gold\b|rose gold|\bsilver\b|silver-gilt|silversteel|spangold|\bsteel\b|tantalum|\btin\b|titanium|tyrium|vardite|verdigris copper|white gold|zinc)")) then var mtagm $1
if (matchre ("%tap", "(animal|\bbeasts?\b|insect|aardvark|adder|albatross|alfar|alligator|alpaca|alphyn|anchovy|antelope|antler|\bapes?\b|apparition|arachnid|armadillo|\bass\b|aurochs|badger|bagwyn|banshee|barnacle|barracuda|basilisk|\bbats?\b|\bbears?\b|beaver|\bbees?\b|beetle|behemoth|bird|bison|black widow|blackbird|bloodworm|blue ?jay|\bboars?\b|boggart|boobrie|\bbucks?\b|buffalo|\bbulls?\b|bumble ?bee|burro|bustard|butterflies|butterfly|buzzard|calopus|camel|camelopard|canary|capybara|caracal|cardinal|\bcats?\b|caterpillar|cattle|celpeze|centaur|centipede|chameleon|cheetah|chimera|chimpanzee|chinchilla|chipmunk|cicada|civet|\bclams?\b|cobra|\bcocks?\b|cockatrice|cockroach|collie|condor|coney|cottontail|cougar|\bcows?\b|coyote|\bcrabs?\b|crane|cricket|crocodile|\bcrows?\b|curlew|damselfly|\bdeers?\b|demon|\bdevils?\b|\bdingos?\b|\bdoe\b|\bdogs?\b|dolphin|donkey|\bdoves?\b|\bdragons?\b|dragonfly|dryad|duck|eagle|echidna|\beels?\b|elephant|\belk\b|ermine|\bewes?\b|\bfae\b|fairy|falcon|\bfauns?\b|ferret|fiend|\bfinchs?\b|fish|\bfleas?\b|flies|flounder|\bfly\b|\bfox\b|\bfrog\b|gazelle|gecko|genie|gerbil|\bghosts?\b|\bghouls?\b|gidii|giraffe|goat|goblin|goose|gopher|gorilla|goshawk|gr[iy]ff[io]n|gr[iy]ph[io]n|grasshopper|greyhound|groundhog|grouse|guinea pig|hamster|\bhares?\b|harpy|\bhawks?\b|hedgehog|heron|\bherring\b|hinny|hippocamp|hippogr[iy]ff|hippogr[iy]ph|\bhogs?\b|honey ?bee|hornet|horse|hound|hydra|hyena|\bibexs?\b|iguana|\bimps?\b|impala|inkhorne|jackal|jaguar|kangaroo|katydid|kelpie|kestrel|king ?snake|kingfisher|kirin|kitten|kobold|ladybug|\blamb\b|\blarks?\b|leech|lemming|lemur|leopard|\blions?\b|lioness|lizard|llama|lobster|locust|\blynxs?\b|maggot|magpie|mammoth|manatee|manta ray|manticore|mantis|marmot|marten|martlet|mastiff|meerkat|merelew|mermaid|merman|mink|minnow|minotaur|mockingbird|mongoose|monkey|moose|mosquito|\bmoth\b|mouflon|mountain lion|mouse|\bmules?\b|musimon|muskox|nightingale|\bnyads?\b|ocelot|octopus|onager|opossum|osprey|ostrich|\botters?\b|\bowls?\b|\boxe?n?\b|oyster|panther|parakeet|parrot|partridge|peacock|pegasus|pelican|pheasant|phoenix|\bpigs?\b|pigeon|pika|platypus|polecat|popinjay|porcupine|possum|prairie ?dog|prawn|primate|puma|puppy|python|quail|rabbit|raccoon|\brams?\b|raptor|\brats?\b|raven|reindeer|remora|rhinoceros|robin|rooster|salamander|salmon|sardine|satyr|scarab|scorpion|seagull|selkie|serpent|shark|sheep|shrew|shrike|shrimp|skeleton|\bskulls?\b|snail|snake|snowbeast|sparrow|specter|sphinx|\bspider\b|\bspirits?\b|springbok|\bsprites?\b|squirrel|stag|starling|stoat|stork|sturgeon|swallow|\bswans?\b|swine|swordfish|talbot|tarantula|termite|terrapin|thrush|tiger|tityrus|\btoads?\b|tortoise|toucan|troll|trout|turkey|turtle|undead|unicorn|viper|vole|vulture|walrus|\bwasps?\b|weasel|welkin|werewolf|whale|wildcat|\bwings?\b|winged horse|\bwolfs?\b|wolverine|woodchuck|wraith|wren|wyvern|\byaks?\b|\byales?\b|yeehar|zebra|zombie)")) then var staga $1
if (matchre ("%tap", "(asketine|avaes|celstite|chakrel|dhhresh|hafaltu|iheaneu'a|imnera|indakar|ithridu|keismin|lemicule|negnetha|soulstone|sraeth|xibaryl|zengalmi)")) then var mtags $1
if (matchre ("%tap", "(herb|aevaes|aloe|belladonna|blocil|\bcebi\b|Datura|draconeaia|eghmok|foxglove|genich|georin|glaysker|hemlock|hisan|hulij|hulnik|ithor|jadice|junliar|lujeakave|muljin|nemoih|nightshade|nilos|nuloe|ojhenik|plovik|\bquns?\b|riolur|sufil|yelith)")) then var stagh $1
if (matchre ("%tap", "(rainbow|iridescent|pavonine|polychromatic)")) then var ctagm $1
if (matchre ("%tap", "([cs]endal|angora|armure|\bbatik\b|batiste|bison[- ]hide|boar[- ]hide|bombazine|broadcloth|brocade|buckskin|burlap|canvas|cashmere|chiffon|cloth[- ]of[- ]gold|cloth[- ]of[- ]silver|cotton|cowhide|crinoline|cuirbouilli|damask|deerskin|doeskin|eolienne\b|\bermine|faille|feather\b|\bfelt|flannel|fleece\b|\bfur|gingham|goldweave|grogram|grosgrain|haircloth\b|\bhemp|horsehair|ialalhe|jacquard|jute|khaki|khiynit|kidskin\b|\blace|lambskin|lava samite|leather|linen|longcloth|muslin|oilcloth|oilskin|ramshorn|rawhide|sackcloth\b|sailcloth\b|\bsamite|\bsatin\b|seersucker\b|\bserge|\bshagreen|sharkskin\b|sheepskin|\bsilk|silverweave|sinew|snakeskin|snowflake tulle|straw|suede|sunkissed chiffon\b|taffeta|\btulle\b|tweed\b|\btwine|\bvelvet|velveteen\b|voile|\bwool|worsted|zibeline|(blood|bluefire|dragonfire|duchess|Elothean|Elven|fae woven|fire|ice|marble|moon|Musparan|night|night[rw]eaver|nightstalker|oceanmist|seafoam|shade|shadow|spider|starlight|steel|storm|Velaka|water|windstorm) ?(brocade|gossamer|lace|linen|satin|silk|snowlace|velvet|wool))")) then var mtagf $1
if (matchre ("%tap", "(\bAesry\b|Aesry Surlaenis'?a|Ain Ghazal|Amlothi|Arthe Dale|bayou|Belarritaco|Boar Clan|\bbogs?\b|canyon|Chyolvea Tayeu'?a|comet|constellation|Crossing|Dawgolesh|\bdeserts?\b|Dirge|Durgaulda|El'?Bain'?s|Elanthia|Empire|Er'?qutra|Estrilda|Faldesu|Fayrin'?s Rest|\bfens?\b|forest(?![- ]green)|Forfedhdar|Fornsted|grassland|Grazhir|Gwenalion|Hara'?jaal|Hekemhhg|Hibarnhvidar|iceberg|Ilaya Taipa|Ilithi|Irasushen|\bislands?\b|Ismenia|Jantspyre|jungle|Kaerna Village|\bKatamba\b|Kermoria|Knife Clan|\blakes?\b|Langenfirth|Leth Deriel|M'?Riss|marsh|meadow|Mer'?Kresh|Merewalda|\bmoons?\b|morass|Morleena|mountain|Muspar'?i|Nenav Dalar|\boceans?\b|Oxenwaithe|Penhetia|Pi'?Qanah|\bplanets?\b|prairie|Qi'?Reshalia|quagmire|rainforest|Ratamipak|\bRatha\b|Raven'?s Point|\bReshal\b|Reshalia|\brivers?\b|Riverhaven|Rossman'?s Landing|Sarasunath|savanna|Sawstwar|\bseas?\b|Segoltha|Shamilho|\bShard\b|shrubland|Siksraja|\bstars?\b|Steelclaw Clan|steppe|Stone Clan|\bsuns?\b|sunburst|Surlaenis|swamp|Szeldia|taiga|Taisgath|The Crossing|Therenborough|Therengia|Throne City|Tiger Clan|tundra|Velaka|Verena|volcano|wetland|Wolf Clan|woodland|\bXibar\b|Yavash|Yoakena|Zaulfung|Zhamikhh|Zoluren)")) then var stagl $1
if (matchre ("%tap", "(\bblue\b|azure|bluish|\bceil\b|cerulean|cobalt|\bcyan\b|cyaneous|indigo|\bteal\b|turquoise|ultramarine)")) then var ctagb $1
if (matchre ("%tap", "(\bebon\b|alabaster|argent|arsenic|\bashen\b|beige|\bblack\b|camouflage|cinereous|colorless|\bcream\b|eggshell|eisen|feldgrau|glaucous|gr[ae]y|ivory|pellucid|platinum|\bsable\b|silver|taupe\b|white)")) then var ctagn $1
if (matchre ("%tap", "(\belements?\b|\ba?ether\b|\bair\b|\bearth\b|electricity|\bfires?\b|\bflames?\b|\bice\b|inferno|lightning|\bpyre\b|\bsnow\b|snowflake|thunder|water|\bwind\b)")) then var stage $1
if (matchre ("%tap", "(\bgods?\b|Immortal|Alamhif\b|Albreda\b|Aldauth|Aliesa|Aniek|Asketi|Be'?ort|Berengaria|Botolf|Chadatru|Coshivi|Damaris|Demrris|Dergati|Divyaush|Drogor|Eerayn|Eimeuz|Elide|Eluned|Enelne|\bEu|Everild|Eylhaar|Faenella|Faiyka|Firulf|Gizzbolf|Glacis|Glythtide|Harawep|Hav'?roth|Hodierna|Huldah|\bIdon|Iladza|Issendar|Kerenhappuch|Kertigen|Kirmhara|Krigglin|Kuniyo|Lemicus|Meraud|Merion|Misiumos|Mrod|Murrula|Orisas|Peri'?el|Phelim|Rutilor|Saemaus|Shariza|Sieben|Sildua|Spangklud|Sraxaec|Tamsine|Tenemlor|Thirteen|Tieheq|Triquetra|Trothfang|Truffenyi|Urrem'?tier|Ushnish|World Dragon|Xosiurion|Zachriedek)")) then var stagg $1
if (matchre ("%tap", "(\bgreen\b|asparagus|blue[- ]green|celadon|chartreuse|\blime\b|olivaceous|olive[- ]drab|smalt|\bvert\b|viridian|yellow[- ]green)")) then var ctagg $1
if (matchre ("%tap", "(\borange\b|bronze|brown|copper|fiery|ochre|\bpeach\b|persimmon|red[- ]orange|reddish[- ]orange|russet|sepia|sienna|\bsorrel\b|\btan\b|tangerine|tawny|tenne|\bumber\b|yellow[- ]orange)")) then var ctago $1
if (matchre ("%tap", "(\bred\b|auburn|blood[- ]red|burgundy|cardinal|carmine|carnelian|cerise|chestnut|claret|coquelicot|crimson|gules|haematic|incarnadine|magenta|maroon|murrey|orange[- ]red|\bpink\b|\breddish\b|\brosy\b|rubiginose|rubiginous|ruddy|sanguine|scarlet|vermilion|vinaceous)")) then var ctagr $1
if (matchre ("%tap", "(\bviolet\b|aubergine|eggplant|fuchsia|lavender|lilac|mauve|orchid|periwinkle|purple|purplish|purpure|red[- ]violet|thistle|violescent)")) then var ctagv $1
if (matchre ("%tap", "(\bwooden\b|paper|acacia|acanth|adderwood|aganylosh'?a|\balder\b|\bapple\b|\bash\b|aspen|balsa|bamboo|basswood|beech|birch|blackwood|bloodwood|boxwood|bricklebranch|burlwood|cedar|cherrywood|chestnut|cocobolo|copperleaf|copperwood|\bcork\b|cottonwood|cypress|deobar|desert palm|diamondwood|dogwood|dragonwood|driftwood|e'?erdream|ebonwood|\bebony\b|\belder\b|\belm\b|eucalyptus|\bfir\b|flamethorn|flamewood|fruitwood|gethwood|gloomwood|goldbark|goldenoak|halmik|haon|hardwood|hawthorn|hhr'?lav'?geluhh|hickory|huljik|ironwood|juniper|khor-?vela|lacewood|laurel|lemonwood|linden|linwood|lunat|mahogany|maple|mikkhalbamar|mistwood|modwir|\boak\b|\bosage\b|palmwood|papyrus|parchment|pearwood|\bpine\b|plumwood|plumwood|poplar|purpleheart|redwood|\breed\b|rosewood|rowan|sana'?ati|sandalwood|sanrisi|satinwood|shaal|silverwillow|silverwood|smokewood|softwood|spruce|taborwood|\bteak\b|vellum|walnut|whitethorn|wiirwood|willow|witchclaw|wormwood|wyndewood|\byew\b)")) then var mtagw $1
if (matchre ("%tap", "(\byellow\b|\bamber\b|aurulent|champagne|\becru\b|flaxen|gold|green[- ]yellow|jonquil|lemon|red[- ]gold|saffron|xanthic)")) then var ctagy $1
return

Specialset:
if (matchre ("%1", "(bulhawf|darghamar|dessleg|shalsnipis|sverdh)")) then var special dwarf style
if (matchre ("%1", "(celya|\bguti\b|iltesh|jiranoci|karambit|liscis|mahai|nimsha|palta|\btago\b|\btelo\b)")) then var special elf style
if (matchre ("%1", "(charovra|hourel|kanabu|keyiru)")) then var special prydaen style
if (matchre ("%1", "(grah'?uaro|hhr'?ata|hhr'?tami|hunga-munga|katavdar|kudalata|\blata\b|nehdalata|nehlata|\bpejek\b|q'?zhalata|shh'?oi'?ata|shh'?oi'?lata|tei'?oloh'?ata|\buaro\b|uenlata|uku'?uanstaho)")) then var special skra mur style
if (matchre ("%1", "(katana)")) then var special elothean style
if (matchre ("%1", "(kneecapper)")) then var special halfling style
if (matchre ("%1", "(\bava\b|cirvi|cuska|dzelt|\bkaft\b|kodur|nuja|\bsis\b|skefne|variog|zobens|zovens)")) then var special rakash style
if (matchre ("%1", "(\bulu\b)")) then var special gortog style
if (matchre ("%look", "(cambrinth)")) then var special cambrinth
if (matchre ("%look", "(Curiously, no cord, chain or other binding links the small trinkets together)")) then var special jewelry
if (matchre ("%look", "(gaethzen)")) then var special gaethzen
if (matchre ("%look", "(percussion instrument)")) then var special percussion instrument
if (matchre ("%look", "(string instrument)")) then var special string instrument
if (matchre ("%look", "(This customization can be used with any normal.+home)")) then var special housing
if (matchre ("%look", "(wind instrument)")) then var special wind instrument
if (matchre ("%tap", "((belt|carving|skinning) knife|flight glue|hide scraper|wood shaper)")) then var special creation
if (matchre ("%tap", "(acolyte|clergy|clerical|Cleric|devotional|ecclesiastic|Inquisition|Inquisitor|libation|minister|monastic|monk|\bnun\b|\bpastors?\b|prayer|preach|priest|pulpit|sham[ae]n|vestment)")) then var special cleric style
if (matchre ("%tap", "(anatomy chart)")) then var special anatomy chart
if (matchre ("%tap", "(anatomy chart)")) then var special empath style
if (matchre ("%tap", "(anloral|pilgrim's badge)")) then var special cleric style
if (matchre ("%tap", "(anloral|pilgrim's badge)")) then var special paladin style
if (matchre ("%tap", "(Barbarian|chakrel|warpaint)")) then var special barbarian style
if (matchre ("%tap", "(Bard|Bardic|neithrel|(Blood|Fate|Soul|Spirit) Knot)")) then var special bard style
if (matchre ("%tap", "(cambrinth)")) then var special cambrinth
if (matchre ("%tap", "(curry comb|hoof pick|lead rope|mane and tail brush|saddle blanket|saddle pad|stiff brush)")) then var special tack
if (matchre ("%tap", "(dracon crystal|glaysker flower|grain alcohol|mixing stick|seolarn weed|tincture jar|tukai stone|unlonchai bucket|Wayerd pyramid)")) then var special alchemy
if (matchre ("%tap", "(Dwarf|Dwarve[ns]|Haakish|\bkwarf\b|\bvalnik\b)")) then var special dwarf style
if (matchre ("%tap", "(Elf|Elve[ns]|Elvish|Ilithic|sana'?ati dyaus)")) then var special elf style
if (matchre ("%tap", "(Eloth|Gerenshuge)")) then var special elothean style
if (matchre ("%tap", "(Empath|apothecaries|apothecary|doctor|empathic|foraging|healer|healing|medicine|medic|nurse|physician|surgeon)")) then var special empath style
if (matchre ("%tap", "(gaethzen)")) then var special gaethzen
if (matchre ("%tap", "(Gnome|Gnomic|Gnomish|Gizzbolf|Krigglin|Spangklud)")) then var special gnome style
if (matchre ("%tap", "(Gor'Tog|scalp wax|togball|Toggish|Toggler)")) then var special gortog style
if (matchre ("%tap", "(Halfling|Olvi|tart pouch)")) then var halfling style
if (matchre ("%tap", "(Human|Gamgweth)")) then var human style
if (matchre ("%tap", "(Kaldar|Gorbesh|Aliesa|Aniek|Eimeuz|Merion|Misiumos|Orisas|Sieben|Sraxaec|Tieheq|Xosiurion)")) then var special kaldar style
if (matchre ("%tap", "(Moon Mage|Arid Steppe|astrologer|astrology|Celestial Compact|constellation|Crystal Hand|divination|Fortune's Path|G'nar Pethian|Heritage House|lunar|planet|Progeny|sigilbook|telescope|Tezirah|Tokka)")) then var special moon mage style
if (matchre ("%tap", "(Necromancer|necromancy|necromantic|Philosophers? of the Knife)")) then var special necromancer style
if (matchre ("%tap", "(Paladin|soulstone)")) then var special paladin style
if (matchre ("%tap", "(Prydaen|claw guards|Demrris|\bEu\b|Faiyka|Iladza|Shariza|Soul Knot|Tenemlor)")) then var special prydaen style
if (matchre ("%tap", "(Rakash|\bafis\b|Coshivi|Enelne|Moonskin|Mrod|\bturnistil\b|\bvarna\b)")) then var special rakash style
if (matchre ("%tap", "(Ranger)")) then var special ranger style
if (matchre ("%tap", "(S'?Kra|Eth'?ral'?khh|ama'?hhrsk|finger claw|Hav'?roth|Indakar|Irhhnth|Malk|mehath|Mhhg|\bmus\b|Nehgris|Peri'?el|q'?zhalata|Rasha|ru'?at|scale polish|sharmiit'?mhhg|Smolg|Sraan|tail drape|T'?Lar Venda)")) then var special skra mur style
if (matchre ("%tap", "(Thief|Thieves|\bbrigands?\b|burglar|highwaym[ae]n|pirate|robber|smuggler)")) then var special thief style
if (matchre ("%tap", "(Trader|auction|bazaar|caravan|contract|merchant)")) then var special trader style
if (matchre ("%tap", "(trail map)")) then var special ranger style
if (matchre ("%tap", "(Warrior Mage|\ba?ether\b|element|talisman)")) then var special warrior mage style
if (matchre ("%tap", "(\bharci\b)")) then var special elf style
return

Itypeset:
if (matchre ("%tap", "((awgravet|bar|bastard|battle|belaying|boarding|carving|dire|double|double-headed|duraka|elbow|flanged|footman's|giant|half-handled|hand|heavy|horseman's|hunting|hurlable|hurling|igorat|ilglaiks|imperial|k'trinni|knee|leaf blade|light|lochaber|marauder|military|mus|periperiu|pike|pole|ridged|robe|round|short|skinning|spiked|splitting|sterak|thick-bladed|thin-bladed|throwing|thrusting|twin-point|two-handed|two-headed|two-pronged|vilks|war|warring) (abassi|adze|akabo|allarh|arzfilt|ava|axe|back-sword|ball and chain|bardiche|baselard|blade|bludgeon|boko|bola|boomerang|briquet|broadaxe|broadsword|bulhawf|cane|chain|cinqueda|claws|claymore|club|condottiere|coresca|cosh|cudgel|curlade|cuska|cutlass|dagasse|dagger|dao|dart|falcata|falchion|fan|fauchard|flail|flamberge|fork|garz|gauntlet|gavel|gladius|glaive|greataxe|greathammer|greatsword|guisarme|halberd|hammer|hanger|hara|hatchet|hawkbill|hhr'ata|hhr'tami|hunthsleg|iltesh|jambiya|javelin|karambit|kasai|kaskara|katar|khuj|knife|knuckles|kodur|komno|koummya|kris|kudalata|kythe|lance|longsword|mace|mallet|mambeli|marlingspike|mattock|maul|misericorde|morning star|namkomba|nehdelata|nehlata|ngalio|nightstick|nimsha|oben|parang|partisan|pasabas|pike|pin|poignard|prod|pugio|quarterstaff|ranseur|rapier|recade|riste|sabre|sashqa|scepter|schiavona|scimitar|scythe|sha-tai|shh'oi'ata|shotel|skefne|sledgehammer|spatha|spear|spetum|spike|spikes|staff|stiletto|sunblade|sword|takouba|telek|tzece|ukabi|war hammer|zubke))")) then var itype $1
if (matchre ("%tap", "((assassin's|battle|competition|competition-balanced|dako'gi|drop-trigger|flat|flight|forester's|hirdu|horseman's|hunter's|pirate's|plains|recurved?|reflex|repeater|repeating|riot|s'rnhhl|saddle|savannah|siege|sniper's|steppe|tei'oloh|war) (arbalest|bow|chunenguti|composite bow|crossbow|hhr'ibu|jranoki|long ?bow|mahil|short ?bow|slurbow|stonebow|taisgwelduan|uku'uanstaho)|staff sling)")) then var itype $1
if (matchre ("%tap", "((battle|ceremonial|circular|crescent|curved|gladiator's|heater|jousting|kite|medium|ordinary|oval|pageant|rectangular|riot|round|rounded|shuri-kota|siege|skirmisher's|target|tower|triangular|valnik|wall|war|warrior's|wickerwork) (aegis|buckler|heater|pavise|scutum|shield|sipar|targe))")) then var itype $1
if (matchre ("%tap", "((brigandine|chain|closed|cloth|coarse|dome|field|full|great|half|heavy|insulated|lamellar|leather|light|mail|padded|plate|quilted|ring|rugged|scale|thick|visored) (aventail|backplate|balaclava|barbute|bascinet|breastplate|cap|coat|cowl|cuirass|fauld|gauntlets|gloves|greaves|hauberk|helm|hood|jerkin|leathers|lorica|mantle|mask|morion|pants|plate|robe|sallet|shirt|sleeves|tabard|tasset|thorakes|vambraces|vest))")) then var itype $1
return

Typeset:
if (matchre ("%1", "(aggahhpel|amulet|anklet|armband|armlet|badge|band|bangle|barrette|bead|boutonniere|bracelet|bracer|brooch|buckle|button|chain|charm|choker|circlet|clasp|claw|collar|cord|crown|cuff|earcuff|earring|feather|ferroniere|fetish|garland|haircomb|hairnet|hairpin|hairsticks|hip-chain|lei|locket|medal|medallion|necklace|pearls|pendant|periapt|peyvu|pilonu|pin|por'?nidrel|rasha'?hhsograth|ribbon|ring|stud|sur'?nidrel|tailband|torque|trinket|venda|wristband|wristcuff|wristlet)")) then var typefunction jewelry
if (matchre ("%1", "(aggahhpel|gamantang|pel'?hhsmur|peyvu|pilonu|por'?nidrel|rasha'?hhsograth|sur'?nidrel|uaro'?s'?sugi)")) then var typerace skra mur style
if (matchre ("%1", "(arrowhead|bobbin|bodkin|burin|flights|instructions|keyblank|mold|pattern|primer|shears|thread)")) then var typefunction creation
if (matchre ("%1", "(ashcloak)")) then var typeguild warrior mage style
if (matchre ("%1", "(ashcloak)")) then var typemagic magic
if (matchre ("%1", "(bagpipes|bassoon|cane flute|chalumeaux|clarin|cornemuse|cornet|didjeridu|fife|flute|gemshorn|hichiriki|horn|minjayrah|mirliton|mitbiq|oboe|ocarina|pan-pipes|physalis|recorder|sackbut|serpent|shakuhachi|shawm|shintu|syrinx|txistu|whistle|yarghul|zurna)")) then var typefunction wind instrument
if (matchre ("%1", "(banjo|bow|cistre|cittern|dulcimer|faenellica|fiddle|gittern|guti'?adar|harp|khurmary|kithara|lute|lyre|mandolin|nehpar'?i|psaltery|rebec|sarangi|sitar|sra'?aja?hh|strings|tambura|viol|violin|zither)")) then var typefunction string instrument
if (matchre ("%1", "(bodhran|bones|castanets|cymbals|damaru|darje|doumbec|drum|frottoir|gansa-gambang|guiro|naqqara|spoons|tabla|tambourine|tapani|zills)")) then var typefunction percussion instrument
if (matchre ("%1", "(bridle|caparison|halter|saddle)")) then var typefunction tack
if (matchre ("%1", "(candle|lamp|lantern|torch)")) then var typefunction gives light
if (matchre ("%1", "(cassock|censer)")) then var typeguild cleric style
if (matchre ("%1", "(cauldron|mortar|pestle|\bstove\b|teapot|vial|\bwater\b)")) then var typefunction alchemy
if (matchre ("%1", "(doll|marionette|puppet|toy)")) then var typefunction toy
if (matchre ("%1", "(feedbag)")) then var typeguild trader style
if (matchre ("%1", "(josta|krekls|laufisana|nauda|odaj|rantija|rugursora|safost?|\bsega\b|vikses|vluze)")) then var typerace rakash style
if (matchre ("%1", "(cheongsam|\bchola\b|\bcholi\b|kimono|\bsari\b)")) then var typerace elothean style
if (matchre ("%1", "(mra'?sin|pr'?chmin|pr'?chmir|pr'?mra'?sin|pr'?raaho|pr'?sarrak|pr'?ysin|ra'?sarrak|\bsarrak\b)")) then var typerace prydaen style
if (matchre ("%1", "(sigilbook|starchart|telescope)")) then var typeguild moon mage style
if (matchre ("%1", "(warhorn)")) then var typeguild barbarian style
if (matchre ("%1", "(warhorn)")) then var typeguild bard style
if (matchre ("%1", "(\balb\b|apron|ashcloak|balac|baladrana|ballgown|bandeau|belt|beret|blouse|bodice|bodysuit|bonnet|boots|breeches|britches|brogans|caftan|\bcap\b|cape|cassock|catils|chemise|cheongsam|\bchola\b|\bcholi\b|cloak|cloche|clogs|coat|coinec|corset|cummerbund|deerstalker|derby|dirndl|doublet|drape|dress|eyepatch|fabric|fedora|fillet|frock|galoshes|gamantang|garter|gerri|gloves|gown|\bhac\b|\bhat\b|headband|hood|hose|ilalish|jacket|jerkin|jodhpurs|josta|khandur|kilt|kimono|kirtle|knickers|krekls|leggings|leine|loafers|loincloth|mantle|mask|mittens|mocc?ass?ins|mra'?sin|\bmuff\b|muffler|nauda|odaj|overalls|pall|pantaloons|pants|pel'?hhsmur|pelt|poncho|pumps|robe|ruff|safros|sandals|\bsari\b|sarong|sarrak|sash|scarf|shawl|shift|shirt|shoes|shroud|skirt|skullcap|slacks|slippers|smock|snood|sochi|socks|stockings|stole|\bsuit\b|sundress|surcoat|suspenders|sweater|tabard|takbahn|\btam\b|tights|toga|trews|trousers|tunic|turban|uaro'?s'?sugi|veil|vest|vikses|vluze|waistcoat|wimple|wing|wrap)")) then var typefunction clothing
if (matchre ("%1", "(\barca\b|balac|catils|coinec|gerri|\bhac\b|ilalish|takbahn)")) then var typerace elf style
if (matchre ("%look", "(cambrinth)")) then var typemagic cambrinth
if (matchre ("%look", "(Curiously, no cord, chain or other binding links the small trinkets together)")) then var typefunction jewelry
if (matchre ("%look", "(gaethzen)")) then var typemagic gaethzen
if (matchre ("%look", "(percussion instrument)")) then var typefunction percussion instrument
if (matchre ("%look", "(string instrument)")) then var typefunction string instrument
if (matchre ("%look", "(This customization can be used with any normal.+home)")) then var typefunction housing
if (matchre ("%look", "(wind instrument)")) then var typefunction wind instrument
if (matchre ("%tap", "((belt|carving|skinning) knife|flight glue|hide scraper|wood shaper)")) then var typefunction creation
if (matchre ("%tap", "(acolyte|clergy|clerical|Cleric|devotional|ecclesiastic|Inquisition|Inquisitor|libation|minister|monastic|monk|\bnun\b|\bpastors?\b|prayer|preach|priest|pulpit|sham[ae]n|vestment)")) then var typeguild cleric style
if (matchre ("%tap", "(anatomy chart)")) then var typefunction anatomy chart
if (matchre ("%tap", "(anatomy chart)")) then var typeguild empath style
if (matchre ("%tap", "(anloral|pilgrim's badge)")) then var typeguild cleric style
if (matchre ("%tap", "(anloral|pilgrim's badge)")) then var typeguild paladin style
if (matchre ("%tap", "(Barbarian|chakrel|warpaint)")) then var typeguild barbarian style
if (matchre ("%tap", "(Bard|Bardic|neithrel|(Blood|Fate|Soul|Spirit) Knot)")) then var typeguild bard style
if (matchre ("%tap", "(cambrinth)")) then var typemagic cambrinth
if (matchre ("%tap", "(curry comb|hoof pick|lead rope|mane and tail brush|saddle blanket|saddle pad|stiff brush)")) then var typefunction tack
if (matchre ("%tap", "(dracon crystal|glaysker flower|grain alcohol|mixing stick|seolarn weed|tincture jar|tukai stone|unlonchai bucket|Wayerd pyramid)")) then var typefunction alchemy
if (matchre ("%tap", "(Dwarf|Dwarve[ns]|Haakish|\bkwarf\b|\bvalnik\b)")) then var typerace dwarf style
if (matchre ("%tap", "(Elf|Elve[ns]|Elvish|Ilithic|sana'?ati dyaus)")) then var typerace elf style
if (matchre ("%tap", "(Eloth|Gerenshuge|shesegri)")) then var typerace elothean style
if (matchre ("%tap", "(Empath|apothecaries|apothecary|doctor|empathic|foraging|healer|healing|medicine|medic|nurse|physician|surgeon)")) then var typeguild empath style
if (matchre ("%tap", "(gaethzen)")) then var typemagic gaethzen
if (matchre ("%tap", "(Gnome|Gnomic|Gnomish|Gizzbolf|Krigglin|Spangklud)")) then var typerace gnome style
if (matchre ("%tap", "(Gor'Tog|scalp wax|togball|Toggish|Toggler)")) then var typerace gortog style
if (matchre ("%tap", "(Halfling|Olvi|tart pouch)")) then var halfling style
if (matchre ("%tap", "(Human|Gamgweth)")) then var human style
if (matchre ("%tap", "(Kaldar|Gorbesh|Aliesa|Aniek|Eimeuz|Merion|Misiumos|Orisas|Sieben|Sraxaec|Tieheq|Xosiurion)")) then var typerace kaldar style
if (matchre ("%tap", "(Moon Mage|Arid Steppe|astrologer|astrology|Celestial Compact|constellation|Crystal Hand|divination|Fortune's Path|G'nar Pethian|Heritage House|lunar|planet|Progeny|sigilbook|telescope|Tezirah|Tokka)")) then var typeguild moon mage style
if (matchre ("%tap", "(Necromancer|necromancy|necromantic|Philosophers? of the Knife)")) then var typeguild necromancer style
if (matchre ("%tap", "(Paladin|soulstone)")) then var typeguild paladin style
if (matchre ("%tap", "(Prydaen|claw guards|Demrris|\bEu\b|Faiyka|Iladza|Shariza|Tenemlor)")) then var typerace prydaen style
if (matchre ("%tap", "(Soul Knot)")) then var typerace prydaen style
if (matchre ("%tap", "(Rakash|\bafis\b|Coshivi|Enelne|Moonskin|Mrod|\bturnistil\b|\bvarna\b)")) then var typerace rakash style
if (matchre ("%tap", "(Ranger)")) then var typeguild ranger style
if (matchre ("%tap", "(S'?Kra|Eth'?ral'?khh|ama'?hhrsk|finger claw|Hav'?roth|Indakar|Irhhnth|Malk|mehath|Mhhg|\bmus\b|Nehgris|Peri'?el|q'?zhalata|Rasha|ru'?at|scale polish|sharmiit'?mhhg|Smolg|Sraan|tail drape|T'?Lar Venda)")) then var typerace skra mur style
if (matchre ("%tap", "(Thief|Thieves|\bbrigands?\b|burglar|highwaym[ae]n|pirate|robber|smuggler)")) then var typeguild thief style
if (matchre ("%tap", "(Trader|auction|bazaar|caravan|contract|merchant)")) then var typeguild trader style
if (matchre ("%tap", "(trail map)")) then var typeguild ranger style
if (matchre ("%tap", "(Warrior Mage|\ba?ether\b|element|talisman)")) then var typeguild warrior mage style
if (matchre ("%tap", "(\btoy\b)")) then var typefunction toy
return

CommaAppcost:
var commanumber %appcostk
eval length len(%commanumber)
var appcost %commanumber
if %length < 4 then goto return
evalmath length %length - 3
eval temp substr(%commanumber, %length, 3)
var appcost %temp
topapp:
if %length < 3 then goto lastapp
evalmath length %length - 3
eval temp substr(%commanumber, %length, 3)
var appcost %temp,%appcost
goto topapp
lastapp:
if %length > 0 then
{
eval temp substr(%commanumber, 0, %length)
var appcost %temp,%appcost
}
goto return

CommaCost:
var commanumber %costi
eval length len(%commanumber)
var cost %commanumber
if %length < 4 then goto return
evalmath length %length - 3
eval temp substr(%commanumber, %length, 3)
var cost %temp
topcost:
if %length < 3 then goto lastcost
evalmath length %length - 3
eval temp substr(%commanumber, %length, 3)
var cost %temp,%cost
goto topcost
lastcost:
if %length > 0 then
{
eval temp substr(%commanumber, 0, %length)
var cost %temp,%cost
}
goto return

return:
return

end:
send shop
waitfor [Type SHOP [ITEM] to see what's on it.]
send shop $shop
waitfor [Type SHOP [GOOD] to see some details about it.]
echo Last noun: %1 ($preposition $shop)
put #play ScriptEnd
put #flash
exit