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 .
×
Create a free account

[Script] DryErase -- Updated to v0.1.5

February 10 (9 years ago)

Edited February 10 (9 years ago)
The Aaron
Pro
API Scripter

DryErase v0.1.5

Update v0.1.5 -- Cleaned up config option buttons and added descriptions. (Thanks HoneyBadger!)
Update v0.1.4 -- Fixed Copy/Paste error in checkInstall for updating configs. (Thanks HoneyBadger!)
Update v0.1.3 -- DryErase will now handle drawings created while it wasn't running.  This allows you to install it and process all the drawings created by non-gms in your game to date.  It also means that if the API stops running between sessions all you need to do is start it up again to process any drawings created during the API downtime.

Additionally, there is a new setting: Label Granted Player Drawings.  With this setting toggled on, even granted players' drawings will receive a highlight on the GM layer with a label.  You can safely delete the gm layer label in this case without it deleting the drawing.  If this setting is on, the label will be retained when a drawing is marked as Allowed.

Also, more readable button colors!




Commands:

  • !dry-erase -- accesses the help and configuration (shown above).  Click Grant next to a player to allow them to draw freely.  Click Revoke next to a player to remove their drawing privilege.  No players are granted drawing privilege by default.
Configuration Settings:
  • Auto Delete -- Automatically delete drawings by players that have not been granted drawing permission. [Default: Off]
    • With Report on, you will get a notice about the action taken:
  • Auto Hide -- Automatically move to the GM Layer any drawings by players that have not been granted drawing permission. [Default: On]
    • With Report on, you will get a menu for interacting with the drawing:

      • Erase -- Removes the drawing.
      • Allow -- Restores the drawing to the Objects Layer.
      • Grant Player -- Grants player permission to make future drawings.
    • Hidden drawings are labeled with the name of the player that drew them, as well as being highlighted in their current color:

      • Moving either the drawing or the highlight to the Objects layer has the same effect as clicking Allow.
      • Deleting either the drawing or the highlight has the same effect as clicking Erase.
  • Report -- Notify the GM via a whisper when a player that has not been granted drawing permission makes a drawing. [Default: On]
  • Label Granted Player Drawings -- Add a highlight with the name of the player to drawings made by granted players. [Default: Off]

Previous Release Notes: https://app.roll20.net/forum/permalink/2852459/

Git: https://github.com/shdwjk/Roll20API/blob/master/Dr...
If you use my scripts, want to contribute, and have the spare bucks to do so, go right ahead. However, please don't feel like you must contribute just to use them! I'd much rather have happy Roll20 users armed with my scripts than people not using them out of some sense of shame. Use them and be happy, completely guilt-free!
Disclaimer: This Patreon campaign is not affiliated with Roll20; as such, contributions are voluntary and Roll20 cannot provide support or refunds for contributions.
February 10 (9 years ago)

Edited February 10 (9 years ago)
Error... fresh copy & paste. Disabled all other scripts.

/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1
orts, require, module, __filename, __dirname) { function g(a){throw a;}var j=v
                                                                    ^
TypeError: Cannot read property 'config' of undefined
    at Object.checkInstall (evalmachine.<anonymous>:1062:27)
    at Sandbox.<anonymous> (evalmachine.<anonymous>:1545:14)
    at eval (
February 10 (9 years ago)
The Aaron
Pro
API Scripter
Update v0.1.4 -- Fixed Copy/Paste error in checkInstall for updating configs. (Thanks HoneyBadger!)

Got to love those copy paste errors at 1 in the morning.. =D
February 10 (9 years ago)

Edited February 10 (9 years ago)
Next update... can you right align the toggle buttons? It would make my OCD feel better, lol.
February 10 (9 years ago)
The Aaron
Pro
API Scripter
I can!  I keep meaning to write a better system for handling those, but haven't gotten around to it yet.
February 10 (9 years ago)
The Aaron
Pro
API Scripter
Update v0.1.5 -- Cleaned up config option buttons and added descriptions. (Thanks HoneyBadger!)

Better?  =D
February 10 (9 years ago)
Looks great. :D
February 10 (9 years ago)

Edited February 10 (9 years ago)
The Aaron
Pro
API Scripter
I should really adopt Stephen's toggle buttons... HE sure did a good job making those... =D
February 10 (9 years ago)
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter

The Aaron said:

I should really adopt Stephen's toggle buttons... HE sure did a good job making those... =D

I recommend this book:

February 11 (9 years ago)
The Aaron
Pro
API Scripter
BWAHAHAHAHA 
There is a strange request I would like, if thats okay.

Right now I am trying to perform some mass combat for 5th Edition. Currently I use just the line tool to indicate which creature is attack whom etc etc.

I had hoped to use this script to do two things, one, as a GM delete my drawings as well on a whim, two, maybe a mass delete all drawings? Because I have at least 100 Campaign tabs and alot of them had drawings on them >_>. I never did delete them in the end and the script asks me for choices on all of them. Effectively flooding my page.
March 04 (9 years ago)
The Aaron
Pro
API Scripter
Yikes!  I can see where that might cause a problem. So the request is for:

1) a command to delete all drawings on the object layer
2) better grouping if there are many pre existing drawings (maybe a blanket question per player with the total number of drawings and commands for all of them?)

?

The Aaron said:

Yikes!  I can see where that might cause a problem. So the request is for:

1) a command to delete all drawings on the object layer
2) better grouping if there are many pre existing drawings (maybe a blanket question per player with the total number of drawings and commands for all of them?)

?

Far as I can tell. I cant dry erase the things done by a GM? Unless im blind.
And tbh, a mass delete thing is good enough. :)
March 04 (9 years ago)
The Aaron
Pro
API Scripter
Yeah, the assumption is that the GM is monitoring the player's use of the drawing tools.

I'm working on rewriting my script deploy system (you need one when you have 57+ released scripts and 90+ in development!), so I don't want to deploy any changes to code right now.

In the interim, you can use this little script to erase all drawings on the objects layer.  Only the GM can run it:
on('ready',function(){
    "use strict";

    on('chat:message',function(msg){
        var content,token,damage;

        if('api' === msg.type && playerIsGM(msg.playerid) && msg.content.match(/^!delete-all-drawings/) ){
            _.each(findObjs({
                type: 'path',
                layer: 'objects'
            }),function(p){
                p.remove();
            });
        }
    });
});

Execute it with:
!delete-all-drawings