Skip to content

Commit

Permalink
Fixed sample
Browse files Browse the repository at this point in the history
  • Loading branch information
Haxxer committed Oct 31, 2024
1 parent b464c25 commit 367f30f
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions docs/sample-macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Remove the `userIds` portion to only show the interface for yourself.

```js
game.itempiles.API.renderItemPileInterface(game.actors.getName("ACTOR_NAME_HERE"), {
userIds: game.users.map(user => user.id)
userIds: game.users.map(user => user.id)
});
```

Expand All @@ -20,7 +20,13 @@ Select tokens, run macro. They can now be looted.

```js
if (!canvas.tokens.controlled.length) return;
game.itempiles.API.turnTokensIntoItemPiles(canvas.tokens.controlled)
game.itempiles.API.turnTokensIntoItemPiles(canvas.tokens.controlled, {
pileSettings: {
displayOne: false,
showItemName: false,
overrideSingleItemScale: false
}
});
```

### Revert tokens from being lootable
Expand Down Expand Up @@ -49,11 +55,11 @@ preserved.
```js
if (!canvas.tokens.controlled.length) return;
for (const selected_token of canvas.tokens.controlled) {
await game.itempiles.API.rollItemTable("MY_TABLE_NAME_HERE", {
timesToRoll: "1d4+1",
targetActor: selected_token.actor,
removeExistingActorItems: false
});
await game.itempiles.API.rollItemTable("MY_TABLE_NAME_HERE", {
timesToRoll: "1d4+1",
targetActor: selected_token.actor,
removeExistingActorItems: false
});
}
await game.itempiles.API.turnTokensIntoItemPiles(canvas.tokens.controlled);
```
Expand Down

0 comments on commit 367f30f

Please sign in to comment.