LifeLua 21-08-2025
Documentation for LifeLua, a Lua interpreter for the PS Vita
Loading...
Searching...
No Matches
os

Lua OS library extension. More...

Functions

nil os.delay (number seconds)
 
nil os.exit ()
 
nil os.delaycb (number seconds)
 
nil os.uri (string uri, number flag)
 
nil os.shuttersound (SceShutterSoundType shuttertype)
 
nil os.infobar (SceAppMgrInfoBarVisibility state, SceAppMgrInfoBarColor color, SceAppMgrInfoBarTransparency transparency)
 
nil os.lock (boolean lock, SceShellUtilLockType type,...)
 
nil os.notification (string text)
 
nil os.videoexport (string path)
 
nil os.photoexport (string path)
 
nil os.musicexport (string path)
 
nil os.shutdown ()
 
nil os.standby ()
 
nil os.restart ()
 
string os.title ()
 
string os.titleid ()
 
nil os.closeapp (string titleid)
 
nil os.closeotherapps ()
 
nil os.execute (string path)
 
boolean os.isbatterylow ()
 
boolean os.unsafe ()
 
boolean os.appexists (string titleid)
 
nil os.installdir (string path, boolean head)
 
nil os.installvpk (string path)
 
nil os.appdelete (string titleid)
 
string os.launchparams ()
 
string os.importphoto ()
 
nil os.abortimportphoto ()
 
string os.importvideo ()
 
nil os.abortimportvideo ()
 
nil os.photoreview (string path)
 
nil os.abortphotoreview ()
 
image os.cameraimport ()
 
nil os.abortcameraimport ()
 
number or nil os.cpu (number clock)
 
number or nil os.bus (number clock)
 
number or nil os.gpu (number clock)
 
number or nil os.xbar (number clock)
 
nil os.displayon ()
 
nil os.displayoff ()
 
number or nil os.volume (number vol)
 
number or nil os.mute (number vol)
 
string os.realfirmware ()
 
string os.spoofedfirmware ()
 
string os.factoryfirmware ()
 
string os.keyboard (string title, string default_text, SceUInt32 type, SceUInt32 mode, SceUInt32 option, SceUInt32 dialog_mode, SceUInt32 enter_label, SceUInt32 length)
 
boolean or string os.message (string msg, number type,...)
 
boolean os.systemmessage (number type)
 
boolean os.errormessage (number errorcode)
 
boolean os.progressmessage (string msg)
 
nil os.progressmessagetext (string msg)
 
nil os.setprogressmessage (number value)
 
nil os.incprogressmessage (number inc)
 
nil os.closemessage ()
 
nil os.abortmessage ()
 
nil os.closeime ()
 
nil os.abortime ()
 
table os.runningapps (number max)
 
boolean os.isbatterycharging ()
 
number os.batterypercent ()
 
number os.batterySOH ()
 
number os.batterylifetime ()
 
number os.batteryvoltage ()
 
number os.batterycyclecount ()
 
number os.batterytemperature ()
 
number os.batterycapacity ()
 
number os.remainingbatterycapacity ()
 
boolean os.externalbattery ()
 
nil os.powertick (SceKernelPowerTickType tick)
 
nil os.powerlock (SceKernelPowerTickType tick)
 
nil os.powerunlock (SceKernelPowerTickType tick)
 
boolean os.suspendneeded ()
 

Variables

SceShutterSoundType SCE_SHUTTER_SOUND_TYPE_SAVE_IMAGE
 
SceShutterSoundType SCE_SHUTTER_SOUND_TYPE_SAVE_VIDEO_START
 
SceShutterSoundType SCE_SHUTTER_SOUND_TYPE_SAVE_VIDEO_END
 
SceShellUtilLockType SCE_SHELL_UTIL_LOCK_TYPE_PS_BTN
 
SceShellUtilLockType SCE_SHELL_UTIL_LOCK_TYPE_QUICK_MENU
 
SceShellUtilLockType SCE_SHELL_UTIL_LOCK_TYPE_POWEROFF_MENU
 
