SHARE
TWEET

Untitled

a guest Feb 14th, 2020 7 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  var ss = SpreadsheetApp.getActiveSpreadsheet();
  2. var serverlist_sheet = ss.getSheets()[N]
  3. var player_name_array = [7,15,20,32,40,58,64]; // This is the only thing that is manual,
  4. // Get data is what updates the server and gets the player list
  5. function getData() {
  6.   var queryString = Math.random();
  7.   var sheet = ss.getSheets()[N]
  8.  
  9.   var cellFunction1 = '=IMPORTXML("' + serverlist_sheet.getRange('A1').getValue() + '?' + queryString + '","'+ serverlist_sheet.getRange('A2').getValue() + '")';
  10.   serverlist_sheet.getRange('C1').setValue(cellFunction1);
  11.  
  12.   var cellFunction2 = '=IMPORTXML("' + serverlist_sheet.getRange('E1').getValue() + '?' + queryString + '","'+ serverlist_sheet.getRange('E2').getValue() + '")';
  13.   serverlist_sheet.getRange('G1').setValue(cellFunction2);
  14. }
  15.  
  16. // Check player checks if the player
  17. function checkplayer() {
  18.  var rank_sheet = ss.getSheets()[H];
  19.  var playersheet = ss.getSheets()[N];
  20.   for(var i = 2; i < 101 ; i++) {
  21.     if(playersheet.getRange(i,3).getValue() == "") {
  22.     }
  23.     else {
  24.       for(var p = 0; p < player_name_array.length; p++) {
  25.      var player = rank_sheet.getRange(i,6);
  26.         if (rank_sheet.getRange(player_name_array[p],2).getValue() == playersheet.getRange(i,3).getValue()) {
  27.            rank_sheet.getRange(player_name_array[p],6).setValue("0")}
  28.        
  29.     }
  30.   }
  31. }
  32. }
  33.  
  34. function updateplayer() {
  35.   var rank_sheet = ss.getSheets()[H];
  36.   for(var i = 0; i < player_name_array.length; i++) {
  37.     var player_days = rank_sheet.getRange(player_name_array,6);
  38.     player_days.setValue(player_days.getValue()+1)}
  39.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top