Difference between revisions of "Script:StateBrowser"
From Roll20 Wiki
Andreas J. (Talk | contribs) (tagged as "discontinued API") |
Andreas J. (Talk | contribs) (redirect to Script Index, API no longer available) |
||
Line 1: | Line 1: | ||
− | + | #Redirect[[API:Script Index]] | |
+ | <!-- Don't delete redirect, help center links to this page even though API have been removed | ||
+ | [[Category:Discontinued API Scripts]] --> | ||
+ | |||
+ | script overview | ||
|name=StateBrowser | |name=StateBrowser | ||
|author={{user profile|503018|manveti}} | |author={{user profile|503018|manveti}} | ||
|version=0.1 | |version=0.1 | ||
− | |lastmodified=2015-07-24 | + | |lastmodified=2015-07-24 |
'''StateBrowser''' allows a user to view and modify properties of the state object. | '''StateBrowser''' allows a user to view and modify properties of the state object. | ||
Line 11: | Line 15: | ||
=== Syntax === | === Syntax === | ||
+ | <!-- suppress category | ||
+ | |||
{{syntaxbox top|state|formal=true}} | {{syntaxbox top|state|formal=true}} | ||
{{API command|state}} {{API parameter|name=options|optional=true}} {{API parameter|name=path|optional=true}} {{API parameter|name=value|optional=true}}<br> | {{API command|state}} {{API parameter|name=options|optional=true}} {{API parameter|name=path|optional=true}} {{API parameter|name=value|optional=true}}<br> | ||
Line 37: | Line 43: | ||
{{param description|name=value|value=Value to which to set object, in JSON.}} | {{param description|name=value|value=Value to which to set object, in JSON.}} | ||
{{param description bottom}} | {{param description bottom}} | ||
− | + | --> | |
=== Examples === | === Examples === | ||
Line 53: | Line 59: | ||
=== Changelog === | === Changelog === | ||
{{changelog version|0.1|2015-07-24|* Initial release}} | {{changelog version|0.1|2015-07-24|* Initial release}} | ||
− |
Latest revision as of 19:57, 20 September 2021
- RedirectAPI:Script Index
script overview |name=StateBrowser |author=manveti |version=0.1 |lastmodified=2015-07-24
StateBrowser allows a user to view and modify properties of the state object.
It is recommended that this script be used in conjunction with the CommandShell module, which will improve output formatting and command discovery, and will allow whitespace to be preserved in property values.
[edit] Syntax
[edit] Examples
- !state foo.bar
- Displays the value of
state.foo.bar
, assuming it exists. Ifstate.foo.bar
does not exist, an error will be generated.
- Displays the value of
- !state -s foo.bar "{'blah': 'bloh'}"
- Sets
state.foo.bar
to an object with a single property: "blah", with value "bloh", assuming thatstate.foo.bar
exists. Ifstate.foo.bar
does not exist, an error will be generated.
- Sets
- !state -s foo.bar.baz 42
- Sets
state.foo.bar.baz
to 42. Ifstate.foo.bar
didn't already exist, it will now be {'baz': 42}.
- Sets
- !state -d foo.bar
- If
state.foo.bar
exists, prompts the user to confirm deletion. Then (if the user clicks the button to confirm) deletesstate.foo.bar
. Ifstate.foo.bar
does not exist, an error will be generated.
- If
- !state -D foo.bar
- Immediately deletes
state.foo.bar
if it exists. If it does not exist, an error will be generated.
- Immediately deletes
[edit] Changelog
v0.1 (2015-07-24)
- Initial release