# $single_stock_item !! generic function to be used to stock single purchase items in stores !! see [shop], specifically the household appliances section for an example of use !! ARGS 0 is the value identifying when the item is owned !! it is assumed that anything >= the value is acceptable, this allows for upgrades like regular tv to plasma !! ARGS 1 is the item description !! ARGS 2 is the price !! ARGS 3 is the variable name for the item !! ARGS 4 is the location to go back to !! ARGS 5 is $loc_arg !! ARGS 6 > 0 to force-disable buy link !! ARGS 7 is replacement text for 6 !! ARGS 8 is custom buy link when ARGS 6 > 0 !$location = $ARGS[4] !! This will check to see if the item is already owned dynamic 'in_inventory = <<$ARGS[3]>>' $in_inventory = iif(in_inventory > 0, '<>', 'none') $RESULT = '' + _ '<>' + _ '<<$ARGS[1]>>' if ARGS[6] > 0: $RESULT += ''+$ARGS[7]+''+$ARGS[8]+'' elseif ARGS[0] > in_inventory: $RESULT += '(you have <<$in_inventory>>)' if money >= ARGS[2]: $RESULT += 'buy' else $RESULT += '' end else $RESULT += 'You already own this' end $RESULT += 'for <> ' --- $single_stock_item ---------------------------------