SceShellUtilLockType SCE_SHELL_UTIL_LOCK_TYPE_UNK8
 
SceShellUtilLockType SCE_SHELL_UTIL_LOCK_TYPE_USB_CONNECTION
 
SceShellUtilLockType SCE_SHELL_UTIL_LOCK_TYPE_MC_INSERTED
 
SceShellUtilLockType SCE_SHELL_UTIL_LOCK_TYPE_MC_REMOVED
 
SceShellUtilLockType SCE_SHELL_UTIL_LOCK_TYPE_UNK80
 
SceShellUtilLockType SCE_SHELL_UTIL_LOCK_TYPE_UNK100
 
SceShellUtilLockType SCE_SHELL_UTIL_LOCK_TYPE_UNK200
 
SceShellUtilLockType SCE_SHELL_UTIL_LOCK_TYPE_MUSIC_PLAYER
 
SceShellUtilLockType SCE_SHELL_UTIL_LOCK_TYPE_PS_BTN_2
 
SceAppMgrInfoBarVisibility SCE_APPMGR_INFOBAR_VISIBILITY_INVISIBLE
 INFOBAR_VISIBILITY_INVISIBLE for short
 
SceAppMgrInfoBarVisibility SCE_APPMGR_INFOBAR_VISIBILITY_VISIBLE
 INFOBAR_VISIBILITY_VISIBLE for short
 
SceAppMgrInfoBarColor SCE_APPMGR_INFOBAR_COLOR_BLACK
 INFOBAR_COLOR_BLACK for short
 
SceAppMgrInfoBarColor SCE_APPMGR_INFOBAR_COLOR_WHITE
 INFOBAR_COLOR_WHITE for short
 
SceAppMgrInfoBarTransparency SCE_APPMGR_INFOBAR_TRANSPARENCY_OPAQUE
 INFOBAR_TRANSPARENCY_OPAQUE for short
 
SceAppMgrInfoBarTransparency SCE_APPMGR_INFOBAR_TRANSPARENCY_TRANSLUCENT
 INFOBAR_TRANSPARENCY_TRANSLUCENT for short
 
SceUInt32 SCE_IME_TYPE_DEFAULT
 
SceUInt32 SCE_IME_TYPE_BASIC_LATIN
 
SceUInt32 SCE_IME_TYPE_NUMBER
 
SceUInt32 SCE_IME_TYPE_EXTENDED_NUMBER
 
SceUInt32 SCE_IME_TYPE_URL
 
SceUInt32 SCE_IME_TYPE_MAIL
 
SceUInt32 SCE_IME_DIALOG_TEXTBOX_MODE_DEFAULT
 
SceUInt32 SCE_IME_DIALOG_TEXTBOX_MODE_PASSWORD
 
SceUInt32 SCE_IME_DIALOG_TEXTBOX_MODE_WITH_CLEAR
 
SceUInt32 SCE_IME_DIALOG_DIALOG_MODE_DEFAULT
 
SceUInt32 SCE_IME_DIALOG_DIALOG_MODE_WITH_CANCEL
 
SceUInt32 SCE_IME_ENTER_LABEL_DEFAULT
 
SceUInt32 SCE_IME_ENTER_LABEL_SEND
 
SceUInt32 SCE_IME_ENTER_LABEL_SEARCH
 
SceUInt32 SCE_IME_ENTER_LABEL_GO
 
SceUInt32 SCE_IME_OPTION_MULTILINE
 
SceUInt32 SCE_IME_OPTION_NO_AUTO_CAPITALIZATION
 
SceUInt32 SCE_IME_OPTION_NO_ASSISTANCE
 
SceUInt32 SCE_MSG_DIALOG_BUTTON_TYPE_OK
 
SceUInt32 SCE_MSG_DIALOG_BUTTON_TYPE_YESNO
 
SceUInt32 SCE_MSG_DIALOG_BUTTON_TYPE_NONE
 
SceUInt32 SCE_MSG_DIALOG_BUTTON_TYPE_OK_CANCEL
 
