Set a value to a setting in the script JSON. This is a very useful action that opens many possibilites to change settings and start/stop functions while the Cavebot is running.
Setar o valor de uma configuração no JSON do script. Essa é uma action muito útil que abre muitas possibilidades para alterar configurações e parar/iniciar funções enquanto o Cavebot está rodando.
setsetting(setting path)
- Parameters
setting path:the path of the setting, following the structure of the script JSON, separated by slash/.
Return Value
Returns true upon success, or false 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(recommended is Sublime Text) and follow its structure.
For example, if I want to enable the player on screen alert, 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 setsetting function:
setsetting(alerts/playerOnScreen/enabled, 1)Examples
- Disable Looting.
setsetting(looting/settings/lootingEnabled, 0)- Enable the Auto Reconnect.
setsetting(reconnect/autoReconnect, 1)- Stop the Ring Refill function.
setsetting(itemRefill/ringRefillEnabled, 0)- Disable the
Equip Ringfunction for the creature swamp troll in the Targeting settings, by changing theringHotkeyvalue, setting it empty.
setsetting(targeting/targetList/swamp troll/ringHotkey, )
- Disable the internal disconnected check of the Cavebot System, this allows the waypoints to run even if the character is disconnected(to interact with the client for example).
setsetting(cavebotSystem/checkDisconnected, 0)- Change the Cavebot Functioning Mode when it is running(requires to restart the Cavebot), this is useful to get out of the
Coordinatesfunctioning mode in custom map areas where it may not be working correctly.
setsetting(scriptSettings/cavebotFunctioningMode, Markers)
reloadcavebot()
# ...waypoints...
setsetting(scriptSettings/cavebotFunctioningMode, Coordinates)
reloadcavebot()
# ...waypoints...- Stop the Persistent of ID
1.
setsetting(persistent/1/enabled, 0)- Start the Persistent of ID
3.
setsetting(persistent/3/enabled, 1)- Change the Default menu click method setting to
0.
setsetting(scriptSettings/defaultMenuClickMethod, 0)- Change the default limit of how many times the bot scrolls down the Trade List when buying/selling items to NPC. The default is
60. It may be needed to increase when buying items with the npc "Rock in a hard place".
setsetting(cavebotSystem/scrollDownLimit, 120)- Disable and enable the Alert
Image is found 1, this will cause the "label" trigger from Go to label option to reset and be able to trigger again.
setsetting(alerts/Image is found 1/enabled, 0)
wait(1000)
setsetting(alerts/Image is found 1/enabled, 1)- Disable and enable the Persistent of ID
1, this will cause the "label" trigger from Go to label if itemcount option to reset and be able to trigger again.
# ID of persistent "Go to label if itemcount"
$persistentId = 1
setsetting(persistent/$persistentId/enabled, 0)
wait(1000)
setsetting(persistent/$persistentId/enabled, 1)- Change the Persistent "Go to label if itemcount" parameters from Cavebot, useful to set the values with information from the Script Setup.
# ID of persistent "Go to label if itemcount"
$persistentId = 14
# Item to count
$item = mana potion
# Go to label if count is lower than:
$countToLeave = 99
# unlikely to change
$keyItemName = 2
$keyCountValue = 4
setsetting(persistent/$persistentId/userValue/$keyItemName/item, $item)
setsetting(persistent/$persistentId/userValue/$keyCountValue/value, $countToLeave)
