
Hello awesome people!
I have created a SmartAoE Script Generator in Google Sheets to automate the task of creating scripts for spells. Just fill out the options (the help text on the right side auto updates and will check for the majority of conflicts with settings), and click the Generate button and you're done! This was mainly created to simplify the process of creating a SmartAoE and to make it easier for newcomers to get up and running more quickly.
>> Link to the Original SmartAoE Thread <<
Step 1:
>> SmartAoE Script Generator Sheet <<
Click the link ^, then create a copy of the sheet. This is under File >> Make a copy
Step 2:
The script below needs to be added to the copied sheet in order to format the output text properly (and for the Generate button to work). This is done by selecting "Extensions" >> "Apps Script".
Then copy/paste the following:
function updateCodeSheet() {var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();// Get the sheetsvar cleanSheet = spreadsheet.getSheetByName("Clean");var codeSheet = spreadsheet.getSheetByName("Code");// Get the datavar cleanData = cleanSheet.getRange("W:W").getValues();var codeData = codeSheet.getRange("A:A").getValues();// Array to hold the new data for the Code sheetvar newData = [];// Loop through the data in the Clean sheetfor (var i = 0; i < cleanData.length; i++) {if (cleanData[i][0] === " --dc|{selected|spell_save_dc}" || cleanData[i][0].startsWith(" --radius|")) {// Add a blank cell before the matched cell to newData arraynewData.push([""]);newData.push([cleanData[i][0]]);} else if (cleanData[i][0] !== "") {// Add non-blank and non-matched cells to newData arraynewData.push([cleanData[i][0]]);}}// Clear old data from the Code sheet starting from row 3codeSheet.getRange(3, 1, codeData.length - 2, 1).clearContent();// Add the new data to the Code sheet starting from row 3codeSheet.getRange(3, 1, newData.length, 1).setValues(newData);}
Step 3:
You'll then need to right click the generate button, select the 3 dots on the side and click "Assign script". The name of the script to assign should be "updateCodeSheet" without the quotes. See graphic below for more info!
Step 4:
Fill out the data you'd like to include on the Clean sheet, and click the Generate button. Your code will appear on the Code sheet. Then just copy/pasta into roll20 and you're done!
There a few things on the to do list for this: Most of the options that support HTML are currently hardcoded instead of offering options (because there are a lot of possibilities). This will be updated to allow for greater specificity as soon as I get a little more free time. Please let me know if anything is busted - I should have 95%+ of the bugs worked out.
Thank you David M. for your amazing SmartAoE script!
-Xen