SceUInt32 SCE_MSG_DIALOG_BUTTON_TYPE_CANCEL
 
SceUInt32 SCE_MSG_DIALOG_BUTTON_TYPE_3BUTTONS
 
SceUInt32 SCE_MSG_DIALOG_FONT_SIZE_DEFAULT
 
SceUInt32 SCE_MSG_DIALOG_FONT_SIZE_SMALL
 
SceUInt32 SCE_MSG_DIALOG_SYSMSG_TYPE_WAIT
 
SceUInt32 SCE_MSG_DIALOG_SYSMSG_TYPE_NOSPACE
 
SceUInt32 SCE_MSG_DIALOG_SYSMSG_TYPE_MAGNETIC_CALIBRATION
 
SceUInt32 SCE_MSG_DIALOG_SYSMSG_TYPE_WAIT_SMALL
 
SceUInt32 SCE_MSG_DIALOG_SYSMSG_TYPE_WAIT_CANCEL
 
SceUInt32 SCE_MSG_DIALOG_SYSMSG_TYPE_NEED_MC_CONTINUE
 
SceUInt32 SCE_MSG_DIALOG_SYSMSG_TYPE_NEED_MC_OPERATION
 
SceUInt32 SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_MIC_DISABLED
 
SceUInt32 SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_WIFI_REQUIRED_OPERATION
 
SceUInt32 SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_WIFI_REQUIRED_APPLICATION
 
SceUInt32 SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_EMPTY_STORE
 
SceKernelPowerTickType SCE_KERNEL_POWER_TICK_DEFAULT
 
SceKernelPowerTickType SCE_KERNEL_POWER_TICK_DISABLE_AUTO_SUSPEND
 
SceKernelPowerTickType SCE_KERNEL_POWER_TICK_DISABLE_OLED_OFF
 
SceKernelPowerTickType SCE_KERNEL_POWER_TICK_DISABLE_OLED_DIMMING
 
SceInt32 SCE_AVCONFIG_COLOR_SPACE_MODE_DEFAULT
 
SceInt32 SCE_AVCONFIG_COLOR_SPACE_MODE_HIGH_CONTRAST
 

Detailed Description

Function Documentation

◆ os.abortcameraimport()

nil os.abortcameraimport ( )

Aborts currently running camera import dialog

◆ os.abortime()

nil os.abortime ( )

Aborts the IME (keyboard) dialog.

◆ os.abortimportphoto()

nil os.abortimportphoto ( )

Aborts currently running photo import dialog

◆ os.abortimportvideo()

nil os.abortimportvideo ( )

Aborts currently running video import dialog

◆ os.abortmessage()

nil os.abortmessage ( )

Aborts the current message dialog.

◆ os.abortphotoreview()

nil os.abortphotoreview ( )

Aborts currently running photo review dialog

◆ os.appdelete()

nil os.appdelete ( string titleid)

Deletes an app

◆ os.appexists()

boolean os.appexists ( string titleid)

Checks if an app exists

◆ os.batterycapacity()

number os.batterycapacity ( )

Gets the battery's full capacity.

◆ os.batterycyclecount()

number os.batterycyclecount ( )

Gets the battery cycle count.

◆ os.batterylifetime()

number os.batterylifetime ( )

Gets the remaining battery life time in minutes.

◆ os.batterypercent()

number os.batterypercent ( )

Gets the battery percentage.

◆ os.batterySOH()

number os.batterySOH ( )

Gets the battery State of Health (SOH).

◆ os.batterytemperature()

number os.batterytemperature ( )

Gets the battery temperature in Celsius.

◆ os.batteryvoltage()

number os.batteryvoltage ( )

Gets the battery voltage.

◆ os.bus()

number or nil os.bus ( number clock)

Gets or sets the BUS' clock speed

◆ os.cameraimport()

image os.cameraimport ( )

Opens the camera import dialog

◆ os.closeapp()

nil os.closeapp ( string titleid)

Closes a running app by its title ID

◆ os.closeime()

nil os.closeime ( )

