Player shops/Shop owner manual

From Discworld MUD Wiki
< Player shops
Revision as of 12:36, 11 May 2022 by Frazyl (Talk | contribs) (Text replacement - "" to "")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The Shop Owner's Guide is a brilliant vermilion book sold in the bookshop on Diamond Place, Bes Pelargic, to inform shop owners in dealing with player shops.

new shop owner                 Discworld shop help                new shop owner

Contents and Introduction

Congratulations on your new shop!
 This guide will explain many features of your new shop and how to setup different sorts of   
 controls.  The book is designed to be a step-by-step guide, not a reference.  That means    
 that one section builds on the next and should be studied that way.                         
 A player run shop is a shop in which you control the price things are sold for, and who can 
 use your shop.  You also control how many items can be listed by each player, how much      
 markup you put on items and just about any other shop related feature you can think of.     
 Unlike a normal craft shop players do not have control of the price of their items, they are 
 paid for the cost of the item upfront when the shop buys it and then the shop owner controls 
 the cost it is sold for.  The standard controls in the shop for changing of an item after it 
 is in the shop's inventory still work, but only for the shop owner, not for the previous    
 owner of the item.                                                                          

Quick start
 You've probably already asked your best friend to come sell something at your brand new shop 
 and it's not working!  Why not!?                                                            
 Well, the shop is geared to deny everybody except those you specifically add.  An easy way   
 to change that is: "buy expression true" and "use expression true"                          

Summary of the commands

    Here is a quick list of all the commands available in the shop.  A more detailed         
    explanation of all these commands will follow in later sections.                         
Working with the shop itself
    status hints                                                                                   
    expressions hints                                                                              
    functions hints                                                                                
Working with money
    pay deficit                                                                                   
    royalties list                                                                                
    collect royalties                                                                             
    collect royalties of <amount>                                                                 
Looking at statistics
    status room weekly                                                                            
    stats money                                                                                   
    notifications weekly_status                                                                   
Working with categories
    category list                                                                                  
    category rename <category> to <category>                                                       
    category default <category>                                                                   
    category add <category>                                                                       
    category remove <category>                                                                    
Working with stock
    change price of <object> to <amount>                                                          
    change name of <object> to <string>                                                           
    change category of <object> to <category>                                                      
Working with the waiting list
    waiting unapproved                                                                            
    retrieve <id>                                                                                 
    browse waiting <id>                                                                           
    approve <id>                                                                                  
    reject <id>                                                                                   
    reject <id> message <reject message>                                                          
    reject <id> position <number>                                                                 
    reject <id> position <number> message <reject message>                                        
    checkin <object>                                                                              
    checkout <id>                                                                                  
Working with status
    name shop <shop name>                                                                         
    set sign <sign>                                                                               
    remove sign                                                                                   
    allow list                                                                                    
    allow <player>                                                                                
    deny <player>                                                                                 
    add ignore to blacklist                                                                       
    add <player> to blacklist                                                                     
    remove <player> from blacklist                                                                
    markup <percentage>                                                                            
    set max number <max sellable|disable>                                                          
    set high queue cost <cost|disable>                                                            
    set high deny cost <cost|disable>                                                             
    set max number <max sellable|disable> for <player>                                            
    set high queue cost <cost|disable> for <player>                                               
    set high deny cost <cost|disable> for <player>                                                
    set low approve cost <cost|disable>                                                           
    buy expression <expression|disable>                                                           
    use expression <expression|disable>                                                           
Working with expressions
    functions help list                                                                            
    functions help <function name>                                                                
    functions internal                                                                            
    auto add name <name> up to <value>                                                            
    auto add name <name> up to <value> as <list name>                                             
    auto add name <name> up to <value> with markup <percentage>                                   
    auto add name <name> up to <value> as <list name> with markup                                 
    auto add name <name> with <expression>                                                        
    auto add name <name> with <expression> as <list name>                                         
    auto add name <name> with <expression> and markup <percentage>                                
    auto add name <name> with <expression> as <list name> and markup                              
    auto remove name <name>                                                                       
    auto add object <object> up to <value>                                                         
    auto add object <object> up to <value> as <list name>                                         
    auto add object <object> up to <value> with markup <percentage>                                
    auto add object <object> up to <value> as <list name> with markup                              
    auto add object <object> with <expression>                                                    
    auto add object <object> with <expression> as <list name>                                     
    auto add object <object> with <expression> and markup <percentage>                            
    auto add object <object> with <expression> as <list name> and markup                          
    auto remove object <object>                                                                   
    auto add approve expression <condition> cost <value> as <list name>                           
    auto add deny expression <condition>                                                          
    auto remove expression <id>                                                                   
    value <object>                                                                                
Working with functions
    add function <function> as <expression>                                                       
    remove function <function>                                                                    

Money Handling

    The very important bit of the shop, how do you get paid?  Well, it's easy!  You come into 
    the shop and use the command 'royalties' to check your royalty pool.  You can also       
    'collect royalties' or 'collect royalties of <amount>' to collect your royalties or parts 
    of it.  The same goes for people who are selling items in your shop.  Once an item is    
    approved into the stock of the shop, the money goes into their royalty pool.             
    If your royalties go below zero you need to use 'pay deficit' to pay off your deficit     
    before you can do any other manipulations on the shop.                                   
    You can view all of the royalty pools (and when they expire) with the command "royalties 
    list".  You should note that all of the monies in these pools has already been paid, so   
    you have no incentive whatsoever to block people from entering your shop when they have   
    large royalties pending!                                                                 
    You can set the percentage that is added onto any item the player sells to the shop (your 
    profit) using the 'markup <percentage>' command.  There is also a way that you can        
    override this default percentage for items that are auto accepted if you want to do that. 
    See page 12 and 15 for details.  You can also change individual prices once items have   
    been accepted.  See page 5 for details.                                                  
    You can tell what your current markup percentage (and all kinds of other stuff) is from   
    using the command 'status' or 'status hints'.                                            
    collect royalties of $1                                                                       
    > You collect A$1 in royalties.                                                               
    collect royalties                                                                             
    > You collect A$200 in royalties.                                                             
    pay deficit                                                                                   
    > You pay off A$20 in deficit.                                                                
    markup 30                                                                                     
    > You set the percentage to add to the sale price to 30%. 


    The shop keeps track of the amount of money you made and the amount which you spent on   
    the upkeep of your shop.  This allows you to tell if you are making a profit or a loss.   
    'stats money' gives you statistics on moneys made, spent, current inventory value and    
    your royalty pool or deficit.                                                            
    Your shop will also generate a weekly profit/loss report.  You can view the current      
    status of this report at any time with "status room weekly".  If you want to get the     
    reports sent to you in mail, you need to enable the mail with "notifications             
    weekly_status".  There may be other notifications available in your shop, check to see   
    what is available with "syntax notifications".  You can also check your current          
    notification subscriptions with "notifications".                                         
    > stats money                                                                                 
    Current money spent A$4196.50 and money made A$5115.54.                                       
    The current stock value is A$1514.97.                                                         
    The owner current has a cash float (royalties) of A$7091.10.                                  
    > notificiations                                                                              
    You have the following notifications set: weekly_status.                                      

Working with the shop's stock

    You can change the name and the category of an object in the shop's stock using the      
    'change name of <object> to <string>', 'change category of <object> to <string>' and     
    'change price of <object> to <currency>'.                                                
    The owner of the shop can control the categories of the shop. They can add, remove and   
    rename categories as they wish (except you cannot remove a non-empty category).          
    'category add <name>' adds a category to the current list of categories in the shop.     
    'category remove <name>' removes a category from the current list of categories in the   
    'category rename <category> to <category>' renames a category to another name.  This will 
    move all the items currently in the old category to the new name as well.                
    'category list' will show you the list of current categories.                            
    'category default <name>' sets the current default category to use for all operations    
    that require a default category.                                                         
    > category add Healing Tea                                                                    
    You add a new category.                                                 
    > category remove Healing Tea                                                                 
    Removed the shop category Healing Tea.                                                        
    > category list                                                                               
    The current categories are:                                                                    
    General (default)                                                                             
    > category rename Healing Tea to Tea                                                          
    You rename category Healing Tea to Tea.                                                       
    > change name of dl to sarilak                                                                
    You change the name of Sarilar to sarilak.                                                    
    > change price of dm to $800                                                                  
    You change the value of Sarilak to A$800.                                                     
    > change category of dm to weapons                                                            
    You change the category of Sarilak to Weapons.                                                

