High Scripts

Documentation

Shared

Shared export functions / types

General

addApplication

Adds an application on the phone. Recommended to use on the server-side for optimization purposes.

Arguments

NameTypeDescription
namestring(Key / name / index) of the app
dataAppConfigApplication config, following the applications.lua config format.
localestableTable of locales for the app, it is inserted into ui.apps..

Example

client.lua
exports['high-phone']:addApplication('bankingv2', {
    icon = {
        imageUrl = "https://aka.ms/confidential",
        background = "#1B1B1B"
    },
    preAdded = false,
    removable = true,
    size = 9.11,
    inAppStore = true,
    developer = "High Scripts",
    preview = {},
    banner = {
        imageUrl = "https://aka.ms/confidential",
        background = "#1C222C",
    },
    defaultSettings = {
        notifications = { allow = true, alerts = 3 }
    }
}, {
    ["en"] = {
        label = "Banking",
        description = "A very great banking application",
        -- More locales if you wish to use the phone's built-in locale system instead of your own.
    }
})
 
exports['high-phone']:sendAppNui('bankingv2', {
    action = 'myevent',
    payload = {
        hello = 'world'
    }
})

addLocales

Merges custom locales into existing ones. Useful for custom application labels and when using phone's built-in i18n module.

Arguments

NameTypeDescription
localetableTable of locales

Example

client.lua
exports['high-phone']:addLocales({
    ["en"] = {
        ui = {
            apps = {
                myapp = {
                    label = "My App",
                    description = "This is a great app"
                }
            }
        }
    }
})

formatNumber

Formats a phone number string into what you have configured.

Arguments

NameTypeDescription
numberstringPhone number that you want to format

Example

shared.lua
local formattedNumber = exports['high-phone']:formatNumber('1234567890')

generateNumber

Generates a phone number based on your config and returns it unformatted

Example

shared.lua
local phoneNumber = exports['high-phone']:generateNumber()

Types

Attachment

NameTypeDescription
type'media' | 'contact' | 'note'Attachment type
contentMedia | Contact | NoteAny attachments content (see below)

Media

NameTypeDescription
type'image' | 'video'Media type
urlstringMedia URL

Contact

NameTypeDescription
numberstringPhone number
namestringName
photostringPhoto URL

Note

NameTypeDescription
titlestringNote title
contentstringNote content

Last updated on

On this page