Hi guys,
I saw a streamer who has a count of matches for tournaments For example when someone types !match it comes up with Match 3/6 solo cash cup :FortOne :FortOne . And if a mod types !m Match 4/6 solo cash cup it update !match to say Match 4/6 solo cash cup :FortOne :FortOne . But when i tried to replicate this !m kept on coming back that the response must be less than 400 characters.
I am trying to do this via google sheets and a script. This is the script for the google sheets:
function storeData(key, value) {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var lastRow = sheet.getLastRow() + 1;
return "Data stored successfully for key: " + key;
}
function getData(key) {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var data = sheet.getDataRange().getValues();
for (var i = 1; i < data.length; i++) {
if (data[i][0] === key) {
return "Value for " + key + ": " + data[i][1];
}
}
return "Key not found: " + key;
}
The command I entered in to nb for !m which is the storeData function is
$(urlfetch script for google https adresss cant add link/macros/s/AKfycbzgp7WGxYP_cP4JZpAK3l5EgLM62ic7WQPw7PJyHR_SgoA4ax5rHoEKml4UaG9R-0DH1Q/exec?command=storeData&key=$(querystring $(1))&value=$(querystring $(2)))
And for the !match which is the getData function is
$(urlfetch script for google https adresss cant add link/macros/s/AKfycbwlnGVixgMxpJ_ZoJoPbE8NKfjOVb-wozAA75w5l9rTQn5xya5nfGtgvObCYWnpSNdcmA/exec?command=getData&key=$(querystring $(1)))
Could really do with seeing the full code for the commands. If “script for google https adress cant add” means this page won’t put the code in, click the </> button to enter raw code. Same with your script would probably be helpful too !
Better still - Try this - In a browser put your http link line with valid data and see what the response is. If the response is more than 400 chars then that is your problem. Remember to look at the source code for the page if it displays a page. If it replies with an actual web page rather than just a short text string, then that is most likely your problem.
i.e.
https://script.google.com/link/macros/s/AKfycbzgp7WGxYP_cP4JZpAK3l5EgLM62ic7WQPw7PJyHR_SgoA4ax5rHoEKml4UaG9R-0DH1Q/exec?command=storeData&key=[valid data here]&value=[valid data here]