Skip to content

Latest commit

 

History

History
59 lines (33 loc) · 1.8 KB

File metadata and controls

59 lines (33 loc) · 1.8 KB

getsetting

English

Get the value of a setting from the script JSON and store it in a variable, that can be used in functions and conditions.

Portuguese

Obter o valor de uma configuração do JSON do script e guardar em uma variável, que pode ser utilizada em funções e condições.

getsetting(setting path)

  • Parameters
    • setting path: the path of the setting, following the structure of the script JSON, separated by slash /.

Return Value

Returns the setting value upon success, or -1 otherwise.

?> To know what is the setting path of the option you want to check, you must open the script JSON file in any text editor(I recommend Sublime Text) and follow its structure.

For example, if I want to check if the player on screen alert is disabled, I open the script JSON file and see this:

alerts is the main setting, it has other child settings, one of them is playerOnScreen, that also has child settings, we want to check the enabled setting.

So the path will be alerts/playerOnScreen/enabled, and the getsetting function:

$alertEnabled = getsetting(alerts/playerOnScreen/enabled)
if ($alertEnabled = false) then ...

Examples

  1. Check if looting is enabled, and enable if it is disabled.
$lootingEnabled = getsetting(looting/settings/lootingEnabled)
if ($lootingEnabled = 0) then setsetting(looting/settings/lootingEnabled, 1)
  1. Get the main backpack selected in Looting > DepositList and move up to 10 great mana potion stacks to the backpack.
$mainbp = getsetting(looting/depositSettings/backpackSettings/mainBackpack)
mousedragitem(great mana potion, $mainbp, 10, 500)