SHARE
TWEET

Untitled

a guest Oct 12th, 2017 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function (context, args) {
  2.   var upgrades = #s.sys.upgrades({full:true});
  3.   var upgradeCounts = {};
  4.  
  5.   var upgradesLoad = [];
  6.   for (var i = 0; i < upgrades.length; i++) {
  7.     var name = upgrades[i].name;
  8.     if (upgradeCounts[name] == null) {
  9.       upgradeCounts[name] = 0;
  10.     }
  11.     upgradeCounts[name]++;
  12.  
  13.     if ( name == "l0g_wr1t3r" ) {
  14.       upgradesLoad.push(i);
  15.     }
  16.   }
  17.   if (upgradesLoad.length > 0)
  18.     var res = #s.sys.xfer_upgrade_to({i:upgradesLoad,to:"if"});
  19.   return {ok:true}
  20. }
RAW Paste Data
Top