Working with the waiting list: Simple controls

    The default setup of the shop will put any item that is attempted to be sold to the shop  
    into an approval list.  This list can be seen using the 'waiting' and 'waiting           
    unapproved' commands.                                                                    
    The items in the waiting list are all given ids and they must be used to reference these 
    items.  Please note these ids are totally separate to the ids used in the shop itself.   
    The items in the two different waiting lists are referenced seperately, so the items in   
    the unapproved list all have '-' in front of their name while the ones in the approved   
    list do not.  You must include the '-' when rejecting and approving items.                
    The items can be approved with the command 'approve <id>' and rejected with the command   
    'reject <id>' or 'reject <id> message <reject message>'.  When players sell items in a   
    group, you can use the 'reject <id> position <number>' or 'reject <id> position <number>  
    message <reject message>' to reject only some of the items.                              
    When you approve an item the shop will try and take the money it will cost to approve it 
    from your inventory.  If you do not have enough money either in your inventory or in your 
    royalties to approve the item, the shop will refuse to put the item into the shops        
    Before approve an item you may wish to check to see if it is really what they say it is. 
    There a few commands that allow you to do this.  The first one is 'browse waiting <id>'   
    which allows you to look at the short and long descriptions and the read message of an   
    item. The base cost mentioned when you browse an item is what their value is without     
    taking in account enchantment, condition, etc.  The scaled cost is the opposite.         
    The other method of checking items is using the 'checkout <id>' and 'checkin <object>'    
    commands.  These allow an object to be taken out of the approval list and checked over   
    without actually buying the object.  If you loose the object in some way after you have   
    checked it out (burying it or whatever) then the person who sold the item will be        
    credited with the money for actually selling it to the shop.  So be careful not to       
    destroy the object.  Once you have finished examining it you can check it back in for    
    Players can retrieve their items while they are still waiting for approval by using      
    'retrieve <id>'.                                                                         
    > waiting                                                                                     
    The current approval items are:                                                               
    AA) Balwog's sparkling ruby for A$3 in General, 1 objects (a sparkling                        
    ruby) 5 in stock.                                                                             
    > browse waiting aa                                                                           
    The sparkling ruby: (Base cost A$20; scaled cost A$20                                         
    This is a large, sparkling ruby.  Although it looks pretty, the                               
    cloudiness in it suggests that it could well be a fake.                                        
    > reject aa message It's a fake!                                                              
    Sending to: Balwog                                                                            
    Sending to: Balwog                                                                            
    > approve af                                                                                  
    You approve a nodachi to be sold as nodachi in Weapons for A$100.                             
    > checkout af                                                                                 
    Moved a coat of jazerant armour into your inventory for you to check.                         
    You check out one of the coats of jazerant armour.                                            
    > checkin jazerant armour                                                                     
    You check the coat of jazerant armour back in.                                                

Changing the status of things: Shop name and signs

Shop name
    You can set the name of your shop to be whatever you wish.  The name of the shop will be 
    used for messages inside the shop and will also be displayed on a sign outside the shop.  
    > name shop Lanfear's house of fun                                                            
    You set the shop name to 'Lanfear's house of fun'.                                            
Shop signs
    You can set a sign to be placed outside your shop (you can buy them at the sign shop).   
    The sign will be displayed to people who are on the street.                              
    When a sign is removed it will be placed back into your inventory.  If you set a sign    
    when a sign is already set then the existing sign will be removed first.                 
    > set sign blue sign                                                                          
    You set the large sign as your shop sign.                                                     
    > remove sign                                                                                 
    You remove the large sign from Lanfear's Shop.                                                

Changing the status of things: Hiring players to work for you

    There are two different levels of access you can grant to another player: helper and     
    partner.  If your shop is small the distinction may be small, but as your shop gets      
    larger the partner gains much more power of the helper.                                   
    Helpers can be hired and fired via the "helper" command if you have a shop counter.  A   
    helper can approve and reject waiting items, as well as change the name, price or        
    category of any item already in stock.                                                   
    Helpers are your employees, and as such they maintain independant royalty pools from the 
    shop.  A helper cannot directly touch the shop's float;  neither to put money in nor to   
    take money out.  However, a sufficiently clever helper can bankrupt you nonetheless, and  
    cackle off into the night with loads of embezzled funds; so make sure you trust them.    

    Partners have nearly-full control over the operation of your shop.  They can operate any 
    piece of shop equipment with as much control as you, the owner.  They can deposit into   
    the float, they can withdraw from the float, they can paint the walls, lay carpet, trash 
    your expensive equipment and even order new equipment.  Partners are, well, partners.    
    They aren't working in your shop for royalties, they're in for profit-sharing.  When a   
    partner sells an item to the shop no money is gained or lost, it all stays in the shop    
    float (which is listed as your name).  A partner doesn't even have to be clever to leave  
    you destitute; so once again you need to trust them.                                     

    You can promote someone to a partner with the "allow" command; "allow list" shows all of 
    the current partners.  You can also fire a partner with the "deny" command.              
Shop Owner
    This is you (well, the owners are the target audience, at least).  Just as a helper can   
    do anything a customer can (plus some), and a partner can do anything a helper can (plus  
    some), you can do anything a partner can...  plus some!                                  

    Only the current shop owner (first line of "status room") can change who the owner is;    
    either by terminating or transferring the lease.  And only the  shop owner can hire and   
    fire partners.  Your new partner cannot pull someone else into the partnership, only you 
    can.  (Of course, they can still hire a  helper.).  These are your only two unique powers 
    if you gain a partner, so  treasure them dearly.                                         
Helpful hints
    The shop keeps records for you, for about a week.  If you don't have sole control over   
    your shop you probably want to get copies of these records by mail.  Take a look at the   
    notifications section under Statistics again.                                            

Changing the status of things: Disallowing people from using the shop

    You can deny individual people complete access to your shop if you want to, so they have  
    no ability to either buy or sell items.  To do this you use the black list control in the 
    shop.  Black listing is checked before everything else and overrides everything.         
    To add someone to your black list go 'add <player> to blacklist' and to remove someone   
    from your black list go 'remove <player> from blacklist'.  You can also add all the      
    people from your ignore list to the black list if you wish by typing 'add ignore to      
    You can see the current people in your black list using the 'status' command.             
    (The owner can also control who uses the shop on a broader level.  Overall, you can      
    restrict the use of the shop based on guild, level, memberships of club, family names    
    etc., by using the buy or use expressions.  Please see page 14 for more details.)         
    > add brighid to blacklist                                                                    
    You add brighid to the black list.                                                            
    > remove brighid from blacklist                                                               
    You remove brighid from the black list.                                                       
    > add ignore to blacklist                                                                      
    You add cold, eben and soxy to the black list.   

Changing the status of things: Setting up general criteria

 You can setup limits and prices at which things will be automatically accepted, denied or   
 queued, as well as how many objects a player can have for sale at the shop at any time.  You 
 can also set up these limits and prices individually for specific players.  In later         
 sections you'll learn how to automatically approve/deny things based on custom criteria.    
 'set high deny cost <cost|disable>' sets up the maximum cost that anything at all can be    
 sold to the shop at.  If an item exceeds this cost then it will not be allowed to be sold at 
 all.  It will be denied and not moved into the acceptance list.  If this is unset, or set to 
 0, then there is no upper limit on the cost of something allowed to be sold in the shop.    
 'set high queue cost <cost|disable>' sets up the value at which items will enter the        
 approval list even if they were set up to be automatically approved.                         
 'set max number <max sellable|disable>' sets the maximum number of items than can be listed 
 by the player in both the shop and in their approval list.  This is to stop the shop owner   
 from being deluged in items for approval from one player.                                   
 'set low approve cost <cost|disable>' sets up the maximum cost that an item will            
 automatically be accepted into the shop for.  If this is set to a non-zero value then       
 anything which sells for less than this will be added to the shop's inventory without going 
 through the normal acceptance process.                                                       
 'status' and 'status hints' can be used to view the status of all the current auto approval 
 limits specified in the shop.                                                               
 The order for checking for things for automatic approval is this: first the seller is       
 checked for any hard limits on their sale price, then the item itself is checked for any    
 limits, then the expressions are evaluated and checked and lastly the low level limits for   
 automatic approval are checked on the player.  When the seller is checked for hard limits   
 and for the limit at which items can be sold automatically their limits specified            
 specifically for the player are checked, and if they do not exist then the default limits   
 are checked.                                                                                
    > set high deny cost $2000                                                                    
    You set the shop to automatically deny any item costing more than A$2000.                     
    > set high queue cost $1000                                                                   
    You set the shop to automatically put any item costing more than A$1000                       
    into the approve list.                                                                         
    > set max number 20                                                                           
    You set the default number of sold items per person to 20.                                    
    > set low approve cost $0.50$                                                                 
    You set the shop to automatically accept any item costing less than 50p.

Changing the status of things: Setting up people for automatic acceptance

 You can setup people so that items they sell have different limits to the defaults.  This    
 applies to the deny limit, the approve limit and the number of items the shop will stock.   
 'set high deny cost <cost|disable> for <player>' sets the deny limit for the player.  If    
 they try and sell an item for more than this it will be denied.  This can be higher or lower 
 than the default limit.  If this is disabled then the default limit will be used.           
 'set high queue cost <cost|disable> for <player>' sets the approve limit for the player.  If 
 they try and sell an item for more than this it will be automatically queued in the waiting 
 list.  This can be higher or lower than the default limit.  If this is disabled then the     
 default limit will be used.                                                                 
 'set max number <max sellable|disable> for <player>' sets the number of items the shop will 
 stock for the player.  It will deny them from selling more than this to the shop, this      
 includes both the inventory and anything they have waiting for acceptance.  This can be     
 higher or lower than the default limit.  If the number is set to 0 then this will be        
 disabled and the default limit will be used.                                                
 'status' and 'status hints' will show you the current status of all the players approval     

    set high deny cost $500$ for silvara                                                          
    > You set the maximum cost of items accepted by silvara to A$500.                             
    set high queue cost $400$ for silvara                                                          
    > You set the maximum cost of items automatically approved by silvara to A$400.                
    set max number 50 for silvara                                                                 
    > You set the maximum number of items sellable by silvara to 50.                              
    set high deny cost disable for silvara                                                        
    > You disable the maximum cost of items to be sold by silvara. 

Changing the status of things: Setting up items for automatic acceptance

    You can set individual limits on how much a shop will pay for specified items.  The shop  
    will approve the item sold for less than the specified amount and put anything that is   
    sold for more in the waiting list.                                                       
    There are two basic ways (and then some variations) with which you can set your shop up   
    to accept items automatically:                                                           
    1) Short descriptions and selling price are the criteria against which items are matched 
    to determine the eligibility for automatic acceptance.                                   
    2) Short descriptions, selling price and/or other attributes (like object condition) will 
    be evaluated. This method makes use of expressions which will be discussed later.  For    
    now, just remember that there are more sophisticated ways of testing items than what is   
    discussed in this section.                                                               
    With both the above-mentioned methods you can either enter the name for an item or an    
    identifier for an object to be tested for eligibility.  "Eek! What is that?" I hear you   
    ask.  Well, for the purposes of your shop, items are things _you_ have to describe to the 
    shop.  As for objects, as long as you have it in your inventory, the shop will take its   
    description from the object itself. (This is great for when you want to match up hard to  
    enter descriptions, like the ones with colours in them.).  Clear as mud, right? Syntaxes  
    then examples to follow!                                                                 

    - 'auto add name <name> up to <value>'                                                        
    - 'auto remove name <name>'                                                                   
    - 'auto add object <object> up to <value>'                                                    
    - 'auto remove object <object>'                                                                
    - 'value <object>'                                                                             
    auto add name small turquoise vial up to $5$                                                  
    > You set the shop to automatically accept any item with a short of                           
    small turquoise vial up to a cost of A$5.                                                     
    auto remove name small turquoise vial                                                          
    > You remove the item small turquoise vial from the list of                                    
    automatically accepted items.                                                                 
    (For the following examples please assume that I have a 'small turquoise                       
    vial' in my inventory.)                                                                        
    auto add object vial up to $5$                                                                
    > You set the shop to automatically accept any of small turquoise vial                        
    up to a cost of A$5.                                                                          
    value vial                                                                                    
    > The item the small turquoise vial can be sold if it costs less than A$5 (small turquoise    
    auto remove object vial                                                                       
    > You remove the small turquoise vial from the list of automatically                          
    accepted items.                                                                               
    Ok, I hope that wasn't too bad.  Earlier I said that there are two methods (and some     
    variations) to automatically accept items into the shop.  For the variations, the first   
    bit of the syntax stays the same ('auto add name/object <name/object> up to <value>'),   
    but them we add some stuff (examples to follow):                                         
    - as <list name>                                                                          
       When you want the things being accepted to have a specific name.                      
    - with markup <percentage>                                                               
       Used to override the default markup up specified by "markup <percentage>", as seen in 
    - value <amount>                                                                         
       This overrides the amount the item will be sold for.  This allows you to accept it for 
       any value you wish but sell it at a fixed cost (so you do not have any pence involved 
       for instance).                                                                        
    - as <list name> with markup <percentage>                                                 

    auto add object vial up to $5$ as amazing healing potion!                                     
    > You set the shop to automatically accept any of small turquoise vial                        
    up to a cost of A$5 as "amazing healing potion!".                                             
    auto add object vial up to $5$ as amazing healing potion! with markup 10                      
    > You set the shop to automatically accept any of small turquoise vial                        
    up to a cost of A$5 as "amazing healing potion!" with a markup of 10%.                        
Next Section
    Ok!  Now we're off to the next section which is an introduction to expressions.  I know   
    it's a bit boring but it's not too long and it's stuff you really, really need to know or 
    you'll ask silly questions and people will laugh at you! ... So read on :)               

Introduction to Expressions

    Before we look at where you can use expressions and a list of controls (functions and    
    variables) which can be used, let's look at a short explanation of the different         
    components used in expressions.                                                          
    The expressions are setup free form using the operators 'and', 'or', 'not' '+', '-', '*', 
    '/', '>', '>=', '<', '<=', '=', '<>' '[', ']',  '{', '}', 'sizeof', 'contents' or 'if'.   
    The main operators behave like you would expect and you can manipulate numbers and money 
    as you wish.                                                                             
    There are three types of constants you can specify.  Money constants are defined by a    
    string with $'s around it, i.e.: $5 dollars$ or $4 lancre pennies$ or $4.00$.  Use of    
    $4.00$ will work with Ankh-Morpork money but will not work in other parts of the country. 
    String constants are defined with '"'s, i.e.: "frog", "blue".  Integer constants are just 
    numbers, i.e.: 12, 14, 100.  Easy, right?  Ok.                                            
    The 'if' operator is a special case and can be used as a flow control construct.  The    
    syntax of an if is: 'if <condition> then <expression> else <expression> endif'  (Don't   
    forget the endif!)                                                                       
    Arrays are always of a uniform type, so you will have an array of objects, or strings or 
    numbers.  An array is ordered series of things.  The ordered bit means that array[0] will 
    always be the same as array[0] and it comes before array[1].  If you think of an array   
    like a set of drawers in a cabinet, the bottom draw is number 0, the next one up is 1 and 
    so on.  So draw 1 is the contents of the draw second from the bottom.  Which would be    
    draw[1] in an expression.                                                                
    There are two things you can do with an array, you can get specific elements out of the   
    array and you can turn something back into an array.  To get a specific element of an    
    array you use the '[]' operator.  For example 'objects[0]' is the first element of the   
    objects array.  You can recreate arrays using the '{}' operator.  For example:           
    {objects[0]} makes an array of size 1.                                                   
    Arrays can be added and subtracted.  They cannot be used with any of the other operators. 
    'sizeof' returns the size of the array.  So sizeof({objects[0]})  would be 1, and        
    sizeof({12,13,14}) would be 3.                                                           
    Next section we go to cover a bit more how to control players who are allowed to buy and  
    use the shop.                                                                            

Expressions: Setting up people for automatic acceptance

    The owner can control who can use the shop.  This makes everyone effectively black listed 
    and only allows specified people to use the shop, rather than letting anyone except those 
    who are black listed use the shop.                                                       
    'buy expression <expression|disable>' sets up an expression which must be matched for the 
    person to be able to buy from the shop.  It defaults to 'true' which means the shop can   
    always be bought from.                                                                   
    'use expression <expression|disable>' sets up an expression which must be matched for the 
    person to be able to use the shop.  It defaults to 'true' which means the shop can always 
    be used.                                                                                 

    buy expression (((guild = "warriors") and (level < 100)) or (guild = "wizards") or (guild = "thieves") or (guild = "assassins") or (guild = "witches") or (guild = "priests")) and not clubmember ("shadowlisters")                       
    > You set the expression to use when checking to see if someone can buy                       
    from the shop to (((guild = "warriors") and (level < 100)) or (guild =                         
    "wizards") or (guild = "thieves") or (guild = "assassins") or (guild =                        
    "witches") or (guild = "priests")) and ( not clubmember("shadowlisters")).                    

    On page 16 there will be a bunch of examples.  To find help on specific functions you    
    need to use the help functions described previously and on page 16.

Expressions: Setting up items for automatic acceptance

    To see all expressions regulating auto acceptance of items in your shop, use             
    'expressions' or 'expressions hints'.                                                    
    Remember on page 12 we talked about items and objects?  If not, have a quick look at that 
    again please, because the same principle counts here.  I will wait.                      
    Back?  Ok.  There are two ways in which you can check for different things concerning    
    items being sold to you, both using expressions (and this does not include the difference 
    between an item and an object, I'm not counting that):                                    
    1) Short descriptions, selling price and other attributes. I.e. accept a jet black rod if 
    it is 95% charged for $5).                                                               
    2) Selling price and other attributes. (Yes! We're cutting out the descriptions). I.e.   
    accept/deny whatever item if it contains the imbue 'resurrect' for the price of the      
    object + $20.                                                                            
    On to the first method.. (Keep in mind that the expressions must always return a money    
    value.) The syntaxes follow (remember the next section has a list of aaaaaaall functions 
    and variables you can use in expressions, as well as examples for each, although there   
    are some examples at the end of this section as well):                                   
    - 'auto add name <name> with <expression>'                                               
    - 'auto add object <object> with <expression>'                                           
    Remember that you have the same variations for these syntaxes as you had earlier on page  
    12, i.e. 'auto add object <object> with <expression> as <list name> with markup          
    <percentage>'.  You also remove them in the same way.                                    
    Right, now we get to the second method with which we can setup the automatic             
    acceptance/denial of items with expressions.  This method is independent of objects and   
    items since they test only selling price and attributes of the item being sold, i.e.      
    accept any item with resurrect imbued on for the objectvalue + $10, or deny any item with 
    object condition less than 50.  The syntaxes are as follows:                             
    - 'auto add approve expression <condition> cost <value> as <list name>                   
    - 'auto add deny expression <condition>'                                                 
    - 'auto remove expression <id>'                                                           
    auto add name small silver needle with if objectcondition(objects) > 50 then $2$              
    else $1$ endif                                                                                
    > You set the shop to automatically accept any item with a short of                           
    "small silver needle" with an expression of if objectcondition(objects) > 50                  
    then A$2 else A$1 endif.                                                                      
    auto add item object needle with if objectcondition(objects) > 50 then $2$                     
    else $1$ endif                                                                                 
    > You set the shop to automatically accept any of the small silver                            
    needle with an expression of if objectcondition(objects) > 50 then A$2 else A$1               
    auto add deny expression sizeof(objectmatch (objects, "small silver needle")) > 0             
    > You set the shop to automatically deny any item matching the expression                     
    objectmatch(objects, "small silver needle").                                                  
    auto add approve expression containsimbue(objects,"resurrect") cost                           
    objectbasevalue + $100$ as resurrect imbue                                                    
    > You set the shop to automatically accept any item matching the                              
    expression containsimbue(objects, "resurrect") with a cost of objectbasevalue(objects) +      

Function and Variable help

    For help on the specific functions and variables you can look at the help available from 
    inside the shop.  There are a few useful commands for determining the available functions 
    and the help.                                                                            
    You can get a list of all the internally defined functions with the command 'functions   
    internal'.  You can get a look at all the available help files with 'functions help list' 
    and you can get help on a specific function with 'functions help <name>'.                 
    A complete description of the functions will not be done in here, we will just show you a 
    few examples of how they can be used.                                                    
    > functions help list                                                                         
    > functions help objectmatch                                                                   
    > functions internal                                                                           
    > auto add name red mace with if (inventorynumber("red mace") < 10) and (charges > 90) then $8$ else if (inventorynumber("red mace") < 10) and (charges > 75) then $6$ else the brilliant vermilion book endif endif                                                                                         
    > auto add name ruby ring with if imbued("pt find") and (inventorynumber("restore") < 15) then objectbasevalue(objects) + $5$ else the brilliant vermilion book endif as Restore

User defined expressions (functions)

    Once you start setting up the shop, you might find yourself making a  
    lot of the following type of functions: auto add object boots if      
    condition > 90 then $40 else if condition >80 the $30 etc etc.  Well, 
    it's tedious and besides, it uses the same principle over and over    
    again.  Surely there is an easier way?  Yes!  There is!  You can      
    define functions which control the sale of items in the shop using    
    expressions.    You can define a function that takes arguments or not.
    The function is defined in two parts                                  
    1) The header of the function which defines which arguments are used  
    and the name of the function.                                         
    2) The second part is the expression to use.                          
    There are three syntaxes to manipulate user defined functions with:   
    'functions' to see the list of current functions.  'add function      
    <function> as <expression>' and 'remove function <function>'.         
    The allowed types as arguments to the functions are: money, integer,  
    boolean, string.                                                      
    > add function conditiontest(money low, money middle, money high) as if    
    objectcondition > 90 then high else if objectcondition > 75 then middle    
    else if objectcondition > 60 then low endif endif endif                    
    You successfully add:                                                      
    money conditiontest(money low, money middle, money high) {                 
    if objectcondition > 90 then                                               
    if objectcondition > 75 then                                               
    if objectcondition > 60 then                                               
    // Useful function to check to see if the thing being sold contains        
    // something.                                                              
    > add function contains(string name, integer number) as sizeof(objects) = 1
    and sizeof(objectmatch(contents(objects[0]), name)) = number               
Example of implementation
    > auto item object frog with conditiontest($50$, $40$, $10$)               
    You setup the item 'frog' to be approved with an expression of:            
    conditiontest($50.00, $40.00, $10,00)                                      
    > auto add approve expression contains("diamond engagement ring", 5) and   
    (inventorynumber("bag of five engagement rings") < 5) cost $25$ as Bag of  
    five engagement rings                                                      

Leased properties and what it means for you

    The fee which you payed to the Real Estate Agency is the only fee you 
    have to pay for the duration of your lease (of course, furnishing the 
    shop is its own financial burden).  Your shop is yours to do with what
    you will... until your lease ends.  You can check to see when the     
    lease will end with "status room".                                    
What happens to my float?
    Your float becomes a normal, expiring, royalty pool when the lease    
    ends (except it lasts a bit longer than your average royalty pool).   
    You have approximately two weeks to collect your funds before they up 
    and walk away.  In the event that you win the lease in the subsequent 
    auction, your float hangs around, and goes back to not expiring.      
What happens to my stuff?
    When the lease ends the Real Estate Agency takes possession of the    
    property, but allows the former leaseholder to collect their          
    possessions.  They will not entrust this ability to your former       
    assistants and employees (if you had any), only the person who        
    actually held the lease when it went back up for auction.  Anything   
    you do not move out by the end of the auction becomes the lawful      
    possessions of the new leaseholder.  You are, of course, free to      
    attempt to pursuade them to return your former property to you.       
What if I transfer the lease?
    The lease will still terminate at the original time.  Everything that 
    was in the property at the time now belongs to the transferee, and the
    shop has no float.  The former float is now an expiring royalty pool  
    (see "What happens to my float?").  If you want to transfer the float 
    as well, you must "collect royalties" and give the money to someone on
    the allow list who must then "deposit to float <money>".              
    > status room                                                              
    The lease of the property ends on Mon Aug  6 04:20:12 2007.                

See also