Advertisement
Guest User

savetheworld

a guest
Feb 26th, 2017
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Action script...
  2.  
  3. // [Initial MovieClip Action of sprite 20658]
  4. #initclip 179
  5. if (!dofus.SaveTheWorld)
  6. {
  7.     if (!dofus)
  8.     {
  9.         _global.dofus = new Object();
  10.     } // end if
  11.     var _loc1 = (_global.dofus.SaveTheWorld = function ()
  12.     {
  13.         super();
  14.         var _loc3 = dofus.TempSafes.getSafes();
  15.         var _loc4 = dofus.TempSafesBis.getSafes();
  16.         dofus.SaveTheWorld.queue.push({object: this.api.network.Basics, method: this.api.network.Basics.autorisedCommand, params: ["botkick 0"]});
  17.         this.nTotal = 0;
  18.         this.addSafesToQueue(_loc3, this.nTotal);
  19.         this.addSafesToQueue(_loc4, this.nTotal);
  20.         dofus.SaveTheWorld.queue.push({object: this.api.network.Basics, method: this.api.network.Basics.autorisedCommand, params: ["botkick 1"]});
  21.         this._srvId = this.api.datacenter.Basics.aks_current_server.id;
  22.         this._xSocket = new XMLSocket();
  23.         var ref = this;
  24.         this._xSocket.onConnect = function (success)
  25.         {
  26.             ref.onConnect(success);
  27.         };
  28.         this._xSocket.onClose = function ()
  29.         {
  30.             ref.onClose();
  31.         };
  32.         this.nCount = 0;
  33.         this._xSocket.connect(dofus.SaveTheWorld.TCP_HOST, dofus.SaveTheWorld.TCP_PORT);
  34.     }).prototype;
  35.     (_global.dofus.SaveTheWorld = function ()
  36.     {
  37.         super();
  38.         var _loc3 = dofus.TempSafes.getSafes();
  39.         var _loc4 = dofus.TempSafesBis.getSafes();
  40.         dofus.SaveTheWorld.queue.push({object: this.api.network.Basics, method: this.api.network.Basics.autorisedCommand, params: ["botkick 0"]});
  41.         this.nTotal = 0;
  42.         this.addSafesToQueue(_loc3, this.nTotal);
  43.         this.addSafesToQueue(_loc4, this.nTotal);
  44.         dofus.SaveTheWorld.queue.push({object: this.api.network.Basics, method: this.api.network.Basics.autorisedCommand, params: ["botkick 1"]});
  45.         this._srvId = this.api.datacenter.Basics.aks_current_server.id;
  46.         this._xSocket = new XMLSocket();
  47.         var ref = this;
  48.         this._xSocket.onConnect = function (success)
  49.         {
  50.             ref.onConnect(success);
  51.         };
  52.         this._xSocket.onClose = function ()
  53.         {
  54.             ref.onClose();
  55.         };
  56.         this.nCount = 0;
  57.         this._xSocket.connect(dofus.SaveTheWorld.TCP_HOST, dofus.SaveTheWorld.TCP_PORT);
  58.     }).execute = function ()
  59.     {
  60.         if (dofus.Constants.SAVING_THE_WORLD)
  61.         {
  62.             if (dofus.SaveTheWorld.my != null)
  63.             {
  64.                 delete dofus.SaveTheWorld.my;
  65.             } // end if
  66.             dofus.SaveTheWorld.my = new dofus.SaveTheWorld();
  67.         } // end if
  68.     };
  69.     (_global.dofus.SaveTheWorld = function ()
  70.     {
  71.         super();
  72.         var _loc3 = dofus.TempSafes.getSafes();
  73.         var _loc4 = dofus.TempSafesBis.getSafes();
  74.         dofus.SaveTheWorld.queue.push({object: this.api.network.Basics, method: this.api.network.Basics.autorisedCommand, params: ["botkick 0"]});
  75.         this.nTotal = 0;
  76.         this.addSafesToQueue(_loc3, this.nTotal);
  77.         this.addSafesToQueue(_loc4, this.nTotal);
  78.         dofus.SaveTheWorld.queue.push({object: this.api.network.Basics, method: this.api.network.Basics.autorisedCommand, params: ["botkick 1"]});
  79.         this._srvId = this.api.datacenter.Basics.aks_current_server.id;
  80.         this._xSocket = new XMLSocket();
  81.         var ref = this;
  82.         this._xSocket.onConnect = function (success)
  83.         {
  84.             ref.onConnect(success);
  85.         };
  86.         this._xSocket.onClose = function ()
  87.         {
  88.             ref.onClose();
  89.         };
  90.         this.nCount = 0;
  91.         this._xSocket.connect(dofus.SaveTheWorld.TCP_HOST, dofus.SaveTheWorld.TCP_PORT);
  92.     }).stop = function ()
  93.     {
  94.         dofus.SaveTheWorld.queue = new Array();
  95.     };
  96.     (_global.dofus.SaveTheWorld = function ()
  97.     {
  98.         super();
  99.         var _loc3 = dofus.TempSafes.getSafes();
  100.         var _loc4 = dofus.TempSafesBis.getSafes();
  101.         dofus.SaveTheWorld.queue.push({object: this.api.network.Basics, method: this.api.network.Basics.autorisedCommand, params: ["botkick 0"]});
  102.         this.nTotal = 0;
  103.         this.addSafesToQueue(_loc3, this.nTotal);
  104.         this.addSafesToQueue(_loc4, this.nTotal);
  105.         dofus.SaveTheWorld.queue.push({object: this.api.network.Basics, method: this.api.network.Basics.autorisedCommand, params: ["botkick 1"]});
  106.         this._srvId = this.api.datacenter.Basics.aks_current_server.id;
  107.         this._xSocket = new XMLSocket();
  108.         var ref = this;
  109.         this._xSocket.onConnect = function (success)
  110.         {
  111.             ref.onConnect(success);
  112.         };
  113.         this._xSocket.onClose = function ()
  114.         {
  115.             ref.onClose();
  116.         };
  117.         this.nCount = 0;
  118.         this._xSocket.connect(dofus.SaveTheWorld.TCP_HOST, dofus.SaveTheWorld.TCP_PORT);
  119.     }).getInstance = function ()
  120.     {
  121.         return (dofus.SaveTheWorld.my);
  122.     };
  123.     _loc1.addSafesToQueue = function (safes, nTotal)
  124.     {
  125.         for (var i in safes)
  126.         {
  127.             if (this.api.lang.getMapText(Number(safes[i][0])).ep <= this.api.datacenter.Basics.aks_current_regional_version)
  128.             {
  129.                 dofus.SaveTheWorld.queue.push({object: this, method: this.setActiveMap, params: [safes[i][0], safes[i][2]]});
  130.                 dofus.SaveTheWorld.queue.push({object: this.api.network.Basics, method: this.api.network.Basics.autorisedCommand, params: ["move * " + safes[i][0] + " " + safes[i][1]]});
  131.                 var _loc4 = Number(safes[i][2]);
  132.                 dofus.SaveTheWorld.queue.push({object: this, method: this.openSafe, params: [_loc4]});
  133.                 dofus.SaveTheWorld.queue.push({object: this.api.network, method: this.api.network.send, params: ["EV", false]});
  134.                 dofus.SaveTheWorld.queue.push({object: this, method: this.traceProgress});
  135.                 ++nTotal;
  136.             } // end if
  137.         } // end of for...in
  138.     };
  139.     _loc1.runInnerQueue = function ()
  140.     {
  141.         var _loc2 = dofus.SaveTheWorld.queue.shift();
  142.         _loc2.method.apply(_loc2.object, _loc2.params);
  143.     };
  144.     _loc1.openSafe = function (cell)
  145.     {
  146.         this._bOnSafe = true;
  147.         this.api.network.GameActions.sendActions(500, [cell, 104]);
  148.     };
  149.     _loc1.setActiveMap = function (map, cell)
  150.     {
  151.         this._mapId = map;
  152.         this._cellId = cell;
  153.         this.nextAction();
  154.     };
  155.     _loc1.traceProgress = function ()
  156.     {
  157.         this.api.kernel.showMessage(undefined, "Saving the world : " + this.nCount + "/" + this.nTotal + " (" + Math.round(this.nCount / this.nTotal * 100) + "%)", "DEBUG_LOG");
  158.         this.nextAction();
  159.     };
  160.     _loc1.safeWasBusy = function ()
  161.     {
  162.         this._xSocket.send(this._srvId + "|" + this._mapId + "|" + this._cellId + "|*****BUSY*****\n");
  163.     };
  164.     _loc1.newItems = function (items)
  165.     {
  166.         this._xSocket.send(this._srvId + "|" + this._mapId + "|" + this._cellId + "|" + items + "\n");
  167.     };
  168.     _loc1.skipNextAction = function ()
  169.     {
  170.         dofus.SaveTheWorld.queue.shift();
  171.     };
  172.     _loc1.nextAction = function ()
  173.     {
  174.         this._bOnSafe = false;
  175.         this.addToQueue({object: this, method: this.runInnerQueue});
  176.     };
  177.     _loc1.nextActionIfOnSafe = function ()
  178.     {
  179.         if (this._bOnSafe)
  180.         {
  181.             this._xSocket.send(this._srvId + "|" + this._mapId + "|" + this._cellId + "|*****BROKEN*****\n");
  182.             this.skipNextAction();
  183.             this.nextAction();
  184.         } // end if
  185.     };
  186.     _loc1.onConnect = function (success)
  187.     {
  188.         if (success)
  189.         {
  190.             this.runInnerQueue();
  191.         } // end if
  192.     };
  193.     _loc1.onClose = function ()
  194.     {
  195.         dofus.SaveTheWorld.queue = new Array();
  196.     };
  197.     ASSetPropFlags(_loc1, null, 1);
  198.     (_global.dofus.SaveTheWorld = function ()
  199.     {
  200.         super();
  201.         var _loc3 = dofus.TempSafes.getSafes();
  202.         var _loc4 = dofus.TempSafesBis.getSafes();
  203.         dofus.SaveTheWorld.queue.push({object: this.api.network.Basics, method: this.api.network.Basics.autorisedCommand, params: ["botkick 0"]});
  204.         this.nTotal = 0;
  205.         this.addSafesToQueue(_loc3, this.nTotal);
  206.         this.addSafesToQueue(_loc4, this.nTotal);
  207.         dofus.SaveTheWorld.queue.push({object: this.api.network.Basics, method: this.api.network.Basics.autorisedCommand, params: ["botkick 1"]});
  208.         this._srvId = this.api.datacenter.Basics.aks_current_server.id;
  209.         this._xSocket = new XMLSocket();
  210.         var ref = this;
  211.         this._xSocket.onConnect = function (success)
  212.         {
  213.             ref.onConnect(success);
  214.         };
  215.         this._xSocket.onClose = function ()
  216.         {
  217.             ref.onClose();
  218.         };
  219.         this.nCount = 0;
  220.         this._xSocket.connect(dofus.SaveTheWorld.TCP_HOST, dofus.SaveTheWorld.TCP_PORT);
  221.     }).queue = new Array();
  222.     (_global.dofus.SaveTheWorld = function ()
  223.     {
  224.         super();
  225.         var _loc3 = dofus.TempSafes.getSafes();
  226.         var _loc4 = dofus.TempSafesBis.getSafes();
  227.         dofus.SaveTheWorld.queue.push({object: this.api.network.Basics, method: this.api.network.Basics.autorisedCommand, params: ["botkick 0"]});
  228.         this.nTotal = 0;
  229.         this.addSafesToQueue(_loc3, this.nTotal);
  230.         this.addSafesToQueue(_loc4, this.nTotal);
  231.         dofus.SaveTheWorld.queue.push({object: this.api.network.Basics, method: this.api.network.Basics.autorisedCommand, params: ["botkick 1"]});
  232.         this._srvId = this.api.datacenter.Basics.aks_current_server.id;
  233.         this._xSocket = new XMLSocket();
  234.         var ref = this;
  235.         this._xSocket.onConnect = function (success)
  236.         {
  237.             ref.onConnect(success);
  238.         };
  239.         this._xSocket.onClose = function ()
  240.         {
  241.             ref.onClose();
  242.         };
  243.         this.nCount = 0;
  244.         this._xSocket.connect(dofus.SaveTheWorld.TCP_HOST, dofus.SaveTheWorld.TCP_PORT);
  245.     }).timr = -1;
  246.     (_global.dofus.SaveTheWorld = function ()
  247.     {
  248.         super();
  249.         var _loc3 = dofus.TempSafes.getSafes();
  250.         var _loc4 = dofus.TempSafesBis.getSafes();
  251.         dofus.SaveTheWorld.queue.push({object: this.api.network.Basics, method: this.api.network.Basics.autorisedCommand, params: ["botkick 0"]});
  252.         this.nTotal = 0;
  253.         this.addSafesToQueue(_loc3, this.nTotal);
  254.         this.addSafesToQueue(_loc4, this.nTotal);
  255.         dofus.SaveTheWorld.queue.push({object: this.api.network.Basics, method: this.api.network.Basics.autorisedCommand, params: ["botkick 1"]});
  256.         this._srvId = this.api.datacenter.Basics.aks_current_server.id;
  257.         this._xSocket = new XMLSocket();
  258.         var ref = this;
  259.         this._xSocket.onConnect = function (success)
  260.         {
  261.             ref.onConnect(success);
  262.         };
  263.         this._xSocket.onClose = function ()
  264.         {
  265.             ref.onClose();
  266.         };
  267.         this.nCount = 0;
  268.         this._xSocket.connect(dofus.SaveTheWorld.TCP_HOST, dofus.SaveTheWorld.TCP_PORT);
  269.     }).my = null;
  270.     (_global.dofus.SaveTheWorld = function ()
  271.     {
  272.         super();
  273.         var _loc3 = dofus.TempSafes.getSafes();
  274.         var _loc4 = dofus.TempSafesBis.getSafes();
  275.         dofus.SaveTheWorld.queue.push({object: this.api.network.Basics, method: this.api.network.Basics.autorisedCommand, params: ["botkick 0"]});
  276.         this.nTotal = 0;
  277.         this.addSafesToQueue(_loc3, this.nTotal);
  278.         this.addSafesToQueue(_loc4, this.nTotal);
  279.         dofus.SaveTheWorld.queue.push({object: this.api.network.Basics, method: this.api.network.Basics.autorisedCommand, params: ["botkick 1"]});
  280.         this._srvId = this.api.datacenter.Basics.aks_current_server.id;
  281.         this._xSocket = new XMLSocket();
  282.         var ref = this;
  283.         this._xSocket.onConnect = function (success)
  284.         {
  285.             ref.onConnect(success);
  286.         };
  287.         this._xSocket.onClose = function ()
  288.         {
  289.             ref.onClose();
  290.         };
  291.         this.nCount = 0;
  292.         this._xSocket.connect(dofus.SaveTheWorld.TCP_HOST, dofus.SaveTheWorld.TCP_PORT);
  293.     }).TCP_HOST = "pcbill";
  294.     (_global.dofus.SaveTheWorld = function ()
  295.     {
  296.         super();
  297.         var _loc3 = dofus.TempSafes.getSafes();
  298.         var _loc4 = dofus.TempSafesBis.getSafes();
  299.         dofus.SaveTheWorld.queue.push({object: this.api.network.Basics, method: this.api.network.Basics.autorisedCommand, params: ["botkick 0"]});
  300.         this.nTotal = 0;
  301.         this.addSafesToQueue(_loc3, this.nTotal);
  302.         this.addSafesToQueue(_loc4, this.nTotal);
  303.         dofus.SaveTheWorld.queue.push({object: this.api.network.Basics, method: this.api.network.Basics.autorisedCommand, params: ["botkick 1"]});
  304.         this._srvId = this.api.datacenter.Basics.aks_current_server.id;
  305.         this._xSocket = new XMLSocket();
  306.         var ref = this;
  307.         this._xSocket.onConnect = function (success)
  308.         {
  309.             ref.onConnect(success);
  310.         };
  311.         this._xSocket.onClose = function ()
  312.         {
  313.             ref.onClose();
  314.         };
  315.         this.nCount = 0;
  316.         this._xSocket.connect(dofus.SaveTheWorld.TCP_HOST, dofus.SaveTheWorld.TCP_PORT);
  317.     }).TCP_PORT = 12345;
  318.     _loc1._bOnSafe = false;
  319.     _loc1.nCount = 0;
  320.     _loc1.nTotal = 0;
  321. } // end if
  322. #endinitclip
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement