Last updated: June 1, 2026
Dusty Cartridge Games is currently an iOS/iPadOS TestFlight app shell for device-local casual game prototypes.
The app does not collect, transmit, sell, or share personal data.
| function readingThread(){ | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); //Spreadsheet | |
| var d = new Date(); //set date | |
| var h = d.getHours(); //set hour | |
| var m = d.getMinutes(); //set minutes | |
| var delim = "|"; | |
| console.log("initiating readingThread"); | |
| console.log("Hour defined: " + h); | |
| console.log("Minute defined: " + m); | |
| if (h < 2) { |
| function tweetThread(stringToTweet,delim,img,r){ //pass a string variable with additional option to parse (used for bookending tweets) | |
| //////////////////////////Variables//////////////////////////////////////////////////////// | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); //spreadsheet | |
| var twtMax = 280; //Character limit for Twitter (variable in case it changes) | |
| var tweets = new Array(0); //create final array to populate with tweets | |
| var total = ""; //variable for 'total' tweet-length section if parsing is required | |
| var start = 0; //starting character for .substring() function, default 0 | |
| var excess = 0; |
| //////////////////////////Output/////////////////////////////////////////////////////////// | |
| if (r) { | |
| var replyTo = r | |
| } else { | |
| var replyTo = 0; //set reply (each tweet will reply to previous, first will be null | |
| } | |
| for (i in tweets){ //for each tweet in thread... | |
| console.log("Tweet Attempt: " + i); //log attempt number (starting @ 0) | |
| try{ | |
| if (imgs[i]) { //if valid image URL exists... |
| //////////////////////////Split Images///////////////////////////////////////////////////// | |
| if (img){ //if image string has been passed... | |
| var imgs = img.split(","); //split CSV into individual URLs | |
| console.log(img + " contains " + imgs.length + " values!"); //log number of images found | |
| } else { //if no image string has been passed... | |
| console.log("No images passed through threading function"); //log no images | |
| } //end image processing |
| //////////////////////////Parsing Loop///////////////////////////////////////////////////// | |
| while (start<thread[i].length) { //As long as the starting position is NOT at the end of thread[i]... | |
| total = thread[i].substring(start,start + twtMax); //full length of tweet | |
| excess = total.length - total.lastIndexOf(" "); //amount of characters to cut off of 'total' to get to a space (end of last full word) | |
| parsed = thread[i].substring(start,start + twtMax - excess); //new text of tweet-length string ending in full word | |
| start = start + parsed.length + 1; //new start position is the first character after finished tweet | |
| tweets.push(parsed); //adds tweet to thread | |
| console.log("Parsed new tweet," + " length: " + | |
| //////////////////////////Length Check///////////////////////////////////////////////////// | |
| try { //Attempt to check string value for parsing needs | |
| if (stringToTweet == undefined) {throw "Undefined Value: 'stringToTweet'"}; //thrown when tweet string is undefined | |
| var thread = stringToTweet.split(delim); //split initial string along provided delimeter | |
| console.log("Input Thread Length: " + thread.length); //log number of strings in thread | |
| } catch(e) { //Catch thrown error | |
| console.log("Cannot Split Thread. Error: " + e); //Log error | |
| } | |
| try { //attempt to evaluate parsed tweet thread | |
| if (thread == undefined) {throw "Undefined Value: |
| function tweetThread(stringToTweet,delim,img,r){ //pass a string variable with additional option to parse (used for bookending tweets) | |
| //////////////////////////Variables//////////////////////////////////////////////////////// | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); //spreadsheet | |
| var twtMax = 280; //Character limit for Twitter (variable in case it changes) | |
| var tweets = new Array(0); //create final array to populate with tweets | |
| var total = ""; //variable for 'total' tweet-length section if parsing is required | |
| var start = 0; //starting character for .substring() function, default 0 | |
| var excess = 0; |
| function sendTweet(TweetText, IdInResponseTo, ImageAttachURL){ | |
| //////////////////////////Set Variables/////////////////////////////////////////////////////// | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); //spreadsheet | |
| var logsheet = ss.getSheetByName("TweetLog"); | |
| var lastRow = Math.max(logsheet.getLastRow(),1) + 1; | |
| var twitterKeys= { //Twitter Authentication Tokens to pass through props | |
| TWITTER_CONSUMER_KEY: "[YOUR VALUE HERE]", | |
| TWITTER_CONSUMER_SECRET: "[YOUR VALUE HERE]", | |
| TWITTER_ACCESS_TOKEN: "[YOUR VALUE HERE]", | |
| TWITTER_ACCESS_SECRET: "[YOUR VALUE HERE]" |
| //////////////////////////Send Tweet & Process Response/////////////////////////////////////// | |
| try{ //attempt to send tweet | |
| var response = service.sendTweet(status, params); //enter status & params, return response | |
| if (response) { //If response is detected... | |
| console.log("Posted Tweet ID: " + response.id_str); //log response | |
| try { //attempt to log... | |
| logsheet.insertRowBefore(2); //insert row for logs | |
| logsheet.getRange(2,1).setValue(Date()); //timestamp | |
| logsheet.getRange(2,2).setValue(response.id_str); //tweet id | |
| logshe |