dzik

Diablo 2 - Kolbot - MultiSealDiablo.js by dzik

Sep 2nd, 2015
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //
  2. //  @filename   MultiSealDiablo.js
  3. //  @athor      dzik
  4. //  @version    2015.02.01.2130
  5. //
  6.  
  7. //
  8. // config nicks are CaSe SensitivE
  9.  
  10. //this char must be in quit list for every single worker...
  11. var NickKiller  =   "DeadBeat";
  12.  
  13. var NickShrine  =   ["GigaShock","sorc2","etc"];
  14.  
  15. var sealKiller1 =   ["Griffin","member of team 2"];     // Vizier killers
  16. var sealKiller2 =   ["Nagro","member of team 2"];       // de Seis killers
  17. var sealKiller3 =   ["Accept","member of team 2"];      // Infector killers
  18.  
  19. //communication
  20. var msgShrineY  =   "y";    //msg if shrine found
  21. var msgShrineN  =   "n";    //msg if shrine not found
  22. var Question    =   "f?";   //msg to ask about schrine
  23.  
  24. // varabies
  25. var diabloSpawn =   false;
  26. var hurtDia     =   30;
  27.  
  28. // CORE
  29. function MultiSealDiablo () {
  30.     if (sealKiller1.indexOf(me.name) >= 0)          prepDia1();
  31.     else if (sealKiller2.indexOf(me.name) >= 0) prepDia2();
  32.     else if (sealKiller3.indexOf(me.name) >= 0) prepDia3();
  33.     else if (NickShrine.indexOf(me.name) >= 0)  { prepShrine(); while(true) delay(1000); }
  34.     else if (me.name === NickKiller)                killemAll();
  35.     else                                            while (true) delay(1000);
  36. }
  37.  
  38. function prepDia1() {
  39.     this.getLayout = function (seal, value) {
  40.         var sealPreset = getPresetUnit(108, 2, seal);
  41.  
  42.         if (!seal) {
  43.             throw new Error("Seal preset not found");
  44.         }
  45.  
  46.         if (sealPreset.roomy * 5 + sealPreset.y === value || sealPreset.roomx * 5 + sealPreset.x === value) {
  47.             return 1;
  48.         }
  49.  
  50.         return 2;
  51.     };
  52.  
  53.     this.initLayout = function () {
  54.         this.vizLayout = this.getLayout(396, 5275);
  55.         this.seisLayout = this.getLayout(394, 7773);
  56.         this.infLayout = this.getLayout(392, 7893);
  57.     };
  58.  
  59.     this.getBoss = function (name) {
  60.         var i, boss,
  61.             glow = getUnit(2, 131);
  62.  
  63.         for (i = 0; i < 24; i += 1) {
  64.             boss = getUnit(1, name);
  65.  
  66.             if (boss) {
  67.                 this.chaosPreattack(name, 8);
  68.  
  69.                 try {
  70.                     Attack.kill(name);
  71.                 } catch (e) {
  72.                     Attack.clear(10, 0, name);
  73.                 }
  74.  
  75.                 Pickit.pickItems();
  76.  
  77.                 return true;
  78.             }
  79.  
  80.             delay(250);
  81.         }
  82.  
  83.         return !!glow;
  84.     };
  85.  
  86.     this.chaosPreattack = function (name, amount) {
  87.         var i, n, target, positions;
  88.  
  89.         switch (me.classid) {
  90.         case 0:
  91.             break;
  92.         case 1:
  93.             break;
  94.         case 2:
  95.             break;
  96.         case 3:
  97.             target = getUnit(1, name);
  98.  
  99.             if (!target) {
  100.                 return;
  101.             }
  102.  
  103.             positions = [[6, 11], [0, 8], [8, -1], [-9, 2], [0, -11], [8, -8]];
  104.  
  105.             for (i = 0; i < positions.length; i += 1) {
  106.                 if (Attack.validSpot(target.x + positions[i][0], target.y + positions[i][1])) { // check if we can move there
  107.                     Pather.moveTo(target.x + positions[i][0], target.y + positions[i][1]);
  108.                     Skill.setSkill(Config.AttackSkill[2], 0);
  109.  
  110.                     for (n = 0; n < amount; n += 1) {
  111.                         Skill.cast(Config.AttackSkill[1], 1);
  112.                     }
  113.  
  114.                     break;
  115.                 }
  116.             }
  117.  
  118.             break;
  119.         case 4:
  120.             break;
  121.         case 5:
  122.             break;
  123.         case 6:
  124.             break;
  125.         }
  126.     };
  127.  
  128.     this.diabloPrep = function () {
  129.         var trapCheck,
  130.             tick = getTickCount();
  131.  
  132.         while (getTickCount() - tick < 50000) {
  133.             if (getTickCount() - tick >= 8000) {
  134.                 switch (me.classid) {
  135.                 case 1: // Sorceress
  136.                     if ([56, 59, 64].indexOf(Config.AttackSkill[1]) > -1) {
  137.                         if (me.getState(121)) {
  138.                             delay(500);
  139.                         } else {
  140.                             Skill.cast(Config.AttackSkill[1], 0, 7793, 5293);
  141.                         }
  142.  
  143.                         break;
  144.                     }
  145.  
  146.                     delay(500);
  147.  
  148.                     break;
  149.                 case 3: // Paladin
  150.                     Skill.setSkill(Config.AttackSkill[2]);
  151.                     Skill.cast(Config.AttackSkill[1], 1);
  152.  
  153.                     break;
  154.                 case 5: // Druid
  155.                     if (Config.AttackSkill[1] === 245) {
  156.                         Skill.cast(Config.AttackSkill[1], 0, 7793, 5293);
  157.  
  158.                         break;
  159.                     }
  160.  
  161.                     delay(500);
  162.  
  163.                     break;
  164.                 case 6: // Assassin
  165.                     if (Config.UseTraps) {
  166.                         trapCheck = ClassAttack.checkTraps({x: 7793, y: 5293});
  167.  
  168.                         if (trapCheck) {
  169.                             ClassAttack.placeTraps({x: 7793, y: 5293, classid: 243}, trapCheck);
  170.  
  171.                             break;
  172.                         }
  173.                     }
  174.  
  175.                     delay(500);
  176.  
  177.                     break;
  178.                 default:
  179.                     delay(500);
  180.                 }
  181.             } else {
  182.                 delay(500);
  183.             }
  184.  
  185.             if (getUnit(1, 243)) {
  186.                 return true;
  187.             }
  188.         }
  189.  
  190.         throw new Error("Diablo not found");
  191.     };
  192.  
  193.     this.openSeal = function (classid) {
  194.         var i, j, seal;
  195.  
  196.         for (i = 0; i < 5; i += 1) {
  197.             Pather.moveToPreset(108, 2, classid, classid === 394 ? 5 : 2, classid === 394 ? 5 : 0);
  198.  
  199.             if (i > 1) {
  200.                 Attack.clear(10);
  201.             }
  202.  
  203.             for (j = 0; j < 3; j += 1) {
  204.                 seal = getUnit(2, classid);
  205.  
  206.                 if (seal) {
  207.                     break;
  208.                 }
  209.  
  210.                 delay(100);
  211.             }
  212.  
  213.             if (!seal) {
  214.                 throw new Error("Seal not found (id " + classid + ")");
  215.             }
  216.  
  217.             if (seal.mode) {
  218.                 return true;
  219.             }
  220.  
  221.             sendPacket(1, 0x13, 4, 0x2, 4, seal.gid);
  222.             delay(classid === 394 ? 1000 : 500);
  223.  
  224.             if (!seal.mode) {
  225.                 if (classid === 394 && Attack.validSpot(seal.x + 15, seal.y)) { // de seis optimization
  226.                     Pather.moveTo(seal.x + 15, seal.y);
  227.                 } else {
  228.                     Pather.moveTo(seal.x - 5, seal.y - 5);
  229.                 }
  230.  
  231.                 delay(500);
  232.             } else {
  233.                 return true;
  234.             }
  235.         }
  236.  
  237.         throw new Error("Failed to open seal (id " + classid + ")");
  238.     };
  239.  
  240.     Town.doChores();
  241.     Town.goToTown(4);
  242.    
  243.     if(me.getStat(14) > 100000)
  244.         gold(15000);
  245.    
  246.     Pather.useWaypoint(107);
  247.     Precast.doPrecast(true);
  248.     this.initLayout();
  249.     this.openSeal(395);
  250.     this.openSeal(396);
  251.  
  252.     if (this.vizLayout === 1) {
  253.         Pather.moveTo(7691, 5292);
  254.     } else {
  255.         Pather.moveTo(7695, 5316);
  256.     }
  257.    
  258.     if (!this.getBoss(getLocaleString(2851))) {
  259.         throw new Error("Failed to kill Vizier");
  260.     }
  261.  
  262.     //here
  263.     Pather.moveTo(7788, 5292);
  264.    
  265.     this.diabloPrep();
  266.    
  267.     Attack.hurt(243, hurtDia); // Diablo
  268.     Town.goToTown();
  269.    
  270.     //only one hammer send command to avoid 3 same entys..okay so only 1 hdin sends it automatically right? yes imo i think its done, ight bro i will run it here shortly. I will let you know :)
  271.     FileTools.appendText("games.txt", me.gamename + "|" + me.gamepassword + "\n");
  272.    
  273.     while (true) delay(1000);
  274.     return true;
  275. }
  276.  
  277. function prepDia2() {
  278.     this.getLayout = function (seal, value) {
  279.         var sealPreset = getPresetUnit(108, 2, seal);
  280.  
  281.         if (!seal) {
  282.             throw new Error("Seal preset not found");
  283.         }
  284.  
  285.         if (sealPreset.roomy * 5 + sealPreset.y === value || sealPreset.roomx * 5 + sealPreset.x === value) {
  286.             return 1;
  287.         }
  288.  
  289.         return 2;
  290.     };
  291.  
  292.     this.initLayout = function () {
  293.         this.vizLayout = this.getLayout(396, 5275);
  294.         this.seisLayout = this.getLayout(394, 7773);
  295.         this.infLayout = this.getLayout(392, 7893);
  296.     };
  297.  
  298.     this.getBoss = function (name) {
  299.         var i, boss,
  300.             glow = getUnit(2, 131);
  301.  
  302.         for (i = 0; i < 24; i += 1) {
  303.             boss = getUnit(1, name);
  304.  
  305.             if (boss) {
  306.                 this.chaosPreattack(name, 8);
  307.  
  308.                 try {
  309.                     Attack.kill(name);
  310.                 } catch (e) {
  311.                     Attack.clear(10, 0, name);
  312.                 }
  313.  
  314.                 Pickit.pickItems();
  315.  
  316.                 return true;
  317.             }
  318.  
  319.             delay(250);
  320.         }
  321.  
  322.         return !!glow;
  323.     };
  324.  
  325.     this.chaosPreattack = function (name, amount) {
  326.         var i, n, target, positions;
  327.  
  328.         switch (me.classid) {
  329.         case 0:
  330.             break;
  331.         case 1:
  332.             break;
  333.         case 2:
  334.             break;
  335.         case 3:
  336.             target = getUnit(1, name);
  337.  
  338.             if (!target) {
  339.                 return;
  340.             }
  341.  
  342.             positions = [[6, 11], [0, 8], [8, -1], [-9, 2], [0, -11], [8, -8]];
  343.  
  344.             for (i = 0; i < positions.length; i += 1) {
  345.                 if (Attack.validSpot(target.x + positions[i][0], target.y + positions[i][1])) { // check if we can move there
  346.                     Pather.moveTo(target.x + positions[i][0], target.y + positions[i][1]);
  347.                     Skill.setSkill(Config.AttackSkill[2], 0);
  348.  
  349.                     for (n = 0; n < amount; n += 1) {
  350.                         Skill.cast(Config.AttackSkill[1], 1);
  351.                     }
  352.  
  353.                     break;
  354.                 }
  355.             }
  356.  
  357.             break;
  358.         case 4:
  359.             break;
  360.         case 5:
  361.             break;
  362.         case 6:
  363.             break;
  364.         }
  365.     };
  366.  
  367.     this.diabloPrep = function () {
  368.         var trapCheck,
  369.             tick = getTickCount();
  370.  
  371.         while (getTickCount() - tick < 50000) {
  372.             if (getTickCount() - tick >= 8000) {
  373.                 switch (me.classid) {
  374.                 case 1: // Sorceress
  375.                     if ([56, 59, 64].indexOf(Config.AttackSkill[1]) > -1) {
  376.                         if (me.getState(121)) {
  377.                             delay(500);
  378.                         } else {
  379.                             Skill.cast(Config.AttackSkill[1], 0, 7793, 5293);
  380.                         }
  381.  
  382.                         break;
  383.                     }
  384.  
  385.                     delay(500);
  386.  
  387.                     break;
  388.                 case 3: // Paladin
  389.                     Skill.setSkill(Config.AttackSkill[2]);
  390.                     Skill.cast(Config.AttackSkill[1], 1);
  391.  
  392.                     break;
  393.                 case 5: // Druid
  394.                     if (Config.AttackSkill[1] === 245) {
  395.                         Skill.cast(Config.AttackSkill[1], 0, 7793, 5293);
  396.  
  397.                         break;
  398.                     }
  399.  
  400.                     delay(500);
  401.  
  402.                     break;
  403.                 case 6: // Assassin
  404.                     if (Config.UseTraps) {
  405.                         trapCheck = ClassAttack.checkTraps({x: 7793, y: 5293});
  406.  
  407.                         if (trapCheck) {
  408.                             ClassAttack.placeTraps({x: 7793, y: 5293, classid: 243}, trapCheck);
  409.  
  410.                             break;
  411.                         }
  412.                     }
  413.  
  414.                     delay(500);
  415.  
  416.                     break;
  417.                 default:
  418.                     delay(500);
  419.                 }
  420.             } else {
  421.                 delay(500);
  422.             }
  423.  
  424.             if (getUnit(1, 243)) {
  425.                 return true;
  426.             }
  427.         }
  428.  
  429.         throw new Error("Diablo not found");
  430.     };
  431.  
  432.     this.openSeal = function (classid) {
  433.         var i, j, seal;
  434.  
  435.         for (i = 0; i < 5; i += 1) {
  436.             Pather.moveToPreset(108, 2, classid, classid === 394 ? 5 : 2, classid === 394 ? 5 : 0);
  437.  
  438.             if (i > 1) {
  439.                 Attack.clear(10);
  440.             }
  441.  
  442.             for (j = 0; j < 3; j += 1) {
  443.                 seal = getUnit(2, classid);
  444.  
  445.                 if (seal) {
  446.                     break;
  447.                 }
  448.  
  449.                 delay(100);
  450.             }
  451.  
  452.             if (!seal) {
  453.                 throw new Error("Seal not found (id " + classid + ")");
  454.             }
  455.  
  456.             if (seal.mode) {
  457.                 return true;
  458.             }
  459.  
  460.             sendPacket(1, 0x13, 4, 0x2, 4, seal.gid);
  461.             delay(classid === 394 ? 1000 : 500);
  462.  
  463.             if (!seal.mode) {
  464.                 if (classid === 394 && Attack.validSpot(seal.x + 15, seal.y)) { // de seis optimization
  465.                     Pather.moveTo(seal.x + 15, seal.y);
  466.                 } else {
  467.                     Pather.moveTo(seal.x - 5, seal.y - 5);
  468.                 }
  469.  
  470.                 delay(500);
  471.             } else {
  472.                 return true;
  473.             }
  474.         }
  475.  
  476.         throw new Error("Failed to open seal (id " + classid + ")");
  477.     };
  478.    
  479.     Town.doChores();
  480.     Town.goToTown(4);
  481.    
  482.     if(me.getStat(14) > 100000)
  483.         gold(15000);
  484.        
  485.     Pather.useWaypoint(107);
  486.     Precast.doPrecast(true);
  487.     this.initLayout();
  488.  
  489.     this.openSeal(394);
  490.  
  491.     if (this.seisLayout === 1) {
  492.         Pather.moveTo(7771, 5196);
  493.     } else {
  494.         Pather.moveTo(7798, 5186);
  495.     }
  496.  
  497.     if (!this.getBoss(getLocaleString(2852))) {
  498.         throw new Error("Failed to kill de Seis");
  499.     }
  500.    
  501.     //here
  502.     Pather.moveTo(7788, 5292);
  503.    
  504.     this.diabloPrep();
  505.    
  506.     Attack.hurt(243, hurtDia); // Diablo
  507.     Town.goToTown();
  508.     while (true) delay(1000);
  509.     return true;
  510. }
  511.  
  512. function prepDia3() {
  513.     this.getLayout = function (seal, value) {
  514.         var sealPreset = getPresetUnit(108, 2, seal);
  515.  
  516.         if (!seal) {
  517.             throw new Error("Seal preset not found");
  518.         }
  519.  
  520.         if (sealPreset.roomy * 5 + sealPreset.y === value || sealPreset.roomx * 5 + sealPreset.x === value) {
  521.             return 1;
  522.         }
  523.  
  524.         return 2;
  525.     };
  526.  
  527.     this.initLayout = function () {
  528.         this.vizLayout = this.getLayout(396, 5275);
  529.         this.seisLayout = this.getLayout(394, 7773);
  530.         this.infLayout = this.getLayout(392, 7893);
  531.     };
  532.  
  533.     this.getBoss = function (name) {
  534.         var i, boss,
  535.             glow = getUnit(2, 131);
  536.  
  537.         for (i = 0; i < 24; i += 1) {
  538.             boss = getUnit(1, name);
  539.  
  540.             if (boss) {
  541.                 this.chaosPreattack(name, 8);
  542.  
  543.                 try {
  544.                     Attack.kill(name);
  545.                 } catch (e) {
  546.                     Attack.clear(10, 0, name);
  547.                 }
  548.  
  549.                 Pickit.pickItems();
  550.  
  551.                 return true;
  552.             }
  553.  
  554.             delay(250);
  555.         }
  556.  
  557.         return !!glow;
  558.     };
  559.  
  560.     this.chaosPreattack = function (name, amount) {
  561.         var i, n, target, positions;
  562.  
  563.         switch (me.classid) {
  564.         case 0:
  565.             break;
  566.         case 1:
  567.             break;
  568.         case 2:
  569.             break;
  570.         case 3:
  571.             target = getUnit(1, name);
  572.  
  573.             if (!target) {
  574.                 return;
  575.             }
  576.  
  577.             positions = [[6, 11], [0, 8], [8, -1], [-9, 2], [0, -11], [8, -8]];
  578.  
  579.             for (i = 0; i < positions.length; i += 1) {
  580.                 if (Attack.validSpot(target.x + positions[i][0], target.y + positions[i][1])) { // check if we can move there
  581.                     Pather.moveTo(target.x + positions[i][0], target.y + positions[i][1]);
  582.                     Skill.setSkill(Config.AttackSkill[2], 0);
  583.  
  584.                     for (n = 0; n < amount; n += 1) {
  585.                         Skill.cast(Config.AttackSkill[1], 1);
  586.                     }
  587.  
  588.                     break;
  589.                 }
  590.             }
  591.  
  592.             break;
  593.         case 4:
  594.             break;
  595.         case 5:
  596.             break;
  597.         case 6:
  598.             break;
  599.         }
  600.     };
  601.  
  602.     this.diabloPrep = function () {
  603.         var trapCheck,
  604.             tick = getTickCount();
  605.  
  606.         while (getTickCount() - tick < 50000) {
  607.             if (getTickCount() - tick >= 8000) {
  608.                 switch (me.classid) {
  609.                 case 1: // Sorceress
  610.                     if ([56, 59, 64].indexOf(Config.AttackSkill[1]) > -1) {
  611.                         if (me.getState(121)) {
  612.                             delay(500);
  613.                         } else {
  614.                             Skill.cast(Config.AttackSkill[1], 0, 7793, 5293);
  615.                         }
  616.  
  617.                         break;
  618.                     }
  619.  
  620.                     delay(500);
  621.  
  622.                     break;
  623.                 case 3: // Paladin
  624.                     Skill.setSkill(Config.AttackSkill[2]);
  625.                     Skill.cast(Config.AttackSkill[1], 1);
  626.  
  627.                     break;
  628.                 case 5: // Druid
  629.                     if (Config.AttackSkill[1] === 245) {
  630.                         Skill.cast(Config.AttackSkill[1], 0, 7793, 5293);
  631.  
  632.                         break;
  633.                     }
  634.  
  635.                     delay(500);
  636.  
  637.                     break;
  638.                 case 6: // Assassin
  639.                     if (Config.UseTraps) {
  640.                         trapCheck = ClassAttack.checkTraps({x: 7793, y: 5293});
  641.  
  642.                         if (trapCheck) {
  643.                             ClassAttack.placeTraps({x: 7793, y: 5293, classid: 243}, trapCheck);
  644.  
  645.                             break;
  646.                         }
  647.                     }
  648.  
  649.                     delay(500);
  650.  
  651.                     break;
  652.                 default:
  653.                     delay(500);
  654.                 }
  655.             } else {
  656.                 delay(500);
  657.             }
  658.  
  659.             if (getUnit(1, 243)) {
  660.                 return true;
  661.             }
  662.         }
  663.  
  664.         throw new Error("Diablo not found");
  665.     };
  666.  
  667.     this.openSeal = function (classid) {
  668.         var i, j, seal;
  669.  
  670.         for (i = 0; i < 5; i += 1) {
  671.             Pather.moveToPreset(108, 2, classid, classid === 394 ? 5 : 2, classid === 394 ? 5 : 0);
  672.  
  673.             if (i > 1) {
  674.                 Attack.clear(10);
  675.             }
  676.  
  677.             for (j = 0; j < 3; j += 1) {
  678.                 seal = getUnit(2, classid);
  679.  
  680.                 if (seal) {
  681.                     break;
  682.                 }
  683.  
  684.                 delay(100);
  685.             }
  686.  
  687.             if (!seal) {
  688.                 throw new Error("Seal not found (id " + classid + ")");
  689.             }
  690.  
  691.             if (seal.mode) {
  692.                 return true;
  693.             }
  694.  
  695.             sendPacket(1, 0x13, 4, 0x2, 4, seal.gid);
  696.             delay(classid === 394 ? 1000 : 500);
  697.  
  698.             if (!seal.mode) {
  699.                 if (classid === 394 && Attack.validSpot(seal.x + 15, seal.y)) { // de seis optimization
  700.                     Pather.moveTo(seal.x + 15, seal.y);
  701.                 } else {
  702.                     Pather.moveTo(seal.x - 5, seal.y - 5);
  703.                 }
  704.  
  705.                 delay(500);
  706.             } else {
  707.                 return true;
  708.             }
  709.         }
  710.  
  711.         throw new Error("Failed to open seal (id " + classid + ")");
  712.     };
  713.    
  714.     Town.doChores();
  715.     Town.goToTown(4);
  716.    
  717.     if(me.getStat(14) > 100000)
  718.         gold(15000);
  719.        
  720.     Pather.useWaypoint(107);
  721.     Precast.doPrecast(true);
  722.     this.initLayout();
  723.  
  724.     this.openSeal(392);
  725.     this.openSeal(393);
  726.    
  727.     if (this.infLayout === 1) {
  728.         delay(1);
  729.     } else {
  730.         Pather.moveTo(7928, 5295); // temp
  731.     }
  732.    
  733.     if (!this.getBoss(getLocaleString(2853))) {
  734.         throw new Error("Failed to kill Infector");
  735.     }
  736.  
  737.     //here
  738.     Pather.moveTo(7788, 5292);
  739.    
  740.     this.diabloPrep();
  741.    
  742.     Attack.hurt(243, hurtDia); // Diablo
  743.     Town.goToTown();
  744.     while (true) delay(1000);
  745.     return true;
  746. }
  747.  
  748. function prepShrine() {
  749.     var noschrine = true, i;
  750.    
  751.     this.messenger = function(name, msg) {
  752.         //only one message needed
  753.         if (msg === Question) {
  754.             if(noschrine)
  755.                 say(msgShrineN);
  756.             else
  757.                 say(msgShrineY);
  758.         }      
  759.     };
  760.  
  761.     addEventListener("chatmsg", this.messenger);
  762.    
  763.     Town.doChores();
  764.     Town.goToTown(1);
  765.     Pather.useWaypoint(4);
  766.     for (i = 4; i > 1; i -= 1) {
  767.         if (Misc.getShrinesInArea(i, 15, false)) {
  768.             noschrine = false;
  769.             break;
  770.         }
  771.     }
  772.     if (i === 1) {
  773.         Town.goToTown();
  774.         Pather.useWaypoint(5);
  775.         for (i = 5; i < 8; i += 1) {
  776.             if (Misc.getShrinesInArea(i, 15, false)) {
  777.                 noschrine = false;
  778.                 break;
  779.             }
  780.         }
  781.     }
  782.    
  783.     Town.goToTown();
  784. }
  785.  
  786. function killemAll() {
  787.     var goForShrine = false;
  788.     var enterNick, go;
  789.    
  790.     this.messenger = function(name, msg) {
  791.         //only one message needed
  792.         if (msg === msgShrineY) {
  793.             goForShrine = true;
  794.             enterNick = name;
  795.         }  
  796.         go = true;
  797.     };
  798.  
  799.     addEventListener("chatmsg", this.messenger);
  800.    
  801.     Pickit.pickItems();     //good here will be add for killer only gold.nip in config file..kk
  802.  
  803.     Town.doChores();   
  804.    
  805.     say(Question);
  806.    
  807.     while (!go) delay(100);
  808.    
  809.     if (goForShrine) {
  810.         Town.move("waypoint");
  811.         Pather.useWaypoint(4, true);
  812.         Precast.doPrecast(true);
  813.         Town.goToTown();
  814.         Pather.usePortal(null, enterNick);
  815.         delay(me.ping*2 + 100);
  816.         Misc.getShrinesInArea(me.area, 15, true);
  817.         Pather.usePortal(null, enterNick);
  818.         Pather.usePortal(null, me.name);
  819.         Pather.useWaypoint(103, true);
  820.         Town.move("portalspot");   
  821.     }
  822.    
  823.     Town.goToTown(4);  
  824.        
  825.     while(!Pather.usePortal(108, null)) {           //if cannot use portal wait
  826.         Town.move("portalspot");
  827.         delay(100);
  828.     }
  829.    
  830.     try {
  831.         Attack.kill(243); // Diablo
  832.     }
  833.     catch (e) {
  834.         say(e);
  835.     }
  836.     finally {
  837.         quit();
  838.     }  
  839. }
Advertisement
Add Comment
Please, Sign In to add comment