Skip to content

Vending app (np_phone) ​

With np_phone running, np_vending registers a Vending app (green bottle tile) in np_phone's App Store. It is not installed by default (Config.Phone.app.default = false): players install it from the App Store. The app is a second build output of the NUI, web/dist/phone.html, and talks to the server through np_phone's app RPCs, which run the same server handlers as the dashboard.

Vending app

Tab What
Machines Sales today and cash in the boxes; machines that need you (empty slots, full box, vandalised, rent unpaid) and the ones running fine. Tap a machine for its slot grid, cash box, card sales, in service on/off, prices and offers, GPS
Route The restock route from the depot with stops and what to load; Start route sets the GPS. Below, the job board with open restock jobs to Take
Market Machines for sale, free spots and auctions on a map; buy, bid, GPS to a machine
Sales Sales over the last days
Machines One machine Route
Machines Detail Route
Market Sales German
Market Sales German

Like the dashboard, the app works from anywhere. Filling slots, emptying the cash box, selling and picking up happen at the machine.

Alerts ​

Operators get alerts as np_phone notifications from the Vending app (Config.Alerts switches each one):

Alert When
lowStock A machine has empty slots
cashFull A cash box is over 80 % full
breakIn A break-in, an alarm or vandalism
rentDue Rent is due soon, unpaid, or the machine returned to the city
listingSold A listing was sold or an auction ended
watchBack A slot you asked to be notified about is back in stock (for buyers)

Players who are offline get a text from Config.Phone.senderLabel (Vending) instead; np_phone delivers it by number, so the phone doesn't need to be on. Without np_phone, online players get a toast and offline players find the message in np_vending's inbox at their next login.

App RPCs ​

np_phone names them vending.<name>. Each one runs a server RPC of the NUI contract:

App RPC Server RPC
vending.overview owner.overview
vending.toggle owner.toggle
vending.route owner.route
vending.gps owner.gps
vending.payRent owner.payRent
vending.market market.list
vending.buy market.buy
vending.bid market.bid
vending.jobs jobs.list
vending.take jobs.take

Config ​

lua
Config.Phone = {
  app = { id = 'vending', name = 'Vending', icon = 'fa-solid fa-bottle-water', tint = 'green', default = false,
    description = 'Your vending machines, routes and the market.', developer = 'np_vending' },
  senderLabel = 'Vending',
}

Config.Integrations.np_phone = false skips the app; alerts then use toasts and the login inbox.