All Functions Modules Pages
os

Functions

NUMBER os.master ()
 Allows to switch on unsafe mode in the PSVita. More...
 
NUMBER os.access ()
 Allows to know the access mode set in the PSVita (Safe or Unsafe). More...
 
NIL os.debug ()
 Enables the editor in the error screen (Debugger), to edit the script. More...
 
NUMBER os.taicfgreload ()
 Allows to do a config.txt reload from the "tai" folder (henkaku). More...
 
STRING os.language ()
 The language set or determined in the VITA. More...
 
NIL os.delay (NUMBER milliseconds)
 Allows a system delay. More...
 
STRING os.nick ()
 User Nick. More...
 
STRING os.mac ()
 Obtains the MAC adress of the console. More...
 
STRING os.swversion ()
 Identify the firmware installed on the device. More...
 
STRING os.spoofedversion ()
 Identify the spoof firmware on the device. More...
 
TABLE os.devinfo (STRING device)
 Obtains information from the storage capacity of the partition (device). More...
 
NIL os.swapmem ()
 Lets you swap memory cards between accounts without a need to reformat. More...
 
NUMBER os.ram ()
 Obtains the free RAM. More...
 
NUMBER os.totalram ()
 Obtains the total amount of RAM. More...
 
NUMBER os.cpu ()
 The current speed of the CPU. More...
 
NIL os.cpu (NUMBER speed)
 Sets or changes the CPU speed to the specified speed. More...
 
NUMBER os.bus ()
 The current CPU frequency. More...
 
NUMBER os.gpuclock ()
 The current speed of the GPU. More...
 
NIL os.gpuclock (NUMBER speed)
 Sets or changes GPU speed at the specified speed. More...
 
NUMBER os.crossbarclock ()
 The current speed of the GPU Cross. More...
 
NIL os.crossbarclock (NUMBER speed)
 Sets or changes the speed of GPU Cross at the specified speed. More...
 
NIL os.exit ()
 Closes the homebrew. More...
 
NIL os.restart ()
 Restart the homebrew. More...
 
STRING os.password ()
 Gets the console password. More...
 
STRING os.login ()
 The email of user. More...
 
STRING os.psnregion ()
 The region of the user according to the PSN. More...
 
STRING os.titleid ()
 The identifier of the running application. More...
 
STRING os.idps ()
 It allows to know an id that contains specific information on the console. More...
 
STRING os.psid ()
 Let you know a unique 20 byte hexsequence inside your PS Vita/PSTV. More...
 
STRING os.account ()
 Allow know the serial number (account_id) associated in the PSVita with the CMA when transferring data. More...
 
NIL os.message (STRING mje)
 Show a message. More...
 
NUMBER os.message (STRING mje, NUMBER mode)
 Show a message. More...
 
NIL os.uri (STRING cmd)
 Enables the use of URIs commands. More...
 
NUMBER os.newuri (STRING cmd)
 Allows to create a new URI command to access the < ID > of the app in execution. More...
 
NUMBER os.newuri (STRING cmd, STRING id)
 Allows to create a new URI command to access the indicated < ID> More...
 
NUMBER os.browser (STRING cmd)
 Launch web browser app. More...
 
STRING os.arg ()
 Allows you to know the structure and arguments with which the application was called. More...
 
NUMBER os.requiere (STRING path)
 Allows to use ONELua API to add external modules. More...
 
NIL os.updatedb (STRING path)
 Allows to rebuild database, will lose the bubble configuration on livearea (complete restore). More...
 
NIL os.rebuilddb ()
 Allows to rebuild database, will lose the bubble configuration on livearea (complete restore). More...
 
NUMBER os.golivearea ()
 Lets go to 'livearea' without closing the application or press the 'PS' button. More...
 
NIL os.execute (STRING path)
 Allows launching an eboot.bin or SELF file. More...
 
STRING os.getreg (STRING category, STRING key, NUMBER type)
 It allows to know a specific registry of the console. More...
 
STRING os.setreg (STRING category, STRING key, STRING value)
 Allows you to set a specific registry of the console. More...
 
NUMBER os.saveaccount (STRING dst)
 It allows you to backup the files of your PSN account. More...
 
NUMBER os.restoreaccount (STRING src)
 It allows you to restore the backup of the files in your PSN account. More...
 
NUMBER os.removeaccount ()
 Allows you to delete files from your PSN account. More...
 
NUMBER os.titledb (STRING title, STRING titleid)
 Allows you to set the title of a bubble in the 'livearea' (method app.db). More...
 
NUMBER os.requireusb ()
 It allows to load the USB Mass Storage module. More...
 

Detailed Description

OS functions.

Function Documentation

NUMBER os.master ( )

Allows to switch on unsafe mode in the PSVita.

Returns
1 if success, 0 otherwise.
NUMBER os.access ( )

Allows to know the access mode set in the PSVita (Safe or Unsafe).

