Elanthipedia Shops (script): Difference between revisions

From Elanthipedia
Jump to navigation Jump to search
No edit summary
 
(27 intermediate revisions by the same user not shown)
Line 13: Line 13:
===Syntax===
===Syntax===


{{tt|.eshop [item noun] (yes)}}: Type yes if you want the script to create the ''Store At A Glance'' and ''ShopDescription'' sections. Otherwise, just type the item noun. (''Store At A Glance'' is used once per shop. ''ShopDescription'' is used once per room.
{{tt|.eshop (yes)}}: Type yes if you want the script to create the ''Store At A Glance'' and ''ShopDescription'' sections. (''Store At A Glance'' is used once per shop. ''ShopDescription'' is used once per room.


A menu will prompt you to select the type of item you're adding:
A menu will prompt you to select the type of item you're adding:
Line 20: Line 20:
#Shield
#Shield
#Armor/Barding
#Armor/Barding
#Item: Clothing
#Item: Jewelry
#Item: Housing
#Item: Food/Drink
#Item: Other
#Item: Other
<br>
<br>
Line 31: Line 27:
You must install and use this alias to set the shop surface variable.
You must install and use this alias to set the shop surface variable.


<pre>#alias {sv} {#var shop $0}</pre>
<pre>#alias {aps} {appraise $0 $preposition $shop quick}
#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}</pre>
<br>
<br>
The "shop surface" is the thing on which the item is placed (for example, ''table'', ''second rack'', or '' oak shelf'').
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.



----
----
Line 42: Line 41:
#trigger {^You .+ worth .+ kronars} {#var currency Kronars}
#trigger {^You .+ worth .+ kronars} {#var currency Kronars}
#trigger {^You .+ worth .+ lirums} {#var currency Lirums}</pre>
#trigger {^You .+ worth .+ lirums} {#var currency Lirums}</pre>



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


<pre>#trigger {^In .+, you see:$} {#var preposition in}
<pre>#trigger {^Behind .+, you see:$} {#var preposition behind}
#trigger {^In .+, you see:$} {#var preposition in}
#trigger {^On .+, you see:$} {#var preposition on}
#trigger {^On .+, you see:$} {#var preposition on}
#trigger {^Under .+, you see:$} {#var preposition under}</pre>
#trigger {^Under .+, you see:$} {#var preposition under}</pre>
Line 60: Line 59:
The following items contain goods for sale:
The following items contain goods for sale:


an antique fretwork table
an iron hook
a huge cedar rack
a birch pedestal
a birch pedestal
a huge cedar rack
an iron hook</pre>
an antique fretwork table

[Type SHOP [ITEM] to see what's on it.]</pre>


The first surface with items to buy is the antique fretwork table, so you type '''sv fretwork table''' to set the shop surface variable. (You won't see anything when you do this.)<br>
The first surface with items to buy is the antique fretwork table, so you type '''sv fretwork table''' to set the shop surface variable. (You won't see anything when you do this.)<br>
Line 72: Line 73:
On the fretwork table, you see:
On the fretwork table, you see:


a mammoth Dergati war icon set atop a haft of black walnut for 902000 copper Dokoras
a mammoth Botolf war icon set atop a bloodstained haft of hickory for 902000 copper Dokoras
a mammoth Trothfang war icon set atop a haft of veiny copperwood for 902000 copper Dokoras
a mammoth Be'ort war icon set atop a haft of weeping willow for 902000 copper Dokoras
a mammoth Idon war icon set atop a sculpted haft of satinwood for 902000 copper Dokoras
a mammoth Kerenhappuch war icon set atop a red-gold haft of rosewood for 902000 copper Dokoras
a mammoth Asketi war icon set atop a haft of blighted mikkhalbamar for 902000 copper Dokoras
a mammoth Asketi war icon set atop a haft of blighted mikkhalbamar for 902000 copper Dokoras
a mammoth Huldah war icon set atop a haft of silver-green mistwood for 902000 copper Dokoras
a mammoth Huldah war icon set atop a haft of silver-green mistwood for 902000 copper Dokoras
a mammoth Drogor war icon set atop a sea-worn haft of teak for 902000 copper Dokoras</pre>
a mammoth Dergati war icon set atop a haft of black walnut for 902000 copper Dokoras
a mammoth Trothfang war icon set atop a haft of veiny copperwood for 902000 copper Dokoras
a mammoth Harawep war icon set atop a haft of burrowed oak for 902000 copper Dokoras

The inventory of an antique fretwork table rotates.

[Type SHOP [GOOD] to see some details about it.]</pre>


To run the script, you type '''.eshop icon yes'''. (Typing "yes" causes the script to generate a "Store At A Glance" and a "ShopDescription." If you already had that, you'd just type '''.eshop icon'''.)
To run the script, you type '''.eshop yes'''. (Typing "yes" causes the script to generate a "Store At A Glance" and a "ShopDescription." If you already had that, you'd just type '''.eshop'''.)


<pre>ITEM TYPE:
<pre>ITEM TYPE:
Line 90: Line 95:
3: Armor/Barding
3: Armor/Barding


4: Item: Clothing
4: Item: Other

5: Item: Jewelry

6: Item: Housing

7: Item: Food/Drink

8: Item: Other


Enter Type Number:</pre>
Enter Type Number:</pre>
Line 104: Line 101:
The war icon is a weapon, so you enter '''1'''.<br>
The war icon is a weapon, so you enter '''1'''.<br>
<br>
<br>
The script "shops" each of the war icons and then generates a ShopHeader section with item links and prices.<br>
The script then generates a ShopHeader section with item links and prices.<br>
<br>
<br>
Once it's done, you move on to the ''huge cedar rack''. (Type '''sv cedar rack''' and then '''shs'''.)
Once it's done, you move on to the ''huge cedar rack''. (Type '''sv cedar rack''' and then '''shs'''.)
Line 111: Line 108:
On the cedar rack, you see:
On the cedar rack, you see:


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


[Type SHOP [GOOD] to see some details about it.]</pre>
The scimitar is the first item listed, so start with that by typing '''.eshop scimitar'''. (You don't type ''yes'' this time, because you already have the Store At A Glance and a ShopDescription.)<br>

<br>
Wait for the script to finish, and then type '''.eshop star'''. Keep doing this until you have done all of the items on the cedar rack.<br>
Start by typing '''.eshop'''. (You don't type ''yes'' this time, because you already have the Store At A Glance and a ShopDescription.)<br>
<br>
<br>
When you're done with the room, move on to the next room (if there is one) or open your Shop log (if that was the last room). Every time you move to a new room, include "yes" to generate the room's ShopDescription.
Repeat this process for every shop surface in the room. When you're done with the room, move on to the next room (if there is one) or open your Shop log (if that was the last room). Every time you move to a new room, include "yes" to generate the room's ShopDescription.


====Editing the Shop Form====
====Editing the Shop Form====
Line 144: Line 141:
|restrict =
|restrict =
|levelres =
|levelres =
|Store Type =[Guild],[Race],Alchemy,Armor,Barber,Casino,Clothing,Container,Cosmetics,Drink,Dye,Embroidery,Engraving,Face Painting,Fishing Supply,Fletching,Florist,Food,Forging Supply,Gem,General,Heraldry,Herb,Horse,Housing,Jewelry,Locksmithing,Magic,MAMAS,Map,Miscellaneous,Music,Origami,Perfume,Pet,Repair,Shield,Tack,Tanning,Tattoo,Tobacco,Toy,Trinket,Weapon,Wedding
|Store Type =[Guild],[Race],Alchemy,Armor,Barber,Boat,Cambrinth,Casino,Clothing,Container,Cosmetics,Crafting,Drink,Dye,Embroidery,Engraving,Estate Holder,Face Painting,Festival,Fishing Supply,Fletching,Florist,Food,Forging Supply,Furrier,Game,Gem,General,Heraldry,Herb,Hider,Horse,Housing,Jewelry,Juggling,Locksmithing,Magic,MAMAS,Map,Miscellaneous,Music,Origami,Pawn,Perfume,Pet,Rare Materials,Repair,Shield,Spellbook,Tack,Tanning,Tattoo,Tobacco,Toy,Trinket,Vault Furniture,Weapon,Wedding
|Fest =
|Fest =
|Coin =Dokoras
|Coin =Dokoras
Line 150: Line 147:
{{ShopDescription
{{ShopDescription
|roomname=Misenseor Goods, Zealous Destruction
|roomname=Misenseor Goods, Zealous Destruction
|desc=The pinewood walls enclosing this side of the wagon are equipped with implements of battle for the use of warrior monks. Large twin bowls, filled with red liquid, flank a stylized thirteen-pointed star burnt into the wall between the room's two egresses.<br>
|desc=The pinewood walls enclosing this side of the shop are equipped with implements of battle for the use of warrior monks. Large twin bowls, filled with red liquid, flank a stylized thirteen-pointed star burnt into the wall between the room's two egresses.<br />
You also see an antique fretwork table with several things on it, a huge cedar rack with several things on it, a birch pedestal with several things on it and an iron hook with a strap of braided mey mosshair on it.<br>
You also see an iron hook with a strap of braided mey mosshair on it, a birch pedestal with several things on it, a huge cedar rack with several things on it and an antique fretwork table with several things on it.<br />
Obvious exits: southwest, northwest.
Obvious exits: southwest, northwest.
}}
}}
{{ShopHeader|title=On the fretwork table}}
{{ShopHeader|title=On the fretwork table}}
{{ShopItem|t=w|mammoth Dergati war icon set atop a haft of black walnut|902,000}}
{{ShopItem|t= w | mammoth Kerenhappuch war icon set atop a red-gold haft of rosewood | 902000 }}
{{ShopItem|t=w|mammoth Trothfang war icon set atop a haft of veiny copperwood|902,000}}
{{ShopItem|t= w | mammoth Zachriedek war icon set atop a haft of sickly aspen | 902000 }}
{{ShopItem|t=w|mammoth Idon war icon set atop a sculpted haft of satinwood|902,000}}
{{ShopItem|t= w | mammoth Botolf war icon set atop a bloodstained haft of hickory | 902000 }}
{{ShopItem|t=w|mammoth Kerenhappuch war icon set atop a red-gold haft of rosewood|902,000}}
{{ShopItem|t= w | mammoth Be'ort war icon set atop a haft of weeping willow | 902000 }}
{{ShopItem|t=w|mammoth Asketi war icon set atop a haft of blighted mikkhalbamar|902,000}}
{{ShopItem|t= w | mammoth Asketi war icon set atop a haft of blighted mikkhalbamar | 902000 }}
{{ShopItem|t=w|mammoth Huldah war icon set atop a haft of silver-green mistwood|902,000}}
{{ShopItem|t= w | mammoth Huldah war icon set atop a haft of silver-green mistwood | 902000 }}
{{ShopItem|t=w|mammoth Drogor war icon set atop a sea-worn haft of teak|902,000}}
{{ShopItem|t= w | mammoth Trothfang war icon set atop a haft of veiny copperwood | 902000 }}
|}
|}
{{ShopHeader|title=On the cedar rack}}
{{ShopHeader|title=On the cedar rack}}
{{ShopItem|t=w|silver-bladed scimitar with a hilt wrapped in midnight-blue scaled leather|13,530}}
{{ShopItem|t= w | silver-blue scythewing moth handwraps | 72160 }}
{{ShopItem|t=w|golden-bladed scimitar with a hilt wrapped in metallic-red scaled leather|13,530}}
{{ShopItem|t= w | holy water sprinkler studded with stony basilisk fangs | 99220 }}
{{ShopItem|t= w | steel jambiya with a hilt wrapped in membranous kartais wing | 36080 }}
|}
{{ShopItem|t= w | serrated bone-white scythe hung with a pair of sluagh claws | 63140 }}
{{ShopHeader|title=On the cedar rack}}
{{ShopItem|t=w|morning star studded with Adan'f tail barbs|10,824}}
{{ShopItem|t= w | twisted black horn | 8118 }}
{{ShopItem|t= w | dark crimson sword etched with spidery lightning | 8118 }}
|}
{{ShopItem|t= w | golden-bladed scimitar with a hilt wrapped in metallic-red scaled leather | 13530 }}
{{ShopHeader|title=On the cedar rack}}
{{ShopItem|t=w|granite mace sculpted like a gaunt greenish fist|4,510}}
{{ShopItem|t= w | oaken impalement stake branded with viperous coils | 9020 }}
{{ShopItem|t= w | granite mace sculpted like a gaunt greenish fist | 4510 }}
|}
{{ShopItem|t= w | morning star studded with Adan'f tail barbs | 10824 }}
{{ShopHeader|title=On the cedar rack}}
{{ShopItem|t=w|oaken impalement stake branded with viperous coils|9,020}}
{{ShopItem|t= w | silver-bladed scimitar with a hilt wrapped in midnight-blue scaled leather | 13530 }}
|}
{{ShopHeader|title=On the cedar rack}}
{{ShopItem|t=w|dark crimson sword etched with spidery lightning|8,118}}
|}
{{ShopHeader|title=On the cedar rack}}
{{ShopItem|t=w|twisted black horn|8,118}}
|}
{{ShopHeader|title=On the cedar rack}}
{{ShopItem|t=w|serrated bone-white scythe hung with a pair of sluagh claws|63,140}}
|}
{{ShopHeader|title=On the cedar rack}}
{{ShopItem|t=w|steel jambiya with a hilt wrapped in membranous kartais wing|36,080}}
|}
{{ShopHeader|title=On the cedar rack}}
{{ShopItem|t=w|holy water sprinkler studded with stony basilisk fangs|99,220}}
|}
{{ShopHeader|title=On the cedar rack}}
{{ShopItem|t=w|silver-blue scythewing moth handwraps|72,160}}
|}</pre>
|}</pre>


Line 201: Line 180:
#If there are no restrictions or circle requirements, you can delete those lines.
#If there are no restrictions or circle requirements, you can delete those lines.
#Store Types: Delete whatever types don't apply. If this shop has items that are for a particular guild or race, fill those out.
#Store Types: Delete whatever types don't apply. If this shop has items that are for a particular guild or race, fill those out.
#Fest: This is Hollow Eve Festival 403.
#Fest: This is Hollow Eve Festival 410.


<pre>{{Store At A Glance
<pre>{{Store At A Glance
Line 208: Line 187:
|NumRooms =5
|NumRooms =5
|Store Type =Cleric,Paladin,Clothing,Container,Jewelry,Magic,Weapon
|Store Type =Cleric,Paladin,Clothing,Container,Jewelry,Magic,Weapon
|Fest =Hollow Eve Festival 403
|Fest =Hollow Eve Festival 410
|Coin =Dokoras
|Coin =Dokoras
}}</pre>
}}</pre>


If the prices were written in something other than coppers, there will be underscores. Delete the underscores.
If you have more than one Store At A Glance table, delete the others. (You'll have more than one Store At A Glance table if the shop has more than one room.) ShopDescription should not need editing.<br>
<br>
If you had to run the script more than once per surface, as you did with the cedar rack, you'll need to merge those ShopHeader tables into one table.


Add commas to prices that are 1,000 or greater. I left tabs between each field of the inventory table. This allows you to copy and paste the ShopItem lines into Excel to automatically add commas to the prices that are 1,000 or greater. If you would prefer to manually add the commas, I've included a version without tabs.
<pre>{{ShopHeader|title=On the cedar rack}}
{{ShopItem|t=w|silver-bladed scimitar with a hilt wrapped in midnight-blue scaled leather|13,530}}
{{ShopItem|t=w|golden-bladed scimitar with a hilt wrapped in metallic-red scaled leather|13,530}}
{{ShopItem|t=w|morning star studded with Adan'f tail barbs|10,824}}
{{ShopItem|t=w|granite mace sculpted like a gaunt greenish fist|4,510}}
{{ShopItem|t=w|oaken impalement stake branded with viperous coils|9,020}}
{{ShopItem|t=w|dark crimson sword etched with spidery lightning|8,118}}
{{ShopItem|t=w|twisted black horn|8,118}}
{{ShopItem|t=w|serrated bone-white scythe hung with a pair of sluagh claws|63,140}}
{{ShopItem|t=w|steel jambiya with a hilt wrapped in membranous kartais wing|36,080}}
{{ShopItem|t=w|holy water sprinkler studded with stony basilisk fangs|99,220}}
{{ShopItem|t=w|silver-blue scythewing moth handwraps|72,160}}
|}</pre>


Delete the tabs.
The last step is to make sure those items are listed in the right order. (They might be out of order if you had more than one item of the same type.) In this case, only the ''golden-bladed scimitar with a hilt wrapped in metallic-red scaled leather'' is out of place.


<pre>{{ShopHeader|title=On the cedar rack}}
<pre>{{ShopHeader|title=On the fretwork table}}
{{ShopItem|t=w|silver-bladed scimitar with a hilt wrapped in midnight-blue scaled leather|13,530}}
{{ShopItem|t=w|mammoth Kerenhappuch war icon set atop a red-gold haft of rosewood|902,000}}
{{ShopItem|t=w|morning star studded with Adan'f tail barbs|10,824}}
{{ShopItem|t=w|mammoth Zachriedek war icon set atop a haft of sickly aspen|902,000}}
{{ShopItem|t=w|granite mace sculpted like a gaunt greenish fist|4,510}}
{{ShopItem|t=w|mammoth Botolf war icon set atop a bloodstained haft of hickory|902,000}}
{{ShopItem|t=w|oaken impalement stake branded with viperous coils|9,020}}
{{ShopItem|t=w|mammoth Be'ort war icon set atop a haft of weeping willow|902,000}}
{{ShopItem|t=w|golden-bladed scimitar with a hilt wrapped in metallic-red scaled leather|13,530}}
{{ShopItem|t=w|mammoth Asketi war icon set atop a haft of blighted mikkhalbamar|902,000}}
{{ShopItem|t=w|dark crimson sword etched with spidery lightning|8,118}}
{{ShopItem|t=w|mammoth Huldah war icon set atop a haft of silver-green mistwood|902,000}}
{{ShopItem|t=w|twisted black horn|8,118}}
{{ShopItem|t=w|mammoth Trothfang war icon set atop a haft of veiny copperwood|902,000}}
|}
{{ShopItem|t=w|serrated bone-white scythe hung with a pair of sluagh claws|63,140}}

{{ShopItem|t=w|steel jambiya with a hilt wrapped in membranous kartais wing|36,080}}
{{ShopHeader|title=On the cedar rack}}
{{ShopItem|t=w|holy water sprinkler studded with stony basilisk fangs|99,220}}
{{ShopItem|t=w|silver-blue scythewing moth handwraps|72,160}}
{{ShopItem|t=w|silver-blue scythewing moth handwraps|72,160}}
{{ShopItem|t=w|holy water sprinkler studded with stony basilisk fangs|99,220}}
{{ShopItem|t=w|steel jambiya with a hilt wrapped in membranous kartais wing|36,080}}
{{ShopItem|t=w|serrated bone-white scythe hung with a pair of sluagh claws|63,140}}
{{ShopItem|t=w|twisted black horn|8,118}}
{{ShopItem|t=w|dark crimson sword etched with spidery lightning|8,118}}
{{ShopItem|t=w|golden-bladed scimitar with a hilt wrapped in metallic-red scaled leather|13,530}}
{{ShopItem|t=w|oaken impalement stake branded with viperous coils|9,020}}
{{ShopItem|t=w|granite mace sculpted like a gaunt greenish fist|4,510}}
{{ShopItem|t=w|morning star studded with Adan'f tail barbs|10,824}}
{{ShopItem|t=w|silver-bladed scimitar with a hilt wrapped in midnight-blue scaled leather|13,530}}
|}</pre>
|}</pre>


Line 259: Line 234:
If there is not a "You also see" line in the room, the script will print a line that is only one line break (<nowiki><br></nowiki>). Delete that.
If there is not a "You also see" line in the room, the script will print a line that is only one line break (<nowiki><br></nowiki>). Delete that.


===Ticket Prices===
===Item Types===

If your table contains more than one type of item, you need to manually change some of the item types in the t= field. The options are:

*Weapon: w
*Shield: s
*Armor: a
*Clothing: c
*Jewelry: j
*Housing: h
*Food/Drink: f
*Items (all other): i

===Prices===

If the prices were written in something other than coppers, there will be underscores. Delete the underscores.

Add commas to prices that are 1,000 or greater. I left tabs between each field of the inventory table. This allows you to copy and paste the ShopItem lines into Excel to automatically add commas to the prices that are 1,000 or greater. If you would prefer to manually add the commas, I've included a version without tabs.

Delete the tabs.

====Ticket Prices====


If the price is in tickets, you need to add the word "Tickets" after the price. For example:
If the price is in tickets, you need to add the word "Tickets" after the price. For example:
Line 267: Line 263:
==Changelog==
==Changelog==


'''2/26/2016'''
*Added support for bloodscrip|kernels?
'''5/23/2015'''
*Removed menu support for unused item type flags
'''11/4/2013'''
*Brand new version that greatly reduces the amount of time it takes to log inventory. Please read the documentation before posting these forms to Elanthipedia.
*Added "rotating stock" footnote
'''9/25/2013'''
*Added racial item class to combat/rp class toggles.
'''11/10/2012'''
*Shortened pauses by half a second.
'''11/4/2012'''
*Added "Hider" as a shop type.
'''5/16/2012'''
*Fixed bug that prevented taps from being set on items "atop several" surfaces.
'''4/28/2012'''
*Added support for items on "two" surfaces. (This was preventing certain taps from being read.)
'''11/14/2011'''
*Added support for items on '''the''' surface. (This was preventing certain taps from being read.)
'''11/9/2011'''
*Added support for items that are ''behind'' a shop surface.
'''11/4/2011'''
'''11/4/2011'''
*Added more shop type options to the list; fixed "Store At A Glance" section so that it's not specific to [[Hollow Eve Festival 403]].
*Added more shop type options to the list; fixed "Store At A Glance" section so that it's not specific to [[Hollow Eve Festival 403]].
Line 281: Line 298:
*Added store types to "Store At A Glance." (Erase the ones that don't apply to the shop that you're editing.)
*Added store types to "Store At A Glance." (Erase the ones that don't apply to the shop that you're editing.)


==Script==
==Script (With Tabs for Excel)==


<pre>put #class rp on
<pre>put #class rp on
put #class combat off
put #class arrive off
put #class arrive off
put #class combat off
put #class joust off
put #class racial off
put #class shop off


var source $roomname
var source $roomname
Line 293: Line 313:


action setvariable shopheader $1 when ^(.+), you see:$
action setvariable shopheader $1 when ^(.+), you see:$
action setvariable tap $2 when ^You tap (a|an|some|the) (.+) (atop|inside|under) (an?|some)
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 short $2 when ^Short: (a|an|some|the) (.+)
action setvariable costi $1 when ^Cost:\s+(\d+) (Kronars|Lirums|Dokoras|Tickets)
action setvariable costi $1 when ^Cost:\s+(\d+) (Kronars?|Lirums?|Dokoras?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)


send shop $shop
send shop $shop
waitforre ^(On|In|Under).+, you see:$
waitforre ^(Behind|In|On|Under).+, you see:$


if_2 goto ShopDesc
if_1 goto ShopDesc
goto StartShop
goto StartShop


Line 307: Line 327:
put #log >Shop.txt |Store Name =$roomname
put #log >Shop.txt |Store Name =$roomname
put #log >Shop.txt |Province =
put #log >Shop.txt |Province =
put #log >Shop.txt |Town =
put #log >Shop.txt |Town =$zonename
put #log >Shop.txt |MapNumber =
put #log >Shop.txt |MapNumber =$zoneid
put #log >Shop.txt |Owner =
put #log >Shop.txt |Owner =-
put #log >Shop.txt |NumRooms =
put #log >Shop.txt |NumRooms =
put #log >Shop.txt |restrict =
put #log >Shop.txt |restrict =
put #log >Shop.txt |levelres =
put #log >Shop.txt |levelres =
put #log >Shop.txt |Store Type =[Guild],[Race],Alchemy,Armor,Barber,Casino,Clothing,Container,Cosmetics,Drink,Dye,Embroidery,Engraving,Face Painting,Fishing Supply,Fletching,Florist,Food,Forging Supply,Gem,General,Heraldry,Herb,Horse,Housing,Jewelry,Locksmithing,Magic,MAMAS,Map,Miscellaneous,Music,Origami,Perfume,Pet,Repair,Shield,Tack,Tanning,Tattoo,Tobacco,Toy,Trinket,Weapon,Wedding
put #log >Shop.txt |Store Type =[Guild], [Race], Alchemy, Alteration, Armor, Barber, Boat, Book, Cambrinth, Casino, Clothing, Container, Cosmetics, Crafting, Drink, Dye, Embroidery, Engineering, Engraving, Estate Holder, Face paint, Festival, Fletching, Florist, Food, Forging, Furrier, Games, Gem, General, Heraldry, Herb, Hider, Horse, Housing, Jewelry, Juggling, Light, Locksmithing, Magic, MAMAS, Map, Miscellaneous, Music, Origami, Outfitting, Pawn, Perfume, Pet, Rare Materials, Repair, Shield, Siegery, Smoking, Spellbook, Tack, Tanning, Tattoo, Tobacco, Toy, Trinket, Vault Furniture, Weapon, Wedding, Writing
put #log >Shop.txt |Fest =
put #log >Shop.txt |Fest =
put #log >Shop.txt |Coin =$currency
put #log >Shop.txt |Coin =$currency
Line 320: Line 340:
put #log >Shop.txt {{ShopDescription
put #log >Shop.txt {{ShopDescription
put #log >Shop.txt |roomname=$roomname
put #log >Shop.txt |roomname=$roomname
put #log >Shop.txt |desc=$roomdesc<br>
put #log >Shop.txt |desc=$roomdesc<br />
put #log >Shop.txt $roomobjs<br>
put #log >Shop.txt $roomobjs<br />
put #log >Shop.txt $roomexits
put #log >Shop.txt $roomexits
put #log >Shop.txt }}
put #log >Shop.txt }}
Line 328: Line 348:
StartShop:
StartShop:
put #log >Shop.txt "{{ShopHeader|title=%shopheader}}"
put #log >Shop.txt "{{ShopHeader|title=%shopheader}}"
echo
put #echo
echo ITEM TYPE:
put #echo ITEM TYPE:
echo
put #echo
echo 1: Weapon
put #echo 1: Weapon
echo
put #echo
echo 2: Shield
put #echo 2: Shield
echo
put #echo
echo 3: Armor/Barding
put #echo 3: Armor/Barding
echo
put #echo
echo 4: Item: Clothing
put #echo 4: Item: Other
echo
put #echo
put #echo Enter Type Number:
echo 5: Item: Jewelry
echo
echo 6: Item: Housing
echo
echo 7: Item: Food/Drink
echo
echo 8: Item: Other
echo
echo Enter Type Number:


matchre Weapon ^1
matchre Weapon ^1$
matchre Shield ^2
matchre Shield ^2$
matchre Armor ^3
matchre Armor ^3$
matchre Clothing ^4
matchre Item ^4$
matchre Jewelry ^5
matchre Housing ^6
matchre Food ^7
matchre Item ^8
matchwait
matchwait


Line 368: Line 376:
var type a
var type a
goto Shop1
goto Shop1
Item:
Clothing:
var type c
var type i
goto Shop1
goto Shop1

Jewelry:
Shop1:
var type j
action setvariable tap $2;setvariable price $3 when ^\s+(an?|some|the) (.+) for (\d+) ([Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action setvariable tap $2;setvariable price $3 when ^\s+(an?|some|the) (.+) for (\d+) copper (Kronars?|Dokoras?|Lirums?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action setvariable tap $2;setvariable price $3_0 when ^\s+(an?|some|the) (.+) for (\d+) bronze (Kronars?|Dokoras?|Lirums?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action setvariable tap $2;setvariable price $3 when ^\s+(an?|some|the) (.+) for (\d+\.\d+) bronze (Kronars?|Dokoras?|Lirums?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action setvariable tap $2;setvariable price $3_00 when ^\s+(an?|some|the) (.+) for (\d+) silver (Kronars?|Dokoras?|Lirums?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action setvariable tap $2;setvariable price $3_0 when ^\s+(an?|some|the) (.+) for (\d+\.\d+) silver (Kronars?|Dokoras?|Lirums?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action setvariable tap $2;setvariable price $3_000 when ^\s+(an?|some|the) (.+) for (\d+) gold (Kronars?|Dokoras?|Lirums?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action setvariable tap $2;setvariable price $3_00 when ^\s+(an?|some|the) (.+) for (\d+\.\d+) gold (Kronars?|Dokoras?|Lirums?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action setvariable tap $2;setvariable price $3_0000 when ^\s+(an?|some|the) (.+) for (\d+) platinum (Kronars?|Dokoras?|Lirums?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action setvariable tap $2;setvariable price $3_000 when ^\s+(an?|some|the) (.+) for (\d+\.\d+) platinum (Kronars?|Dokoras?|Lirums?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action put #log >Shop.txt "{{ShopItem|t= %type | %tap | %price }}" when for (\S+) (copper|bronze|silver|gold|platinum) (Kronars?|Dokoras?|Lirums?)$
action put #log >Shop.txt "{{ShopItem|t= %type | %tap | %price }}" when for (\S+) ([Tt]ickets?|bloodscrip|kernels?|[Ff]ame)
action put #log >Shop.txt "{{ShopFootnote|rotating stock}}" when ^The inventory of.+rotates\.$
send shop $shop
waitfor [Type SHOP [GOOD] to see some details about it.]
pause 1
goto end

end:
put #log >Shop.txt |}
send shop
put #class racial on
exit</pre>

==Script (Without Tabs)==

<pre>put #class rp on
put #class arrive off
put #class combat off
put #class joust off
put #class racial off
put #class shop off

var source $roomname
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 shopheader $1 when ^(.+), you see:$
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 costi $1 when ^Cost:\s+(\d+) (Kronars?|Lirums?|Dokoras?|Tickets?|bloodscrip|kernels?)

send shop $shop
waitforre ^(Behind|In|On|Under).+, you see:$

if_2 goto ShopDesc
goto StartShop

ShopDesc:
put #log >Shop.txt {{Store At A Glance
put #log >Shop.txt |Store Name =$roomname
put #log >Shop.txt |Province =
put #log >Shop.txt |Town =$zonename
put #log >Shop.txt |MapNumber =$zoneid
put #log >Shop.txt |Owner =-
put #log >Shop.txt |NumRooms =
put #log >Shop.txt |restrict =
put #log >Shop.txt |levelres =
put #log >Shop.txt |Store Type =[Guild], [Race], Alchemy, Alteration, Armor, Barber, Boat, Book, Cambrinth, Casino, Clothing, Container, Cosmetics, Crafting, Drink, Dye, Embroidery, Engineering, Engraving, Estate Holder, Face paint, Festival, Fletching, Florist, Food, Forging, Furrier, Games, Gem, General, Heraldry, Herb, Hider, Horse, Housing, Jewelry, Juggling, Light, Locksmithing, Magic, MAMAS, Map, Miscellaneous, Music, Origami, Outfitting, Pawn, Perfume, Pet, Rare Materials, Repair, Shield, Siegery, Smoking, Spellbook, Tack, Tanning, Tattoo, Tobacco, Toy, Trinket, Vault Furniture, Weapon, Wedding, Writing
put #log >Shop.txt |Fest =
put #log >Shop.txt |Coin =$currency
put #log >Shop.txt }}
put #log >Shop.txt
put #log >Shop.txt {{ShopDescription
put #log >Shop.txt |roomname=$roomname
put #log >Shop.txt |desc=$roomdesc<br />
put #log >Shop.txt $roomobjs<br />
put #log >Shop.txt $roomexits
put #log >Shop.txt }}
put #log >Shop.txt

StartShop:
put #log >Shop.txt "{{ShopHeader|title=%shopheader}}"
put #echo
put #echo ITEM TYPE:
put #echo
put #echo 1: Weapon
put #echo
put #echo 2: Shield
put #echo
put #echo 3: Armor/Barding
put #echo
put #echo 4: Item: Other
put #echo
put #echo Enter Type Number:

matchre Weapon ^1$
matchre Shield ^2$
matchre Armor ^3$
matchre Item ^4$
matchwait

Weapon:
var type w
goto Shop1
goto Shop1
Shield:
Housing:
var type h
var type s
goto Shop1
goto Shop1
Armor:
Food:
var type f
var type a
goto Shop1
goto Shop1
Item:
Item:
Line 430: Line 533:
send shop %number %1 $preposition $shop
send shop %number %1 $preposition $shop
waitforre ^Short
waitforre ^Short
pause
pause .5
gosub CommaCost
gosub CommaCost
put #log >Shop.txt "{{ShopItem|t=%type|%tap|%cost}}"
put #log >Shop.txt "{{ShopItem|t=%type|%tap|%cost}}"
Line 464: Line 567:
put #log >Shop.txt |}
put #log >Shop.txt |}
send shop
send shop
waitfor [Type SHOP [ITEM] to see what's on it.]
waitforre ^\[Type SHOP \[ITEM\] to see what's on it|^There is nothing to buy here
send shop $shop
send shop $shop
waitfor [Type SHOP [GOOD] to see some details about it.]
waitforre ^\[Type SHOP \[GOOD\] to see some details about it|^There is nothing to buy here
echo Last noun: %1 ($preposition $shop)
put #echo Last noun: %1 ($preposition $shop)
put #class racial on
exit</pre>
exit</pre>

Latest revision as of 18:22, 11 November 2019

Elanthipedia Shops (script)
Category information
Front-end Genie
Author Isharon


This script creates Elanthipedia forms for shops (that use the SHOP verb). The results are logged to the Shop file in Genie's Logs folder.

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

Instructions

Syntax

.ESHOP (YES): Type yes if you want the script to create the Store At A Glance and ShopDescription sections. (Store At A Glance is used once per shop. ShopDescription is used once per room.

A menu will prompt you to select the type of item you're adding:

  1. Weapon
  2. Shield
  3. Armor/Barding
  4. Item: Other


Required Genie Settings

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

#alias {aps} {appraise $0 $preposition $shop quick}
#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}

Sample Usage (Walkthrough)

Running the Script

You want to add inventory for Misenseor Goods (4), so you go to a room in that shop. (For the purpose of this walkthrough, I will assume that nothing has been posted on this shop's page.)

> shop
The following items contain goods for sale:

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

[Type SHOP [ITEM] to see what's on it.]

The first surface with items to buy is the antique fretwork table, so you type sv fretwork table 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 table).

> shs
On the fretwork table, you see:

  a mammoth Botolf war icon set atop a bloodstained haft of hickory for 902000 copper Dokoras
  a mammoth Be'ort war icon set atop a haft of weeping willow for 902000 copper Dokoras
  a mammoth Asketi war icon set atop a haft of blighted mikkhalbamar for 902000 copper Dokoras
  a mammoth Huldah war icon set atop a haft of silver-green mistwood for 902000 copper Dokoras
  a mammoth Dergati war icon set atop a haft of black walnut for 902000 copper Dokoras
  a mammoth Trothfang war icon set atop a haft of veiny copperwood for 902000 copper Dokoras
  a mammoth Harawep war icon set atop a haft of burrowed oak for 902000 copper Dokoras

The inventory of an antique fretwork table rotates.

[Type SHOP [GOOD] to see some details about it.]

To run the script, you type .eshop yes. (Typing "yes" causes the script to generate a "Store At A Glance" and a "ShopDescription." If you already had that, you'd just type .eshop.)

ITEM TYPE:

1:	Weapon

2:	Shield

3:	Armor/Barding

4:	Item: Other

Enter Type Number:

The war icon is a weapon, so you enter 1.

The script then generates a ShopHeader section with item links and prices.

Once it's done, you move on to the huge cedar rack. (Type sv cedar rack and then shs.)

> shs
On the cedar rack, you see:

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

[Type SHOP [GOOD] to see some details about it.]

Start by typing .eshop. (You don't type yes this time, because you already have the Store At A Glance and a ShopDescription.)

Repeat this process for every shop surface in the room. When you're done with the room, move on to the next room (if there is one) or open your Shop log (if that was the last room). Every time you move to a new room, include "yes" to generate the room's ShopDescription.

Editing the Shop Form

See Required Manual Editing (below) for details about how to edit shop forms.

When you're done with the fretwork table and the cedar rack, your Shop log should look like this:

{{Store At A Glance
|Store Name =Misenseor Goods, Zealous Destruction
|Province =
|Town =
|MapNumber =
|Owner =n
|NumRooms =
|restrict =
|levelres =
|Store Type =[Guild],[Race],Alchemy,Armor,Barber,Boat,Cambrinth,Casino,Clothing,Container,Cosmetics,Crafting,Drink,Dye,Embroidery,Engraving,Estate Holder,Face Painting,Festival,Fishing Supply,Fletching,Florist,Food,Forging Supply,Furrier,Game,Gem,General,Heraldry,Herb,Hider,Horse,Housing,Jewelry,Juggling,Locksmithing,Magic,MAMAS,Map,Miscellaneous,Music,Origami,Pawn,Perfume,Pet,Rare Materials,Repair,Shield,Spellbook,Tack,Tanning,Tattoo,Tobacco,Toy,Trinket,Vault Furniture,Weapon,Wedding
|Fest =
|Coin =Dokoras
}}
{{ShopDescription
|roomname=Misenseor Goods, Zealous Destruction
|desc=The pinewood walls enclosing this side of the shop are equipped with implements of battle for the use of warrior monks. Large twin bowls, filled with red liquid, flank a stylized thirteen-pointed star burnt into the wall between the room's two egresses.<br />
You also see an iron hook with a strap of braided mey mosshair on it, a birch pedestal with several things on it, a huge cedar rack with several things on it and an antique fretwork table with several things on it.<br />
Obvious exits: southwest, northwest.
}}
{{ShopHeader|title=On the fretwork table}}
{{ShopItem|t=	w	|	mammoth Kerenhappuch war icon set atop a red-gold haft of rosewood	|	902000	}}
{{ShopItem|t=	w	|	mammoth Zachriedek war icon set atop a haft of sickly aspen	|	902000	}}
{{ShopItem|t=	w	|	mammoth Botolf war icon set atop a bloodstained haft of hickory	|	902000	}}
{{ShopItem|t=	w	|	mammoth Be'ort war icon set atop a haft of weeping willow	|	902000	}}
{{ShopItem|t=	w	|	mammoth Asketi war icon set atop a haft of blighted mikkhalbamar	|	902000	}}
{{ShopItem|t=	w	|	mammoth Huldah war icon set atop a haft of silver-green mistwood	|	902000	}}
{{ShopItem|t=	w	|	mammoth Trothfang war icon set atop a haft of veiny copperwood	|	902000	}}
|}
{{ShopHeader|title=On the cedar rack}}
{{ShopItem|t=	w	|	silver-blue scythewing moth handwraps	|	72160	}}
{{ShopItem|t=	w	|	holy water sprinkler studded with stony basilisk fangs	|	99220	}}
{{ShopItem|t=	w	|	steel jambiya with a hilt wrapped in membranous kartais wing	|	36080	}}
{{ShopItem|t=	w	|	serrated bone-white scythe hung with a pair of sluagh claws	|	63140	}}
{{ShopItem|t=	w	|	twisted black horn	|	8118	}}
{{ShopItem|t=	w	|	dark crimson sword etched with spidery lightning	|	8118	}}
{{ShopItem|t=	w	|	golden-bladed scimitar with a hilt wrapped in metallic-red scaled leather	|	13530	}}
{{ShopItem|t=	w	|	oaken impalement stake branded with viperous coils	|	9020	}}
{{ShopItem|t=	w	|	granite mace sculpted like a gaunt greenish fist	|	4510	}}
{{ShopItem|t=	w	|	morning star studded with Adan'f tail barbs	|	10824	}}
{{ShopItem|t=	w	|	silver-bladed scimitar with a hilt wrapped in midnight-blue scaled leather	|	13530	}}
|}
  1. Most of the Store At A Glance table can't be filled out by the script, so the form leaves space for you to fill it out. Make sure the Store Name is the official name of the store. (The store name usually stops at the comma.)
  2. This is a festival shop, so Province, Town, and MapNumber are excluded. (Map numbers are Ranik map numbers from Elanthipedia.)
  3. If this shop has an obvious owner, fill out that person's first name. If not, leave it as n (for none).
  4. Fill out NumRooms.
  5. If there are no restrictions or circle requirements, you can delete those lines.
  6. Store Types: Delete whatever types don't apply. If this shop has items that are for a particular guild or race, fill those out.
  7. Fest: This is Hollow Eve Festival 410.
{{Store At A Glance
|Store Name =Misenseor Goods
|Owner =n
|NumRooms =5
|Store Type =Cleric,Paladin,Clothing,Container,Jewelry,Magic,Weapon
|Fest =Hollow Eve Festival 410
|Coin =Dokoras
}}

If the prices were written in something other than coppers, there will be underscores. Delete the underscores.

Add commas to prices that are 1,000 or greater. I left tabs between each field of the inventory table. This allows you to copy and paste the ShopItem lines into Excel to automatically add commas to the prices that are 1,000 or greater. If you would prefer to manually add the commas, I've included a version without tabs.

Delete the tabs.

{{ShopHeader|title=On the fretwork table}}
{{ShopItem|t=w|mammoth Kerenhappuch war icon set atop a red-gold haft of rosewood|902,000}}
{{ShopItem|t=w|mammoth Zachriedek war icon set atop a haft of sickly aspen|902,000}}
{{ShopItem|t=w|mammoth Botolf war icon set atop a bloodstained haft of hickory|902,000}}
{{ShopItem|t=w|mammoth Be'ort war icon set atop a haft of weeping willow|902,000}}
{{ShopItem|t=w|mammoth Asketi war icon set atop a haft of blighted mikkhalbamar|902,000}}
{{ShopItem|t=w|mammoth Huldah war icon set atop a haft of silver-green mistwood|902,000}}
{{ShopItem|t=w|mammoth Trothfang war icon set atop a haft of veiny copperwood|902,000}}
|}

{{ShopHeader|title=On the cedar rack}}
{{ShopItem|t=w|silver-blue scythewing moth handwraps|72,160}}
{{ShopItem|t=w|holy water sprinkler studded with stony basilisk fangs|99,220}}
{{ShopItem|t=w|steel jambiya with a hilt wrapped in membranous kartais wing|36,080}}
{{ShopItem|t=w|serrated bone-white scythe hung with a pair of sluagh claws|63,140}}
{{ShopItem|t=w|twisted black horn|8,118}}
{{ShopItem|t=w|dark crimson sword etched with spidery lightning|8,118}}
{{ShopItem|t=w|golden-bladed scimitar with a hilt wrapped in metallic-red scaled leather|13,530}}
{{ShopItem|t=w|oaken impalement stake branded with viperous coils|9,020}}
{{ShopItem|t=w|granite mace sculpted like a gaunt greenish fist|4,510}}
{{ShopItem|t=w|morning star studded with Adan'f tail barbs|10,824}}
{{ShopItem|t=w|silver-bladed scimitar with a hilt wrapped in midnight-blue scaled leather|13,530}}
|}

Required Manual Editing

Store At A Glance and ShopDescription

The script will add "Store At A Glance" and "ShopDescription" every time you run it. Delete all but the first ones.

Store Name: You'll probably need to edit this, as most room names have extra text. For example, if the room is "Gersvinda's Natural Studies, Studio," it should be changed to just "Gersvinda's Natural Studies."

ShopDescription

If there is not a "You also see" line in the room, the script will print a line that is only one line break (<br>). Delete that.

Item Types

If your table contains more than one type of item, you need to manually change some of the item types in the t= field. The options are:

  • Weapon: w
  • Shield: s
  • Armor: a
  • Clothing: c
  • Jewelry: j
  • Housing: h
  • Food/Drink: f
  • Items (all other): i

Prices

If the prices were written in something other than coppers, there will be underscores. Delete the underscores.

Add commas to prices that are 1,000 or greater. I left tabs between each field of the inventory table. This allows you to copy and paste the ShopItem lines into Excel to automatically add commas to the prices that are 1,000 or greater. If you would prefer to manually add the commas, I've included a version without tabs.

Delete the tabs.

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}}

Changelog

2/26/2016

  • Added support for bloodscrip|kernels?

5/23/2015

  • Removed menu support for unused item type flags

11/4/2013

  • Brand new version that greatly reduces the amount of time it takes to log inventory. Please read the documentation before posting these forms to Elanthipedia.
  • Added "rotating stock" footnote

9/25/2013

  • Added racial item class to combat/rp class toggles.

11/10/2012

  • Shortened pauses by half a second.

11/4/2012

  • Added "Hider" as a shop type.

5/16/2012

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

4/28/2012

  • Added support for items on "two" surfaces. (This was preventing certain taps from being read.)

11/14/2011

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

11/9/2011

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

11/4/2011

  • Added more shop type options to the list; fixed "Store At A Glance" section so that it's not specific to Hollow Eve Festival 403.
  • Added partial support for ticket prices.

11/2/2011

  • Added barding (horse armor) to the menu.

05/23/2011

  • The script now uses triggers to set the currency and preposition variables.

05/13/2011

  • The script now adds the room objects and room exits to the ShopDescription.
  • Fixed a bug that caused the script to list the last item twice.
  • The "Store At A Glance" and "ShopDescription" sections are now optional.

05/14/2011

  • Added store types to "Store At A Glance." (Erase the ones that don't apply to the shop that you're editing.)

Script (With Tabs for Excel)

put #class rp on
put #class arrive off
put #class combat off
put #class joust off
put #class racial off
put #class shop off

var source $roomname
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 shopheader $1 when ^(.+), you see:$
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 costi $1 when ^Cost:\s+(\d+) (Kronars?|Lirums?|Dokoras?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)

send shop $shop
waitforre ^(Behind|In|On|Under).+, you see:$

if_1 goto ShopDesc
goto StartShop

ShopDesc:
put #log >Shop.txt {{Store At A Glance
put #log >Shop.txt |Store Name       =$roomname
put #log >Shop.txt |Province         =
put #log >Shop.txt |Town             =$zonename
put #log >Shop.txt |MapNumber        =$zoneid
put #log >Shop.txt |Owner            =-
put #log >Shop.txt |NumRooms         =
put #log >Shop.txt |restrict         =
put #log >Shop.txt |levelres         =
put #log >Shop.txt |Store Type       =[Guild], [Race], Alchemy, Alteration, Armor, Barber, Boat, Book, Cambrinth, Casino, Clothing, Container, Cosmetics, Crafting, Drink, Dye, Embroidery, Engineering, Engraving, Estate Holder, Face paint, Festival, Fletching, Florist, Food, Forging, Furrier, Games, Gem, General, Heraldry, Herb, Hider, Horse, Housing, Jewelry, Juggling, Light, Locksmithing, Magic, MAMAS, Map, Miscellaneous, Music, Origami, Outfitting, Pawn, Perfume, Pet, Rare Materials, Repair, Shield, Siegery, Smoking, Spellbook, Tack, Tanning, Tattoo, Tobacco, Toy, Trinket, Vault Furniture, Weapon, Wedding, Writing
put #log >Shop.txt |Fest             =
put #log >Shop.txt |Coin             =$currency
put #log >Shop.txt }}
put #log >Shop.txt
put #log >Shop.txt {{ShopDescription
put #log >Shop.txt |roomname=$roomname
put #log >Shop.txt |desc=$roomdesc<br />
put #log >Shop.txt $roomobjs<br />
put #log >Shop.txt $roomexits
put #log >Shop.txt }}
put #log >Shop.txt

StartShop:
put #log >Shop.txt "{{ShopHeader|title=%shopheader}}"
put #echo
put #echo ITEM TYPE:
put #echo
put #echo 1:	Weapon
put #echo
put #echo 2:	Shield
put #echo
put #echo 3:	Armor/Barding
put #echo
put #echo 4:	Item: Other
put #echo
put #echo Enter Type Number:

matchre Weapon ^1$
matchre Shield ^2$
matchre Armor ^3$
matchre Item ^4$
matchwait

Weapon:
var type w
goto Shop1
Shield:
var type s
goto Shop1
Armor:
var type a
goto Shop1
Item:
var type i
goto Shop1

Shop1:
action setvariable tap $2;setvariable price $3 when ^\s+(an?|some|the) (.+) for (\d+) ([Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action setvariable tap $2;setvariable price $3 when ^\s+(an?|some|the) (.+) for (\d+) copper (Kronars?|Dokoras?|Lirums?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action setvariable tap $2;setvariable price $3_0 when ^\s+(an?|some|the) (.+) for (\d+) bronze (Kronars?|Dokoras?|Lirums?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action setvariable tap $2;setvariable price $3 when ^\s+(an?|some|the) (.+) for (\d+\.\d+) bronze (Kronars?|Dokoras?|Lirums?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action setvariable tap $2;setvariable price $3_00 when ^\s+(an?|some|the) (.+) for (\d+) silver (Kronars?|Dokoras?|Lirums?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action setvariable tap $2;setvariable price $3_0 when ^\s+(an?|some|the) (.+) for (\d+\.\d+) silver (Kronars?|Dokoras?|Lirums?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action setvariable tap $2;setvariable price $3_000 when ^\s+(an?|some|the) (.+) for (\d+) gold (Kronars?|Dokoras?|Lirums?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action setvariable tap $2;setvariable price $3_00 when ^\s+(an?|some|the) (.+) for (\d+\.\d+) gold (Kronars?|Dokoras?|Lirums?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action setvariable tap $2;setvariable price $3_0000 when ^\s+(an?|some|the) (.+) for (\d+) platinum (Kronars?|Dokoras?|Lirums?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action setvariable tap $2;setvariable price $3_000 when ^\s+(an?|some|the) (.+) for (\d+\.\d+) platinum (Kronars?|Dokoras?|Lirums?|[Tt]ickets?|bloodscrip|kernels?|[Ff]ame)$
action put #log >Shop.txt "{{ShopItem|t=	%type	|	%tap	|	%price	}}" when for (\S+) (copper|bronze|silver|gold|platinum) (Kronars?|Dokoras?|Lirums?)$
action put #log >Shop.txt "{{ShopItem|t=	%type	|	%tap	|	%price	}}" when for (\S+) ([Tt]ickets?|bloodscrip|kernels?|[Ff]ame)
action put #log >Shop.txt "{{ShopFootnote|rotating stock}}" when ^The inventory of.+rotates\.$
send shop $shop
waitfor [Type SHOP [GOOD] to see some details about it.]
pause 1
goto end

end:
put #log >Shop.txt |}
send shop
put #class racial on
exit

Script (Without Tabs)

put #class rp on
put #class arrive off
put #class combat off
put #class joust off
put #class racial off
put #class shop off

var source $roomname
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 shopheader $1 when ^(.+), you see:$
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 costi $1 when ^Cost:\s+(\d+) (Kronars?|Lirums?|Dokoras?|Tickets?|bloodscrip|kernels?)

send shop $shop
waitforre ^(Behind|In|On|Under).+, you see:$

if_2 goto ShopDesc
goto StartShop

ShopDesc:
put #log >Shop.txt {{Store At A Glance
put #log >Shop.txt |Store Name       =$roomname
put #log >Shop.txt |Province         =
put #log >Shop.txt |Town             =$zonename
put #log >Shop.txt |MapNumber        =$zoneid
put #log >Shop.txt |Owner            =-
put #log >Shop.txt |NumRooms         =
put #log >Shop.txt |restrict         =
put #log >Shop.txt |levelres         =
put #log >Shop.txt |Store Type       =[Guild], [Race], Alchemy, Alteration, Armor, Barber, Boat, Book, Cambrinth, Casino, Clothing, Container, Cosmetics, Crafting, Drink, Dye, Embroidery, Engineering, Engraving, Estate Holder, Face paint, Festival, Fletching, Florist, Food, Forging, Furrier, Games, Gem, General, Heraldry, Herb, Hider, Horse, Housing, Jewelry, Juggling, Light, Locksmithing, Magic, MAMAS, Map, Miscellaneous, Music, Origami, Outfitting, Pawn, Perfume, Pet, Rare Materials, Repair, Shield, Siegery, Smoking, Spellbook, Tack, Tanning, Tattoo, Tobacco, Toy, Trinket, Vault Furniture, Weapon, Wedding, Writing
put #log >Shop.txt |Fest             =
put #log >Shop.txt |Coin             =$currency
put #log >Shop.txt }}
put #log >Shop.txt
put #log >Shop.txt {{ShopDescription
put #log >Shop.txt |roomname=$roomname
put #log >Shop.txt |desc=$roomdesc<br />
put #log >Shop.txt $roomobjs<br />
put #log >Shop.txt $roomexits
put #log >Shop.txt }}
put #log >Shop.txt

StartShop:
put #log >Shop.txt "{{ShopHeader|title=%shopheader}}"
put #echo
put #echo ITEM TYPE:
put #echo
put #echo 1:	Weapon
put #echo
put #echo 2:	Shield
put #echo
put #echo 3:	Armor/Barding
put #echo
put #echo 4:	Item: Other
put #echo
put #echo Enter Type Number:

matchre Weapon ^1$
matchre Shield ^2$
matchre Armor ^3$
matchre Item ^4$
matchwait

Weapon:
var type w
goto Shop1
Shield:
var type s
goto Shop1
Armor:
var type a
goto Shop1
Item:
var type i
goto Shop1

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

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

Shop2:
send tap %number %1 $preposition $shop
waitforre ^You
send shop %number %1 $preposition $shop
waitforre ^Short
pause .5
gosub CommaCost
put #log >Shop.txt "{{ShopItem|t=%type|%tap|%cost}}"
put #log >Shop.txt
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:
put #log >Shop.txt |}
send shop
waitforre ^\[Type SHOP \[ITEM\] to see what's on it|^There is nothing to buy here
send shop $shop
waitforre ^\[Type SHOP \[GOOD\] to see some details about it|^There is nothing to buy here
put #echo Last noun: %1 ($preposition $shop)
put #class racial on
exit