settings

October 22, 2022

settings

[New in v8.2.0]

This module allows you to control some Auto.js internal settings, such as stable mode, volume up key off script, etc.; it will also support modifying some system settings in the future.

$settings.setEnabled(key, value)

  • key {string} The key name of the function to be set. Currently includes.
    • stable_mode Stable mode. Takes effect the next time accessibility is enabled after setting.
    • enable_accessibility_service_by_root Whether to enable the accessibility service using Root privileges.
    • stop_all_on_volume_up Whether to stop all scripts when volume up key is pressed (this feature is enabled by default)
    • not_show_console Whether to not show the log screen when booting
    • foreground_service whether to enable foreground service notifications (used for live retention)
  • value {boolean} whether to enable this feature

Set whether a feature/setting item is enabled or not.

``javascript // Enable stable mode $settings.setEnabled('stable_mode', true);

// Disable foreground services $settings.setEnabled('foreground_service', false);


## $settings.isEnabled(key)
* `key` {string} The key name of the function to be set. See `$settings.setEnabled()`
* Returns {boolean} whether the feature is enabled or not

Determines if a feature/settings is enabled.

```javascript
// Print whether a series of settings switches are turned on or not
log('Stable mode: ' + $settings.isEnabled('stable_mode'));
log('Enable accessibility service with Root: ' + $settings.isEnabled('enable_accessibility_service_by_root'));
log('Volume up key stops all scripts: ' + $settings.isEnabled('stop_all_on_volume_up'));
log('Not showing log screen on startup: ' + $settings.isEnabled('not_show_console'));
log('Foreground service: ' + $settings.isEnabled('foreground_service'));
```js

Last update:
Contributors: hyb1996