Closes the IME (Input Method Editor (keyboard)).

◆ os.closemessage()

nil os.closemessage ( )

Closes the current message dialog.

◆ os.closeotherapps()

nil os.closeotherapps ( )

Closes all of the other running apps

◆ os.cpu()

number or nil os.cpu ( number clock)

Gets or sets the CPU's clock speed

◆ os.delay()

nil os.delay ( number seconds)

Delay the app for a certain amount of time

Parameters
secondsThe number of seconds to delay (defaults to 0)

◆ os.delaycb()

nil os.delaycb ( number seconds)

Delay the app for a certain amount of time and handle any callbacks

Parameters
secondsThe number of seconds to delay (defaults to 0)

◆ os.displayoff()

nil os.displayoff ( )

Turns the display off

◆ os.displayon()

nil os.displayon ( )

Turns the display on

◆ os.errormessage()

boolean os.errormessage ( number errorcode)

Shows an error message dialog from an error code.

Parameters
errorcodeThe error code to display.
Returns
boolean indicating user choice.

◆ os.execute()

nil os.execute ( string path)

Launches a SELF executable (eboot.bin)

Attention
SELF must be in the app partition

◆ os.exit()

nil os.exit ( )

Exits the app

◆ os.externalbattery()

boolean os.externalbattery ( )

Checks if external power is connected.

◆ os.factoryfirmware()

string os.factoryfirmware ( )

Gets the factory firmware version.

◆ os.gpu()

number or nil os.gpu ( number clock)

Gets or sets the GPU's clock speed

◆ os.importphoto()

string os.importphoto ( )

Opens the photo import dialog

Returns
Path of the photo

◆ os.importvideo()

string os.importvideo ( )

Opens the video import dialog

Returns
Path of the video

◆ os.incprogressmessage()

nil os.incprogressmessage ( number inc)

Increments the progress value of the progress bar.

Parameters
incThe value to increment by.

◆ os.infobar()

nil os.infobar ( SceAppMgrInfoBarVisibility state,
SceAppMgrInfoBarColor color,
SceAppMgrInfoBarTransparency transparency )

Sets the state of the infobar

◆ os.installdir()

nil os.installdir ( string path,
boolean head )

Installs a folder app (not a .VPK, but an app in a directory with what a .VPK includes)

◆ os.installvpk()

nil os.installvpk ( string path)

Installs a .VPK

◆ os.isbatterycharging()

boolean os.isbatterycharging ( )

Checks if the battery is charging.

◆ os.isbatterylow()

boolean os.isbatterylow ( )

Gets if the battery is low

◆ os.keyboard()

string os.keyboard ( string title,
string default_text,
SceUInt32 type,
SceUInt32 mode,
SceUInt32 option,
SceUInt32 dialog_mode,
SceUInt32 enter_label,
SceUInt32 length )

Shows a keyboard dialog. (os.ime is the same as os.keyboard)

Parameters
titleThe title of the dialog.
default_textThe default text in the input box.
typeThe type of keyboard (e.g. SCE_IME_TYPE_NUMBER).
modeThe textbox mode (e.g. SCE_IME_DIALOG_TEXTBOX_MODE_PASSWORD).
optionKeyboard options (e.g. SCE_IME_OPTION_MULTILINE).
dialog_modeThe dialog mode (e.g. SCE_IME_DIALOG_DIALOG_MODE_WITH_CANCEL).
enter_labelThe label for the enter key (e.g. SCE_IME_ENTER_LABEL_SEND).
lengthThe max length of the input text.
Returns
The text entered by the user, or nil if cancelled.

◆ os.launchparams()

string os.launchparams ( )

Gets launch parameters

◆ os.lock()

nil os.lock ( boolean lock,
SceShellUtilLockType type,
... )

Locks some shell functionality (e. g. the PS button, the quick menu, the power off menu, USB connection etc.)

