REST.get problem on macro attached to a token.

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
ThermoDyn
Kobold
Posts: 10
Joined: Tue Apr 21, 2020 8:28 am

REST.get problem on macro attached to a token.

Post by ThermoDyn »

Ok, I have a bit of a weird one. I've been working with hl2mt and got most of it running to my taste.

However - I have an issue with REST.get spiiting me a error in a weird place.

If I create a macro in the global tab and use the following code - it will pop up a character sheet in a frame.

Code: Select all

[frame("Character Sheet", "width=600; height=600; "): {
 	 [r: REST.get("http:\\\\thermo.strangled.net\\hl2mt\\b18955130019d97be8e2094a94ac5278cf747d68e54c0895817b8668.html")]
} ]
If I create a macro on the selection pane for a token - and use exactly the same code - I get
You do not have permission to call the "REST.get" function.

On the same selected token - there are some macros that open windows to indexed texts that work perfectly fine.

Code: Select all

[frame("Traits"): {
<html>
<head>
<title>Traits</title>
</head>
<body>
<br>
<h1><u>Luna Marie Traits </u></h1>
<br>
[r: macrolink("Sacred Conduit", "lshow@token", "none", "url=http:\\\\thermo.strangled.net\\hl2mt\\729ab348814b6640ab8f2f7d5f497ec0c04d876fd191c8f608be1ab7.html;lname=Sacred Conduit", currentToken())]<br>
[r: macrolink("Divine Warrior", "lshow@token", "none", "url=http:\\\\thermo.strangled.net\\hl2mt\\d7acb819d8140fce2d5cbc1fdbd9b280f488cac609d74361b8192f8d.html;lname=Divine Warrior", currentToken())]<br>
</body>
</html>
}]
Anyone got any ideas?

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: REST.get problem on macro attached to a token.

Post by Phergus »

The rest functions can only be used by trusted macros. Trusted_Macro

So the macro must have the Players Can Edit Macro permission turned off and the token not owned by a player.

In general it is best to have macros that do this kind of thing on lib:tokens and then just call that macro from a macro on a player token if that is what is needed.

ThermoDyn
Kobold
Posts: 10
Joined: Tue Apr 21, 2020 8:28 am

Re: REST.get problem on macro attached to a token.

Post by ThermoDyn »

Ahhh - ok - thank you for explaining - I will try to move this onto a lib.

Post Reply

Return to “Macros”