Returns
Returns the value 1 if we got full access (unsafe), or 0 if we got limited access (safe).
NIL os.debug ( )

Enables the editor in the error screen (Debugger), to edit the script.

Returns
Nothing.
NUMBER os.taicfgreload ( )

Allows to do a config.txt reload from the "tai" folder (henkaku).

Returns
1 if success, 0 otherwise.
STRING os.language ( )

The language set or determined in the VITA.

Returns
The language set in the VITA (upper case), any of the following:
  • JAPANESE
  • ENGLISH
  • FRENCH
  • SPANISH
  • GERMAN
  • ITALIAN
  • DUTCH
  • PORTUGUESE
  • RUSSIAN
  • KOREAN
  • CHINESE_T
  • CHINESE_S
  • FINNISH
  • SWEDISH
  • DANISH
  • NORWEGIAN
  • POLISH
  • PORTUGUESE_BR
  • TURKISH
NIL os.delay ( NUMBER  milliseconds)

Allows a system delay.

Parameters
millisecondsDelay duration (in milliseconds).
Returns
Nothing.
STRING os.nick ( )

User Nick.

Returns
The User's Nick configured in the PSP.
STRING os.mac ( )

Obtains the MAC adress of the console.

Returns
The MAC adress in format: XX:XX:XX:XX:XX:XX
STRING os.swversion ( )

Identify the firmware installed on the device.

Returns
The system version, example '3.60'.
STRING os.spoofedversion ( )

Identify the spoof firmware on the device.

Returns
The system version spoof, example '3.65'.
TABLE os.devinfo ( STRING  device)

Obtains information from the storage capacity of the partition (device).

Parameters
deviceThe device: "gro0:", "grw0:", "os0:", "pd0:", "sa0:", "tm0:", "ud0:", "ur0:", "ux0:", "vd0:", "vs0:"
Returns
A table with the following fields:
  • max: Total capacity of the partition in bytes.
  • free: Amount of free memory of the partition in bytes.
  • used: Amount of used memory of the partition in bytes.
NIL os.swapmem ( )

Lets you swap memory cards between accounts without a need to reformat.

Returns
Nothing.
NUMBER os.ram ( )

Obtains the free RAM.

Returns
The amount of free RAM in bytes..
NUMBER os.totalram ( )

Obtains the total amount of RAM.

Returns
The total amount of RAM in bytes (calculated when ONElua starts).
NUMBER os.cpu ( )

The current speed of the CPU.

Returns
CPU speed in which you are the VITA (values 41-444).
Note
The default speed is 333Mhz.
NIL os.cpu ( NUMBER  speed)

Sets or changes the CPU speed to the specified speed.

Parameters
speedIt is the new CPU clock speed should be from 41 to 444.
Returns
Nothing.
NUMBER os.bus ( )

The current CPU frequency.

Returns
The frequency of the CPU on which is the VITA (values 41-222).
Note
The default speed is 222MHz.
NUMBER os.gpuclock ( )

The current speed of the GPU.

Returns
GPU speed which is the VITA (values 41-166).
Note
The default speed is 111Mhz.
NIL os.gpuclock ( NUMBER  speed)

Sets or changes GPU speed at the specified speed.

Parameters
speedIt is the new GPU clock speed should be from 41 to 166.
Returns
Nothing.
NUMBER os.crossbarclock ( )

The current speed of the GPU Cross.

Returns
GPU Cross speed in which you are the VITA (values 111-222).
Note
The default speed is 111Mhz.
NIL os.crossbarclock ( NUMBER  speed)

Sets or changes the speed of GPU Cross at the specified speed.

Parameters
speedIt is the new GPU Cross clock speed should be 111 to 222.
Returns
Nothing.
NIL os.exit ( )

Closes the homebrew.

Returns
Nothing.
NIL os.restart ( )

Restart the homebrew.

Returns
Nothing.
STRING os.password ( )

Gets the console password.

Returns
The password configured in the console.
STRING os.login ( )

The email of user.

Returns
The email user configured in the VITA.
STRING os.psnregion ( )

The region of the user according to the PSN.

Returns
The region of the user according to the PSN configured in the VITA.
STRING os.titleid ( )

The identifier of the running application.

Returns
A string with the identifier of the running application (9 digits).
STRING os.idps ( )

It allows to know an id that contains specific information on the console.

Returns
The id information from your console (16 digits).
STRING os.psid ( )

Let you know a unique 20 byte hexsequence inside your PS Vita/PSTV.

Note
It is recommended not to show the public this information.
Returns
The psid of the console.
STRING os.account ( )

Allow know the serial number (account_id) associated in the PSVita with the CMA when transferring data.

Note
Documents/PSVita/XXXXXXXXXXX <– account_id.
Returns
A string with the serial number.
NIL os.message ( STRING  mje)

Show a message.

