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

How to share scripts between games?

I have a "master" game for Gloomhaven from which I transmorgrifier in content. Is this possible for scripts as well? What is the preferred method of sharing scripts between games?
1544999621
Kirsty
Pro
Sheet Author
You can't transmog api scripts, unfortunately. But, as always, The Aaron has a solution !
Nice, I'll try that. Seems like a lot of "low hanging fruit" for "quality of life" for scripters exist... what are the priorities of the dev team? How can I contribute? (Note: I dev software in open source world where those that can, contrbute.)
1545001422
Pat S.
Forum Champion
Sheet Author
If you are seriously interested then take a look at this blog post about the open positions being hired for. They have their application requirements listed in the post also.
1545003726
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I would be remiss to not bring up Macro Character Sheet , as well. It's not a technique for copying scripts, but it does make moving and updating macros between games a breeze. It greatly simplifies the writing of macros as well, as the syntax is simpler.
Call me old fashioned, but until scripts can be moved along with sheets, music, etc, I just open up the script page of both games and copy and paste them one by one. There are some scripts that I have that are problematic and I turn them off when not in use. Makes upgrading them easier for me at least.
1545009099
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Erich S. said: Call me old fashioned, but until scripts can be moved along with sheets, music, etc, I just open up the script page of both games and copy and paste them one by one. There are some scripts that I have that are problematic and I turn them off when not in use. Makes upgrading them easier for me at least. I do it one by one as well. Whenever I've used Aaron's script above, I always get an error somewhere. Besides, I also like to be able to selectively activate and deactivate.
1545014199
GiGs
Pro
Sheet Author
API Scripter
When you use Aaron's method, in the text it gave you, you can search for "###############################" - each script will be divided by a line like that. So you can copy the text dump it gives out into a notepad or similar file, than manually copy each script out of it (just up to ######) and paste each in to your scripts page as a new script. You can also save this text file as a backup.
1545016822
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Handy tip, but you also lose automatic updating of One-Click installs.
1545023357
GiGs
Pro
Sheet Author
API Scripter
true, but I'd expect you only use this to copy scripts that aren't in the one-click installer. It doesnt take much time to re-add the one-click ones through the installer. As long as you can remember which ones you have installed! And the text output can help with that.
1545049401
The Aaron
Pro
API Scripter
Caveat user: state is not copied, so configurations must be manually set back up. I’ve considered writing a script that stores the state in a handout to transmogrify over, but I get bogged down in how to appropriately handle IDs to make it useful...
1545059857
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
One thing that would be a great idea (which I never seem to get around to doing) is to make a configuration macro. Scripts like Group Check or Group Init have macro commands to set them up for properly working with a given sheet. I keep meaning to write a "Run First on New Game" macro...
From an outsider's perspective, and I know I'm straying from original topic, but I wonder the following: There is a roll20 github repo w/ scripts, why not let me specify my own github source of scripts? Images need to come from S3, why not let me specify my own S3 bucket? (Image library management is a nightmare.) Transmorgrifier is awesome, is there a roadmap of new features already planned?
regarding copying scripts, you can bump this to ask for feature: <a href="https://app.roll20.net/forum/post/2342853/api-scripts-copy-with-copy-game#post-6418713" rel="nofollow">https://app.roll20.net/forum/post/2342853/api-scripts-copy-with-copy-game#post-6418713</a> or you can bump this to allow us to write a *#$ @#@$ script copier ourselves: <a href="https://app.roll20.net/forum/post/6957027/internals-provide-a-url-to-trigger-scriptrestart-and-clearing-errorlock" rel="nofollow">https://app.roll20.net/forum/post/6957027/internals-provide-a-url-to-trigger-scriptrestart-and-clearing-errorlock</a> The second link is where I asked for resetting the script host to be a URL. &nbsp;I already have the code to upload scripts to a game, but I didn't bother to write a shrink wrapped tool, because it isn't worth it to me without reloading the scripts automatically too. &nbsp; If someone is interested in writing their own tool to download scripts and copy them to another game, you would need (currently) to do some parsing of HTML and use the URLs mentioned in the following: #!/bin/bash rm roll20*.cookies curl \ &nbsp; &nbsp; &nbsp; &nbsp; --verbose \ &nbsp; &nbsp; &nbsp; &nbsp; -c roll20.cookies \ &nbsp; &nbsp; &nbsp; &nbsp; -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \ &nbsp; &nbsp; &nbsp; &nbsp; -H 'Accept-Encoding: br, gzip, deflate' \ &nbsp; &nbsp; &nbsp; &nbsp; -H 'Host: app.roll20.net' \ &nbsp; &nbsp; &nbsp; &nbsp; -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Safari/605.1.15' \ &nbsp; &nbsp; &nbsp; &nbsp; -H 'Accept-Language: en-us' \ &nbsp; &nbsp; &nbsp; &nbsp; -d @login.txt \ &nbsp; &nbsp; &nbsp; &nbsp; -o roll20_login.respose <a href="https://app.roll20.net/sessions/create" rel="nofollow">https://app.roll20.net/sessions/create</a> \ --next \ &nbsp; &nbsp; &nbsp; &nbsp; --verbose \ &nbsp; &nbsp; &nbsp; &nbsp; -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \ &nbsp; &nbsp; &nbsp; &nbsp; -H 'Host: app.roll20.net' \ &nbsp; &nbsp; &nbsp; &nbsp; -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Safari/605.1.15' \ &nbsp; &nbsp; &nbsp; &nbsp; -H 'Accept-Language: en-us' \ &nbsp; &nbsp; &nbsp; &nbsp; -H 'Referer: <a href="https://app.roll20.net/sessions/create" rel="nofollow">https://app.roll20.net/sessions/create</a>' \ &nbsp; &nbsp; &nbsp; &nbsp; <a href="https://app.roll20.net/campaigns/save_script/3917794/313170" rel="nofollow">https://app.roll20.net/campaigns/save_script/3917794/313170</a> \ &nbsp; &nbsp; &nbsp; &nbsp; --data-urlencode 'name=script.js' \ &nbsp; &nbsp; &nbsp; &nbsp; --data-urlencode <a href="mailto:content@script.js" rel="nofollow">content@script.js</a> where: login.txt has your user name and password like email=your.name%40gmail.com&amp;password=XXX script.js is the script text you want to upload 3917794 is the id of a room, which you can parse out of the html from the web page 313170 is the id of a script, which you can parse out of the html (it is part of the id of the tab where the script is stored) (but as I said, it won't actually load the scripts until you restart the script host.) Turns out the "restart the sandbox" is done via Firebase, so I am not gonna bother doing this. &nbsp;Uploading the script text is pretty easy though, as you can see above.
thomasmckay said: From an outsider's perspective, and I know I'm straying from original topic, but I wonder the following: There is a roll20 github repo w/ scripts, why not let me specify my own github source of scripts? Images need to come from S3, why not let me specify my own S3 bucket? (Image library management is a nightmare.) Transmorgrifier is awesome, is there a roadmap of new features already planned? Oh man, I love your questions so much. &nbsp; But I don't expect you will get any answers for these :( But just in case, I would like to bump each and every one of those questions.
1545231134