Note
After lock has been defined as a boolean, you can add as many SceShellUtilLockType values as you want as the next arguments
Example:
os.lock(true, SCE_SHELL_UTIL_LOCK_TYPE_PS_BTN, SCE_SHELL_UTIL_LOCK_TYPE_QUICK_MENU, SCE_SHELL_UTIL_LOCK_TYPE_USB_CONNECTION)

◆ os.message()

boolean or string os.message ( string msg,
number type,
... )

Shows a message dialog.

Parameters
msgThe message to display.
typeThe button type (e.g. SCE_MSG_DIALOG_BUTTON_TYPE_YESNO).
Returns
boolean or string depending on button type.

◆ os.musicexport()

nil os.musicexport ( string path)

Exports an audio (.mp3) file

◆ os.mute()

number or nil os.mute ( number vol)

Mute the PS Vita

◆ os.notification()

nil os.notification ( string text)

Sends a notification

◆ os.photoexport()

nil os.photoexport ( string path)

Exports a photo (.png, .jpg/.jpeg, .bmp) file

◆ os.photoreview()

nil os.photoreview ( string path)

Opens the photo review dialog

◆ os.powerlock()

nil os.powerlock ( SceKernelPowerTickType tick)

Locks a power state.

Parameters
tickThe power tick type to lock.

◆ os.powertick()

nil os.powertick ( SceKernelPowerTickType tick)

Prevents the system from certain power-saving states.

Parameters
tickThe power tick type (e.g. SCE_KERNEL_POWER_TICK_DISABLE_AUTO_SUSPEND).

◆ os.powerunlock()

nil os.powerunlock ( SceKernelPowerTickType tick)

Unlocks a power state.

Parameters
tickThe power tick type to unlock.

◆ os.progressmessage()

boolean os.progressmessage ( string msg)

Shows a progress message dialog.

Parameters
msgThe message to display.
Returns
boolean indicating user choice.

◆ os.progressmessagetext()

nil os.progressmessagetext ( string msg)

Sets the text of the progress message dialog.

Parameters
msgThe new message.

◆ os.realfirmware()

string os.realfirmware ( )

Gets the real firmware version.

◆ os.remainingbatterycapacity()

number os.remainingbatterycapacity ( )

Gets the battery's remaining capacity.

◆ os.restart()

nil os.restart ( )

Restarts the PS Vita

◆ os.runningapps()

table os.runningapps ( number max)

Gets a table of running applications' title IDs.

Parameters
maxMaximum number of apps to list (defaults to 100).

◆ os.setprogressmessage()

nil os.setprogressmessage ( number value)

Sets the progress value of the progress bar.

Parameters
valueThe value to set (0-100).

◆ os.shutdown()

nil os.shutdown ( )

Turns off the PS Vita completely

Note
os.suspend does the same thing

◆ os.shuttersound()

nil os.shuttersound ( SceShutterSoundType shuttertype)

Play a shutter sound

◆ os.spoofedfirmware()

string os.spoofedfirmware ( )

Gets the spoofed firmware version.

◆ os.standby()

nil os.standby ( )

Puts the PS Vita into standby

◆ os.suspendneeded()

boolean os.suspendneeded ( )

Checks if a suspend is required by the system.

◆ os.systemmessage()

boolean os.systemmessage ( number type)

Shows a system message dialog.

Parameters
typeThe system message type (e.g. SCE_MSG_DIALOG_SYSMSG_TYPE_WAIT).
Returns
boolean indicating user choice.

◆ os.title()

string os.title ( )

Gets the app's title

◆ os.titleid()

string os.titleid ( )

Gets the app's title ID

◆ os.unsafe()

boolean os.unsafe ( )

Checks if the app is in unsafe mode

◆ os.uri()

nil os.uri ( string uri,
number flag )

Opens an URI

Parameters
flagOptional, will default to 0xFFFFF if not set

◆ os.videoexport()

nil os.videoexport ( string path)

Exports a video (.mp4) file

◆ os.volume()

number or nil os.volume ( number vol)

Sets or gets the volume

Parameters
voloptional, volume amount, between 0 to 30

◆ os.xbar()

number or nil os.xbar ( number clock)

Gets or sets the XBAR's clock speed