-
Notifications
You must be signed in to change notification settings - Fork 573
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Pathv2-Jumpgate-Itsatrap' of github.com:shdwjk/roll20-a…
…pi-scripts into Pathv2-Jumpgate-Itsatrap
- Loading branch information
Showing
9 changed files
with
13,819 additions
and
31 deletions.
There are no files selected for viewing
13,048 changes: 13,048 additions & 0 deletions
13,048
Earthdawn (FASA Official) character sheet companion/03.330/Earthdawn.js
Large diffs are not rendered by default.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
Earthdawn (FASA Official) character sheet companion/script.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{ | ||
"name": "Triggered Cleanup", | ||
"script": "Triggered Cleanup.js", | ||
"version": "1.0", | ||
"version": "1.1", | ||
"previousversions": [], | ||
"description": "Originally designed for a specific table, this script was made with one-offs and LC/Westmarches in mind. Many APIs find difficulties in running scripts when numerous tokens are left on a table. This script removes all tokens linked to a character sheet when using the command [!cleanup] in the chat. It also deletes tokens when the linked character sheet is deleted. It will ignore any tokens on a map that has the word [bullpen] in the name (not case-sensitive)", | ||
"description": "Originally designed for a specific table, this script was made with one-offs and LCs/Westmarches in mind. Many APIs find difficulties in running scripts when numerous tokens are left on a table. This script removes all tokens linked to a character sheet when using the command [!cleanup] in the chat. It also deletes tokens when the linked character sheet is deleted. It will ignore any tokens on a map that has the word [bullpen] in the name (not case-sensitive)", | ||
"authors": "Jeffrey Simons", | ||
"roll20userid": "4069317", | ||
"useroptions": [], | ||
"dependencies": [], | ||
"conflicts": [] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Improved efficiency by reorganizing when certain calls were made. | ||
|
||
Found that two findObjs calls were performed with every chat entry. This should now only trigger when the API command is used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* This script wildelete all tokens that are linked to a character when entering [!cleanup] in the chat (not case-sensitive). | ||
The script will also delete tokens for character sheets that are deleted. | ||
The script will not delete any tokens on a map with the phrase "Bullpen" (not case sensitive) in the name. | ||
*/ | ||
on('destroy:character',function(obj){ | ||
log(obj.get('_id')) | ||
let tokens = findObjs({ type: 'graphic', represents: obj.get('_id') }); | ||
const inMap = new Array() | ||
let maps = findObjs({type: 'page'}) | ||
for (let i = 0; i < maps.length; i++) { | ||
if (maps[i].get('name').toLowerCase().includes('bullpen')){ | ||
inMap.push(maps[i]) | ||
} | ||
} | ||
for(let i = 0; i < tokens.length; i++){ | ||
let flag = 1 | ||
for(let j = 0; j < inMap.length; j++){ | ||
if(tokens[i].get('_pageid')===inMap[j].get('_id')){ | ||
log("inMap Name: " + inMap[j].get('name')) | ||
flag = 0 | ||
} | ||
} | ||
if (flag){ | ||
tokens[i].remove(); | ||
} | ||
} | ||
}) | ||
|
||
on("chat:message", function(msg) { | ||
if(msg.content.toLowerCase() === "!cleanup"){ | ||
let tokens = findObjs({ type: 'graphic' }); | ||
const inMap = new Array() | ||
let maps = findObjs({type: 'page'}) | ||
for (let i = 0; i < maps.length; i++) { | ||
if (maps[i].get('name').toLowerCase().includes('bullpen')){ | ||
inMap.push(maps[i]) | ||
} | ||
} | ||
for(let i = 0; i < tokens.length; i++){ | ||
log("Token: " + tokens[i].get('_id') + " & " + tokens[i].get('represents')) | ||
let flag = 1 | ||
for(let j = 0; j < inMap.length; j++){ | ||
if(tokens[i].get('represents') === ''){ | ||
flag = 0 | ||
} | ||
if(tokens[i].get('_pageid')===inMap[j].get('_id')){ | ||
flag = 0 | ||
} | ||
} | ||
if (flag){ | ||
tokens[i].remove(); | ||
} | ||
} | ||
} | ||
}) |