Edited 1545231227
Ammo
Pro
The Aaron said: Caveat user: state is not copied, so configurations must be manually set back up. I’ve considered writing a script that stores the state in a handout to transmogrify over, but I get bogged down in how to appropriately handle IDs to make it useful... Yeah I feel you. &nbsp; In my stuff, I allow storing the configuration in handouts to begin with (it is read from there in addition to from State) so it can be moved. &nbsp; For configuration that acts on a token, I have a new thing that reads configuration from token GM Notes and provides the token that contained the commands as an argument, so that you can have portable config attached to tokens directly. &nbsp; But for characters, I guess you just have to make sure you only ever reference them by name? &nbsp; It isn't gonna work I think unless there is some serious "ritual" to your configuration languages and state structure. &nbsp;For example, you could look through for things that look like IDs and dereference them against all the tables (character, graphic, etc.) and put in some magic string that reference the character name and Roll20 User ID instead, if it is a character, and so forth. &nbsp;But for tokens, you would pretty much have to put some tag into their notes so you can recognize them again on the other side... It doesn't seem like a very cost-effective thing to spend time on?
@Ammo - That _curl_ command is a blessing! I added it to my Makefile. Need to clean things up still but very nice start. <a href="https://github.com/thomasmckay/roll20-gloomhaven/tree/wip" rel="nofollow">https://github.com/thomasmckay/roll20-gloomhaven/tree/wip</a>
@thomasmckay: cool. &nbsp; btw you linked a branch that doesn't exist any more but I found it in Master if you end up writing the parts to discover the GAME and SCRIPT from the html, please let me know :) thomasmckay said: @Ammo - That _curl_ command is a blessing! I added it to my Makefile. Need to clean things up still but very nice start. <a href="https://github.com/thomasmckay/roll20-gloomhaven/tree/wip" rel="nofollow">https://github.com/thomasmckay/roll20-gloomhaven/tree/wip</a>
Follow up: &nbsp;The suggestion I made to Roll20 to give us a URL trigger for reloading the Script Host is dead, due to the new policy of closing any suggestions that don't get 10 votes. &nbsp;I don't plan to pursue this, since I have received 0% response to any of my suggestions to Roll20 and am no longer motivated :)
The curl command doesn't seem to be working any longer; is it working for others?