Not sure if anyone else needs/wants this, but I was getting tired of constantly writing buttons, input prompts, help files, input handlers, etc. So I made a little GUI library to streamline it. Here's the first beta release. <a href="https://github.com/plexsoup/roll20-api-scripts/blo" rel="nofollow">https://github.com/plexsoup/roll20-api-scripts/blo</a>... Some sample button styles: To use it, include it in your script and make a list of new psGUI.userCommand Then register the list with psGUI.RegisterUserCommands. And build helpfiles with psGUI.BuildHelpFiles. var newUserCommands = [];
var myCommand = new psGUI.userCommand;
myCommand.listener = "!moduleName";
myCommand.commandName = "--commandName";
myCommand.functionToCall = function(parameter1, parameter2, ... ) { blah blah blah };
myCommand.parameters = ["paramType1", "paramType2", ..."paramTypeN"]; // "string", "num", "token_id", "page_id", "character_id", "imgsrc", "current_page_id"
myCommand.shortDesc = "Button Name";
myCommand.longDesc = "This is the Helpfile blurb for the command.";
myCommand.inputOverrides = ["foo", "bar"] // eg: normally a parameter of type "string" will present the player with an input window. If you don't want that dialog, put values in inputOverrides.
myCommand.group = "Section title";
myCommand.style = "buttonstyle" // aqua, material, neon, fantasy
newUserCommands.push(myCommand);
psGUI.RegisterUserCommands(newUserCommands);
psGUI.BuildHelpFiles(newUserCommands);
Let me know if anything breaks, if you have any requests, or if anything just looks weird.