Difference between revisions of "Mod:Gobalconfig"
From Roll20 Wiki
Andreas J. (Talk | contribs) m (api navbar) |
Andreas J. (Talk | contribs) m |
||
Line 9: | Line 9: | ||
Here's a code example from the `StatusFx` script: | Here's a code example from the `StatusFx` script: | ||
β | + | <pre data-language="javascript" style="overflow:auto;"> | |
// Get the FX configurations from the useroptions. | // Get the FX configurations from the useroptions. | ||
var useroptions = (globalconfig && | var useroptions = (globalconfig && | ||
(globalconfig.StatusFX || globalconfig.statusfx)) || | (globalconfig.StatusFX || globalconfig.statusfx)) || | ||
{ 'red': 'splatter-blood [1,-1]', 'green': 'bubbling-acid', 'custom': 'sleep: glow-holy|stars: beam-fire [2,3]', 'interval': 500}; | { 'red': 'splatter-blood [1,-1]', 'green': 'bubbling-acid', 'custom': 'sleep: glow-holy|stars: beam-fire [2,3]', 'interval': 500}; | ||
β | + | </pre> | |
More info in the forums: | More info in the forums: |
Revision as of 20:00, 25 March 2021
Roll20 Mod
Use Mods
- Use & Install
- Mod:Script Index & Suggestions
- Short Community Scripts
- Meta Scripts
- User Documentation
- Mod Scripts(Forum)
- Mod Update 2024π
- Macro Guide
Mod Development
Reference
- Objects
- Events
- Chat Events & Functions
- Utility Functions
- Function
- Roll20 object
- Token Markers
- Sandbox Model
- Debugging
Cookbook
API - globalconfig
This article is a stub. |
The `globalconfig` variable is available for use in API scripts and it is related to the `state` variable. Unlike `state`, `globalconfig` does not persist and gets reset anytime the sandbox restarts.
`globalconfig` contains key/value properties of 1-click user options.
Here's a code example from the `StatusFx` script:
// Get the FX configurations from the useroptions. var useroptions = (globalconfig && (globalconfig.StatusFX || globalconfig.statusfx)) || { 'red': 'splatter-blood [1,-1]', 'green': 'bubbling-acid', 'custom': 'sleep: glow-holy|stars: beam-fire [2,3]', 'interval': 500};
More info in the forums: