Skip to content

Frontier Wire — Client Exports & Events ​

Client exports read from memory, with no server request, so they are safe to call every frame. They describe the local player's own character and return nil (or 0) before the character is in the world.


Exports ​

GetMailbox()
lua
local mailbox = exports.frontier_mailbox:GetMailbox()   -- {address, name, characterId, unread} or nil
GetMailboxAddress()
lua
local address = exports.frontier_mailbox:GetMailboxAddress()   -- 'FW-000123' or nil
GetUnreadCount()
lua
local unread = exports.frontier_mailbox:GetUnreadCount()   -- number
IsOpen()
lua
local open = exports.frontier_mailbox:IsOpen()   -- true while a postal screen has the player's attention

Client events ​

Local client events, raised at the same moments as the client hooks.

EventArguments
frontier_mailbox:client:openedscreen
frontier_mailbox:client:closednone
frontier_mailbox:client:unreadcount

screen is 'player' (post office counter), 'compose' (telegram paper), 'bird' (carrier bird sheet), 'admin' (admin desk) or 'ace' (the "no permission" card).


Where to put this code ​

The code on this page is client-side Lua and goes in Frontier Wire's own open client hooks file:

text
resources/[frontier-forge]/frontier_mailbox/
  bridge/
    hooks/
      client.lua   ← paste the examples at the bottom of this file
  • The file is loaded by Frontier Wire itself; nothing else is needed. Restart frontier_mailbox after saving.
  • Never paste into frontier_mailbox/client/: those files are escrowed.
  • Back the file up before installing an update, because an update replaces it.

Example: hide the minimap while the post office is open ​

File: frontier_mailbox/bridge/hooks/client.lua. Inside this file the moments are hook functions, so replace the empty Hooks.opened and Hooks.closed already in the file:

lua
function Hooks.opened(screen)
    DisplayRadar(false)
end

function Hooks.closed()
    DisplayRadar(true)
end

More hook examples: Editable Files (Client).

Frontier Forge — RedM documentation for VORP.