Parameters
mjeThe message to show.
Returns
Nothing.
Note
Only show "Quit" option.
NUMBER os.message ( STRING  mje,
NUMBER  mode 
)

Show a message.

Parameters
mjeThe message to show.
modeNumeric value: 1 for advanced message (with YES or NO options).
Returns
A numeric value according to the message reply:
  • 1: If the reply is YES.
  • 0: If the reply is NO.
NIL os.uri ( STRING  cmd)

Enables the use of URIs commands.

Parameters
cmdSome URI command available.
Note
Visit VitaDevWiki for more information.
Returns
Nothing.
NUMBER os.newuri ( STRING  cmd)

Allows to create a new URI command to access the < ID > of the app in execution.

Parameters
cmdNew URI command to be created.
Note
In case of an existing command, will get overwritten wih the new < ID > access.
Returns
The numeric value 1 in case of success, otherwise 0.
NUMBER os.newuri ( STRING  cmd,
STRING  id 
)

Allows to create a new URI command to access the indicated < ID>

Parameters
cmdNew URI command to be created.
idapp ID.
Note
In case of an existing command, will get overwritten wih the new < ID > access.
Returns
The numeric value 1 in case of success, otherwise 0.
NUMBER os.browser ( STRING  cmd)

Launch web browser app.

Returns
A numerical value of 1 on success, 0 otherwise.
STRING os.arg ( )

Allows you to know the structure and arguments with which the application was called.

Note
This function only returns values the first time it is run, it is recommended to save them to a global variable.
Returns
A string, with structure and arguments, example, "psgm:play?titleid=<ID>".
NUMBER os.requiere ( STRING  path)

Allows to use ONELua API to add external modules.

Parameters
pathPath to the prx.
Returns
1 if success, 0 otherwise.
NIL os.updatedb ( STRING  path)

Allows to rebuild database, will lose the bubble configuration on livearea (complete restore).

Returns
Nothing.
Note
It is highly recommended to restart the console inmediately with function power.restart()
NIL os.rebuilddb ( )

Allows to rebuild database, will lose the bubble configuration on livearea (complete restore).

Returns
Nothing.
Note
It is highly recommended to restart the console inmediately with function power.restart()
NUMBER os.golivearea ( )

Lets go to 'livearea' without closing the application or press the 'PS' button.

Returns
A numerical value 1 in case of success, 0 otherwise.
NIL os.execute ( STRING  path)

Allows launching an eboot.bin or SELF file.

Parameters
pathPath to the .bin or SELF file.
Note
SELF file must be located in app0: partition.
Returns
Nothing.
STRING os.getreg ( STRING  category,
STRING  key,
NUMBER  type 
)

It allows to know a specific registry of the console.

Parameters
categoryThe category of the registry.
keyThe name of the registry.
typeA number 1 in case of requiring a number or a number 2 in case a string is required.
Returns
A number or string according to the request, in case of error returns a string with the details.
STRING os.setreg ( STRING  category,
STRING  key,
STRING  value 
)

Allows you to set a specific registry of the console.

Parameters
categoryThe category of the registry.
keyThe name of the registry.
valueThe new value to be set in the registry can be a string or number. Example: sceRegMgrSetKeyInt("/CONFIG/NP/", "enable_np", 1)
Returns
A number 0 in case of success or less than 0 in case of error.
NUMBER os.saveaccount ( STRING  dst)

It allows you to backup the files of your PSN account.

Parameters
dstThe path to the folder where the backup will be made.
Returns
A numerical value 1 in case of success, 0 in case of error.
Note
The PSN files are:
  • tm0:/npdrm/act.dat.
  • vd0:registry/system.dreg.
  • vd0:registry/system.ireg.
NUMBER os.restoreaccount ( STRING  src)

It allows you to restore the backup of the files in your PSN account.

Parameters
srcThe path to the folder where the backup is located.
Returns
A numerical value 1 in case of success, 0 in case of error.
Note
The PSN files are:
  • tm0:/npdrm/act.dat.
  • vd0:registry/system.dreg.
  • vd0:registry/system.ireg.
NUMBER os.removeaccount ( )

Allows you to delete files from your PSN account.

Returns
A numerical value 1 in case of success, 0 in case of error.
Note
The PSN files are:
  • tm0:/npdrm/act.dat.
  • vd0:registry/system.dreg.
  • vd0:registry/system.ireg.
NUMBER os.titledb ( STRING  title,
STRING  titleid 
)

Allows you to set the title of a bubble in the 'livearea' (method app.db).

Parameters
titleThe new title of the bubble.
titleidThe identifier of the bubble (9 digits).
Returns
A numerical value 1 in case of success, less than 0 in case of error.
Note
To notice the change does not require a full reboot of the console.
NUMBER os.requireusb ( )

It allows to load the USB Mass Storage module.

Returns
A numerical value 1 in case of success, nil in case of failure.
Note
This function must be used before using the 'USB' module and its functions in the interpreter.