Difference between revisions of "Script:Object Properties"
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=ObjectProperties | |name=ObjectProperties | ||
|author={{user profile|503018|manveti}} | |author={{user profile|503018|manveti}} | ||
|version=0.1 | |version=0.1 | ||
− | |lastmodified=2015-06-11 | + | |lastmodified=2015-06-11 |
'''ObjectProperties''' allows the user to get and set properties of specified objects. This provides quick access to token IDs, image URLs, etc., as well as the ability to set token bar values, move tokens, and various other tricks which would otherwise require (very small) specialized scripts. | '''ObjectProperties''' allows the user to get and set properties of specified objects. This provides quick access to token IDs, image URLs, etc., as well as the ability to set token bar values, move tokens, and various other tricks which would otherwise require (very small) specialized scripts. | ||
Line 11: | Line 15: | ||
=== Syntax === | === Syntax === | ||
+ | <!-- suppress cateogry | ||
{{syntaxbox top|cron|formal=true}} | {{syntaxbox top|cron|formal=true}} | ||
{{API command|getprop}} {{API parameter|name=options|optional=true}} {{API parameter|name=properties|optional=true}}<br> | {{API command|getprop}} {{API parameter|name=options|optional=true}} {{API parameter|name=properties|optional=true}}<br> | ||
Line 38: | Line 43: | ||
* '''-r''', '''--relative''': When setting properties, the new value will be added to the existing value, rather than overwriting it.}} | * '''-r''', '''--relative''': When setting properties, the new value will be added to the existing value, rather than overwriting it.}} | ||
{{param description bottom}} | {{param description bottom}} | ||
− | + | --> | |
=== Examples === | === Examples === | ||
Line 60: | Line 65: | ||
=== Changelog === | === Changelog === | ||
{{changelog version|0.1|2015-06-11|* Initial release}} | {{changelog version|0.1|2015-06-11|* Initial release}} | ||
− |
Latest revision as of 20:00, 20 September 2021
- RedirectAPI:Script Index
script overview |name=ObjectProperties |author=manveti |version=0.1 |lastmodified=2015-06-11
ObjectProperties allows the user to get and set properties of specified objects. This provides quick access to token IDs, image URLs, etc., as well as the ability to set token bar values, move tokens, and various other tricks which would otherwise require (very small) specialized scripts.
It is recommended that this script be used in conjunction with the CommandShell module, which will improve output formatting and command discovery.
[edit] Syntax
[edit] Examples
- !getprop
- Will display all properties of each selected object.
- !getprop -t graphic -i -Jp3illTx5IjO2NMoxEC name
- Will display the name of the specified graphic object (token).
- !getprop -n Fighter _id _type
- Will display the ID and type of all objects named "Fighter" (e.g. a character and its associated tokens).
- !getprop _pageid
- Will display the ID of the page containing the selected object (an easy way for a GM to get the ID of the page currently being viewed).
- !setprop -r top 70 left -70
- Will move the selected object(s) one square down and one square left.
- !setprop top +70 left -70
- CAUTION: Unlike the previous command, this will move the selected object(s) to the coordinates (-70,70), or off the left edge of the map along the first horizontal grid line.
- !setprop -r bar1_value -3
- Will subtract 3 from bar 1 of the selected token(s).
- !setprop bar1_value -3
- CAUTION: Will set bar 1 of the selected token(s) to "-3".
[edit] Changelog
v0.1 (2015-06-11)
- Initial release