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

Combine scripts

1477357250
Tetsuo
Forum Champion
Would it cause any issues to combine all of my commonly used scripts into one big script? is there a known easy way to do this?
1477358062

Edited 1477358445
vÍnce
Pro
Sheet Author
Borrowed from The Aaron I'm pretty sure there is a suggestion. =D Hey, if you want EASY, how about this bookmarklet: javascript:$('<textarea></textarea>').attr({id: 'TheAaronAllScripts'}).css({width:'100%',height: '30em'}).text($('.script .editor').map(function(idx,e){return e.env.editor.getValue();}).toArray().join("\n/* ############################### */;\n\n")).appendTo('body'); In Chrome, make a bookmark with that text as the URL. When on an API page, click it and it will append a textarea to the bottom of the page with all the scripts concatenated together into a single block of text (with a nice divider). Then you can just click in and hit ctrl-A (or cmd-A on the Mac) and copy it. =D
1477358141

Edited 1477358524
vÍnce
Pro
Sheet Author
I really, REALLY , hate the forum's editor. Also, you can just paste all your scripts together and add a " ; " between them for good measure.
1477358615

Edited 1477358668
Tetsuo
Forum Champion
Will try this when I get home. Thanks! EDIT: will these even grab the 1-click install stuff?
1477358828
vÍnce
Pro
Sheet Author
Franky H. said: Will try this when I get home. Thanks! EDIT: will these even grab the 1-click install stuff? I'm not sure.  The bookmarklet was written before the one-click API feature.  Of course, that feature is supposed to make installing scripts easy.  ;-) Aaron will un-cloak and comment I'm sure.
1477359022

Edited 1477359080
Tetsuo
Forum Champion
He always does =D the 1 click installer does make it easier, until it installs 3 copies of each dependant script
1477359279
vÍnce
Pro
Sheet Author
Just tested.  And sdaly it only copies manual scripts. No 1-Click's.  ;-(
1477359441

Edited 1477359594
vÍnce
Pro
Sheet Author
I haven't checked, but I wonder if the 1-click API scripts that are installed get copied over when you make a copy of your game...?  Seems like a natural feature right? Just tested... Nope.
1477359684
Tetsuo
Forum Champion
Thanks :-< manually copying it is I guess
Franky H. said: Would it cause any issues to combine all of my commonly used scripts into one big script? is there a known easy way to do this? Why, does this work? Would save the nightmare of copy/pasting over and over
1477361040
vÍnce
Pro
Sheet Author
You can easily move your scripts from game to game when they are combined as one large script,  however it makes it a little more inconvenient to keep them updated.
1477361213

Edited 1477361259
Tetsuo
Forum Champion
Vince said: You can easily move your scripts from game to game when they are combined as one large script,  however it makes it a little more inconvenient to keep them updated. That was my primary reservation. If the bookmark worked on one-clicks, I had planned to have a master campaign that I kept updated, then just use it to pull all the other scripts into a bundle and update the one bundle across everything else. 
1477361564
The Aaron
Pro
API Scripter
Vince said: Aaron will un-cloak and comment I'm sure. Ha!  Nope.  But I might be able to make one that does.  The bookmarklet just copies the text out of each of the editors and concatenates it.  The text of the 1-click scripts isn't in an editor, so isn't available for that.
1477361752
The Aaron
Pro
API Scripter
I should see if I can make a version that will split it once it's on the new game.
1477362157
Tetsuo
Forum Champion
Even if you could get it to pull the 1-clicks, I could have a master copy of a game with all the updated scripts, and pull it into a single script to push out to the other games as needed. I just don't want to manually copy scripts over and the one click is a nightmare because of the dependency duplication.