Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

Fetch script not working at all?

I don't know for sure how it's supposed to work, but @(selected.info) and any other @(selected.[TEXT HERE]) just makes it post out the text instead of showing the info. MetascriptToolbox is my only set of scripts
1775336757
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
How are you calling fetch? What's the whole macro you are using?
@(selected.rotation) Calling either directly in the chat box or as a token action does not seem to work.
1775352205
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Fetch is an API script. You have to call it as part of an API command. Iirc, it works with any API command e.g.: !@(selected.rotation) Note the exclamation point.
1775376859

Edited 1775377025
Scott C. said: Fetch is an API script. You have to call it as part of an API command. Iirc, it works with any API command e.g.: !@(selected.rotation) Note the exclamation point. That does not work. "Unable to find character with the name "selected.rotation"."
1775399381
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Tested it in one of my games, and it works. Used zeroframe to get simple chat output with: !!@(selected.rotation){&simple} Are you using the parentheses? Or curly braces? And depending on what you want to do, is zeroframe installed? What is the entire macro you are using?
!Spawn {{    --name| Tripwire    --offset| 0,0    --size| 7,1    --order | Front    --rotation|@(selected.rotation) }}
Actually it now appears to be a bug with spawn. It won't allow rotation of 0 to be summoned, apparently.
1775437520
timmaugh
Pro
API Scripter
Yes, sorry to be late to the game (had some family over today). Scott is exactly correct to use {&simple} to get the output (just testing it)... and your formation is exactly correct to get the rotation. If Spawn won't let you summon something at rotation 0, will it let you spawn something at rotation 360? Or, maybe if you have a rotation of 0 you don't have to supply that argument? Either way, you can use APILogic (also in the Metascript Toolbox) to test the value: !Spawn {{    --name|Tripwire    --offset|0,0    --size|7,1    --order|Front    {&if @(selected.rotation) != 0}--rotation|@(selected.rotation){&end} }} That would only include the --rotation command if the rotation was not already 0. Alternatively, you can mask it to be 360: !Spawn {{    --name|Tripwire    --offset|0,0    --size|7,1    --order|Front    --rotation|{&if @(selected.rotation) = 0}360{&else}@(selected.rotation){&end} }} This time, since you're replacing the rotation if it's 0, you expect to have the rotation *always* supplied. We just have to use the IF block to replace the value that is supplied to that argument. Again, these require the whole Metacript Toolbox to be installed. Post back if they give you any difficulty.