Advertisement
Zombified

Ladder Reset Proggy

Jan 22nd, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  *  @filename   ZomScript.js
  3.  *  @author     Zombie
  4.  *  @desc       Ladder Reset Script
  5.  */
  6.  
  7.  
  8. var
  9.     leader = false,
  10.     leadZom = "",
  11.     boer = false,
  12.     boZom = "",
  13.     moocher = false,
  14.     moochZoms = [],
  15.     zombies = Config.ZomScript.Profiles,
  16.     horde = Config.ZomScript.Profiles.length,
  17.     myJob = "",
  18.     scratchNuts = true,
  19.    
  20.     cWh = "ÿc0", // White
  21.     cGr = "ÿc2", // Green
  22.     cGo = "ÿc4", // Gold
  23.  
  24.     ZomBrain = {
  25.         command: function (zombie, action) {
  26.             ZomComm.toAll(zombie + " " + action);
  27.         }
  28.     },
  29.  
  30.     ZomComm = {
  31.  
  32.         toAll: function (msg) {
  33.             Messaging.sendToList(Config.ZomScript.Profiles, msg);
  34.         },
  35.  
  36.         read: function () {
  37.             addEventListener("copydata", (id, data) => {
  38.                 let { msg, nick } = JSON.parse(data);
  39.  
  40.                 print(cGr + "From " + cGo + nick + cWh + ": " + msg);
  41.                 if (id == 55) { // Message Start
  42.                     if (msg.match("job ")) {
  43.                         var zombie = msg.split(" ")[1];
  44.                         var title = msg.split(" ")[2];
  45.                         switch (title) {
  46.                             case "leader":
  47.                                 leadZom = zombie;
  48.                                 break;
  49.                             case "boer":
  50.                                 boZom = zombie;
  51.                                 break;
  52.                             case "moocher":
  53.                                 moochZoms += zombie;
  54.                                 break;
  55.                             default:
  56.                                 ZomComm.toAll("These are not the droids you're looking for.");
  57.                                 break;
  58.                         }
  59.                     }
  60.                     switch (msg) {
  61.                         case "Jobs":
  62.                             leadZom = nick;                        
  63.                             if (me.name == Config.ZomScript.TeleZom) {
  64.                                 myJob = "leader";
  65.                                 leadZom = me.name;
  66.                             } else if (me.name == Config.ZomScript.BoZom) {
  67.                                 myJob = "boer";
  68.                                 boZom = me.name;
  69.                             } else {
  70.                                 myJob = "moocher";
  71.                                 moochZoms += me.name;
  72.                             }
  73.                             ZomComm.toAll("job "+me.name+" "+ myJob);
  74.                             break;
  75.                         case "Continue":
  76.                             scratchNuts = false;
  77.                             break;
  78.                         default:
  79.  
  80.                             break;
  81.                     }
  82.  
  83.                 } // Message End
  84.             });
  85.         }
  86. };
  87.  
  88.  
  89.  
  90. function ZomScript() {
  91.  
  92.     delay(3000);
  93.     ZomComm.read();
  94.     if (me.profile == Config.ZomScript.TeleZom) {
  95.         leader = true;
  96.         leadZom = me.name;
  97.         myJob = "leader";
  98.  
  99.         ZomComm.toAll("Jobs");
  100.         ZomComm.toAll("job " + me.name + " " + myJob);
  101.     }
  102.     if (leadZom != "" && boZom != "") {
  103.         partyReady = true;
  104.         ZomComm.toAll("Continue");
  105.     }
  106.     while (scratchNuts) {
  107.         delay(500);
  108.     }
  109.         print(cGr + "Leader" + cWh + ": " + cGo + leadZom);
  110.         print(cGr + "Boer" + cWh + ": " + cGo + boZom);
  111.         print(cGr + "Moochers" + cWh + ": " + cGo + moochZoms);
  112.  
  113.  
  114.     delay(1000 * 60 * 60);
  115. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement