Exports and API
What your other scripts can call or read: OpenTablet, statebags, commands.
tc-mechanic deliberately exposes little: logic stays server-side and encrypted. Here is what is intended for integration.
#Client export: OpenTablet
Opens the workshop tablet with the same controls as /atelier.
Lua
exports['tc-mechanic']:OpenTablet() -- “dashboard” tab
exports['tc-mechanic']:OpenTablet('orders') -- specific tab| Parameter | Values |
|---|---|
tab (optional) | dashboard (default), orders, diagnostic, history, atelier |
Example: a button in your job menu, or a TC Context Menu option:
Lua
tcmenu.add({
label = 'Open the tablet', types = { 'vehicle' },
require = { jobs = { mechanic = 0 } },
onSelect = function() exports['tc-mechanic']:OpenTablet('orders') end,
})#Statebags (read-only)
Written by the server only; you can read them client-side.
| Statebag | Content |
|---|---|
tc_wear | Vehicle wear |
tc_extras | Options outside properties (finishes, special tyres) |
tc_order | Order in progress on the vehicle |
Lua
local wear = Entity(vehicle).state.tc_wearWarning
Do not write these statebags from the client: they belong to the server, which recomputes them.
#Optional integrations
| Resource | Activation | Effect |
|---|---|---|
tc-compta | Config.Integrations.compta | Partner contracts (discounts) at billing |
tc-logs | Config.Integrations.logs, channel Config.LogsWebhook | Journal copied to Discord |
#Customising the bridge
All framework compatibility is in bridge/ (in clear text). To adapt invoicing, the cash account or vehicle reading, use Config.Bridge.Standalone (see Configuration).