Configuration

Finance apps

Settings of Bank, Ledger (billing), Stock Bulletin (borsa) and Business (company), including the bank adapters and the business till.

Watch the unit of each amount. Bank amounts are in cents (100 = 1 dollar). Ledger, Business and Stock Bulletin amounts are in dollars.

#Bank: apps/bank/config.lua

The connection to your bank script is in framework/frameworks.lua (FXBank).

Setting Default What it does
Enabled true The Bank app
Mode 'auto' 'auto', 'vorp', 'rsg', 'internal' or 'custom'. Auto: VORP with vorp_banking started is 'vorp', RSG with rsg-banking started is 'rsg', otherwise 'internal'
RequireSignal true Deposit, withdrawal and transfer need signal
CashInTown.Enabled true Cash deposits and withdrawals only in a town. The server checks the player's real position. Transfers and money requests work anywhere. false: anywhere
CashInTown.Radius 220 Metres from a town centre, unless the town has its own radius
CashInTown.Towns 9 towns { town = 'Valentine', coords = vector3(-308.0, 773.8, 118.7) }. Saint Denis has radius = 480, Blackwater radius = 260. Correct the centres for your map
MaxAmount 10000000 Most per operation, in cents ($100,000)
HistoryLimit 20 Recent operations shown, 1 to 100
Transfer.Enabled false Transfers from the book, by account number, telegraph address or character id
Transfer.MaxNote 80 Transfer note length
Transfer.Limit nil Most per transfer, in cents. nil uses MaxAmount. Example: 50000 is $500
LedgerLimit 100 Rows shown for one account on the ledger page, 10 to 300
ShowNames true Typing an account number or address shows the receiver's name. false: a "hidden account" notice
Accounts.Enabled true Extra accounts: savings and shared
Accounts.MaxOwn 3 Extra accounts one character can open
Accounts.MaxMembers 5 People on a shared account, owner included
Accounts.MaxName 30 Account name length
Accounts.Job true Players allowed to see a Business till get a job account card
Requests.Enabled true Money requests
Requests.MaxOpen 5 Waiting requests per character
Requests.MaxNote 80 Request note length
Requests.Cooldown 10 Seconds between two requests
Branches 5 branches { town, coords, hours } for the "nearest branch" list and the Atlas route. Empty: the branch button is hidden
Internal.Name 'Defter Bankasi' Bank name in 'internal' mode
Vorp.Branch 'Valentine' vorp_banking keeps one account per branch. The book uses this one (bank_users.name, a key of vorp_banking's Config.banks)
Vorp.Label nil Name shown. nil: '<Branch> Bankasi'
Vorp.CreateAccount true If the character has no account at that branch, the first deposit opens one with vorp_banking's defaults
Rsg.Branch 'home' rsg-banking 3.x: 'home' is the branch the player chose; or a fixed branch such as 'valentine'
Rsg.Labels 5 names Name shown per branch

'internal' keeps balances in the book's own table fx_pocketbook_bank. Older rsg-banking without branch exports falls back to the RSG-Core bank money (online players only). For another bank script set Mode = 'custom' and fill in the custom adapter in framework/frameworks.lua; its comments list each function and what it must return.

#Ledger: apps/billing/config.lua

Setting Default What it does
Enabled true The Ledger app
AllowPersonalSend false Players may write bills in their own name
AllowPersonalReceive true Players may receive bills in their own name
AllowCreateUI true Bills can be written in the app. false: only through exports
MaxAmount 100000 Largest bill, in dollars
MinDescription, MaxDescription 8, 240 Description length
MaxDetails 3000 Details text length
MaxInstallments 24 Most instalments
MaxPeriodDays 365 Longest period between instalments
MaxRecurringDays 365 Longest repeat period
PageSize 12 Bills per page
NearbyDistance 5.0 The receiver must be this close
EnforceNearby true Check NearbyDistance when a bill is written
PickerDistance 15.0 Players this close get a name tag in the picker; only those within NearbyDistance can be chosen
DuplicateWindowSeconds 120 The same bill (writer, accounts, amount, description) is refused again within this time. 0: off
CompanySend 'member' Who may write bills for a business
CompanyManage 'boss' Who may manage the business's bills
JobPermissions {} Per job: { sheriff = { send = 2 } }
Blacklisted {} Per job: { sheriff = { send = true } } blocks that action
Commission {} Per job: { sheriff = { [2] = 0.05, all = 0.02 } }. Rate on business bills, frozen when the bill is written
MaxAttachments 3 Image links per bill
ImageHosts {} Empty: any public HTTPS domain. The server never downloads them
MaxBulkCancel 50 Bills cancelled at once
AllowProfiles true Account pictures
Penalty.Enabled false Late fee on overdue bills
Penalty.InitialPercent, HourlyPercent, MaxPercent 10, .5, 100 Late fee: initial % plus % per hour overdue, up to the maximum
SweepInterval 60000 ms between the checks that open scheduled bills and add late fees
Enforcement.Enabled true The unpaid export reports blocked = true for a character with unpaid bills, for other scripts to act on
Enforcement.GraceMinutes 30 Bills younger than this do not count
Collection.Enabled false Collect overdue bills automatically. Never overdraws, never edits offline framework rows
Collection.IntervalSeconds 3600 Seconds between collection attempts on one bill
Collection.GraceMinutes 60 Minutes after the due date before collecting
Collection.MaxPerRun 1000 Most taken per attempt, in dollars
Collection.Reserve 0 Dollars always left to the payer
Collection.Companies false Also collect bills addressed to businesses. Personal bills are collected only from online players
Hooks.Sent, Hooks.Paid, Hooks.Cancelled empty functions Called on the server: Sent(src, id), Paid(src, id, amount), Cancelled(src, id)

Permission values (CompanySend, CompanyManage, JobPermissions): 'member' is everyone in the business, 'boss' is bossGrade and up from Config.Company.Jobs, a number is that grade and up. Only jobs listed in Config.Company.Jobs can bill as a business.

#apps/billing/config_server.lua

Setting Default What it does
API.AllowedResources {} Resources allowed to call the Ledger exports: { ['my-script'] = true }. Empty: none is allowed
API.AllowDistanceOverride false Bills written by an allowed resource skip the distance check
API.MaxRequests, API.WindowSeconds 30, 10 Rate limit per resource and player
API.MaxPayloadBytes 16384 Largest request
Logs See config_server.lua

#Stock Bulletin: apps/borsa/config.lua

Prices are made by the server. Money is taken from and paid to Config.MoneyAccount.

Setting Default What it does
Enabled true The app
RequireSignal false true: buying and selling need signal. Looking at prices is always free
City, Year 'Saint Denis', 1899 Bulletin header. Day and month are the real date
TickMinutes 5 Minutes between price changes. At least 1
Commission 1.0 % taken on each buy and sell. 0: none
MaxPerTrade 100 Most shares in one buy
MaxSharesPerCompany 500 Most shares of one company a player can hold. 0: no limit
TradeCooldown 2 Seconds between two trades
MinFactor, MaxFactor 0.35, 3.0 A price stays between these multiples of its starting price
MaxMovePerTick 3.0 Largest % change in one step
Revert 0.0003 Pull toward the starting price each step. 0: none
Companies 8 companies See below
News.Enabled true The news tab
News.BigMove 4.0 A share that moves more than this % in a day gets a short automatic news line. 0: off
News.Headlines 6 items Your own news: company, title, sum, body, optional img (train, mine, cattle, theatre, fair, sheriff, fishing, caravan) and hours (age of the item). The first is shown large

A company:

lua{ id = 'SDD', name = 'Saint Denis Demiryolu', sector = 'Demiryolu', icon = 'train', color = 'blue',
  price = 48.25, volatility = 0.012, drift = 0.5, hq = 'Saint Denis', dividend = 1.2,
  text = 'Lemoyne ile New Hanover arasinda yolcu ve yuk tasir. ...' },
Field What it is
id 2 to 6 capital letters. Never change it: players' shares are tied to it
price Starting price
volatility 0.005 calm to 0.03 very volatile
drift -1 falling, 0 neutral, 1 rising
dividend Shown only, never paid
color blue, green, red, ochre, plum, teal

Do not remove a company while players hold its shares: they could no longer be sold.

#Business: apps/company/config.lua

Setting Default What it does
Enabled true The app
UnemployedJob 'unemployed' Job given to a fired employee
HireDistance 5.0 Players this close can be hired
MaxAmount 100000 Largest till deposit or withdrawal, in dollars
HistoryLimit 50 Rows per page of the till history, 5 to 50
MaxAnnouncement 500 Announcement length
AnnounceCooldown 30 Seconds between two announcements of one business
StartingGrade 0 Grade of a new hire. A job can override it with startingGrade
OfflineChanges.Enabled true Hire, fire and grade changes for offline employees are queued and applied
OfflineChanges.PollInterval 5000 ms between queue runs
OfflineChanges.BatchSize 50 Changes per run, 1 to 100
Payroll {} Per job and grade, pay in dollars per salary period. Shown only
InvoiceShare { default = 0, min = 0, max = 80, step = 5, commissionTo = 'wallet' } Employee share of business bills. The boss sets the percent in the app within min and max. Frozen on the bill. commissionTo = 'wallet': the share waits in the employee's wallet; 'bank': paid to the employee's money at once (kept in the wallet while offline)
WithdrawReason true A till withdrawal needs a short "what for" line
Jobs Law job and newspaper examples The businesses. Match them to your framework jobs
Permissions see below Who may do what
JobPermissions {} Per job overrides of Permissions
ProtectHigherRanks true Nobody may change an employee of equal or higher grade
luaJobs = {
    -- VORP law jobs
    sheriff = { label = 'Şerif Dairesi', bossGrade = 4, grades = { [0] = 'Memur', [1] = 'Yardımcı', [2] = 'Kıdemli', [3] = 'Başyardımcı', [4] = 'Şerif' } },
    deputy = { label = 'Şerif Yardımcıları', bossGrade = 2, grades = { [0] = 'Memur', [1] = 'Yardımcı', [2] = 'Kıdemli' } },
    marshal = { label = 'Federal Marshal', bossGrade = 2, grades = { [0] = 'Marshal yardımcısı', [1] = 'Marshal', [2] = 'Baş marshal' } },
    police = { label = 'Saint Denis Polisi', bossGrade = 3, grades = { [0] = 'Polis', [1] = 'Komiser yardımcısı', [2] = 'Komiser', [3] = 'Emniyet müdürü' } },
    -- RSG law jobs: rsg-core does not define them; use the grade numbers of your shared/jobs.lua
    vallaw = { label = 'Valentine Şerifliği', bossGrade = 3, grades = { [0] = 'Memur', [1] = 'Yardımcı', [2] = 'Kıdemli', [3] = 'Şerif' } },
    rholaw = { label = 'Rhodes Şerifliği', bossGrade = 3, grades = { [0] = 'Memur', [1] = 'Yardımcı', [2] = 'Kıdemli', [3] = 'Şerif' } },
    blklaw = { label = 'Blackwater Polisi', bossGrade = 3, grades = { [0] = 'Memur', [1] = 'Yardımcı', [2] = 'Kıdemli', [3] = 'Şef' } },
    strlaw = { label = 'Strawberry Şerifliği', bossGrade = 3, grades = { [0] = 'Memur', [1] = 'Yardımcı', [2] = 'Kıdemli', [3] = 'Şerif' } },
    stdenlaw = { label = 'Saint Denis Polisi', bossGrade = 3, grades = { [0] = 'Memur', [1] = 'Yardımcı', [2] = 'Kıdemli', [3] = 'Şef' } },
    newspaper = { label = 'Gazete Dairesi', bossGrade = 3, grades = { [0] = 'Muhabir', [1] = 'Yazar', [2] = 'Editör', [3] = 'Müdür' } },
},
Permissions = { hire = 'boss', fire = 'boss', setGrade = 'boss', deposit = 'member', withdraw = 'boss', announce = 'boss',
    history = 'boss', balance = 'member', postalRead = 'member', postalSend = 'member', postalManage = 'boss',
    postalWork = 'member', postalDoors = 'member', shareManage = 'boss' },

Values: 'member', 'boss' (bossGrade and up) or a grade number. The postal* permissions are for post office businesses in the Telegraph. shareManage sets the invoice share.

Every job in Jobs is a business with its own till. Official Ledger fines are written as bills of the officer's business, so each law job that writes fines must be listed here. rsg-core does not define the RSG law jobs; use the grade numbers of your own shared/jobs.lua.

#apps/company/config_server.lua

Treasury.Bindings connects a business till to an account row in another script's SQL table, so the book reads and writes that balance in place of its own till. Only for banks whose balance lives in SQL; never bind a bank that keeps balances in memory or behind exports.

luaTreasury = { Bindings = {
    ['company:vorp:sheriff'] = { Table = 'my_society', KeyColumn = 'job', BalanceColumn = 'money',
        Key = 'sheriff', Unit = 'dollars', Resource = 'my_society_script' },
} },
Field What it is
key company:vorp:<job> or company:rsg:<job>
Table, KeyColumn, BalanceColumn The table and columns. Not a fx_pocketbook_* table
Key The row's key value
Unit 'cents' or 'dollars'
Resource The script that owns the table. It must be started

Two businesses cannot bind the same row. A binding is saved in fx_pocketbook_treasury_bindings the first time it is used, and a removed entry does not free its row for another business. pocketbook_health checks the bindings.