Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Blank starter used for testin
- function ScriptMsgEvent(msg) {
- switch (msg) {
- case "mule":
- AutoMule.check = true;
- break;
- case "muleTorch":
- AutoMule.torchCheck = true;
- break;
- case "torch":
- TorchSystem.check = true;
- break;
- case "crafting":
- CraftingSystem.check = true;
- break;
- case "getMuleMode":
- if (AutoMule.torchCheck) {
- scriptBroadcast("1");
- } else if (AutoMule.check) {
- scriptBroadcast("0");
- }
- break;
- case "organsystem":
- if (!AutoMule.torchCheck) {
- OrganSystem.check = true;
- }
- break;
- case "pingquit":
- pingQuit = true;
- break;
- case "orgCheck":
- if (OrganSystem.check) {
- scriptBroadcast("1");
- } else {
- scriptBroadcast("0");
- }
- break;
- }
- }
- function main() {
- include("json2.js");
- include("OOG.js");
- include("organsystem.js");
- include("common/misc.js");
- addEventListener('scriptmsg', ScriptMsgEvent);
- var handle, c,
- isUp = "no";
- this.copyDataEvent = function (mode, msg) {
- var obj;
- switch (msg) {
- case "Handle":
- handle = mode;
- break;
- }
- switch (mode) {
- case 3: // request game
- obj = JSON.parse(msg);
- if (me.gameReady) {
- D2Bot.joinMe(obj.profile, me.gamename.toLowerCase(), "", me.gamepassword.toLowerCase(), isUp);
- }
- case 4:
- // Heartbeat ping
- if (msg === "pingreq") {
- sendCopyData(null, me.windowtitle, 4, "pingrep");
- }
- break;
- }
- };
- this.keyDownEvent = function (key) {
- if (key === 45) {
- c = true;
- }
- };
- this.test = function () {
- if (me.ingame) {
- return;
- }
- var n, text, i, j, c, x,
- search = "cancel";
- for (n = 1; n <= 12; n += 1) {
- for (i = 0; i < 801; i += 1) {
- for (j = 0; j < 601; j += 1) {
- c = getControl(n, i, j);
- if (c) {
- if (c.text && c.text.toLowerCase().match(search, "gi")) {
- print(c.type + " " + c.x + " " + c.y + " " + c.xsize + " " + c.ysize);
- }
- text = c.getText();
- if (text) {
- for (x in text) {
- try {
- if (text[x].toLowerCase().match(search, "gi")) {
- print(text);
- print(c.type + " " + c.x + " " + c.y + " " + c.xsize + " " + c.ysize);
- }
- } catch (e) {
- print("Error on: " + text[x]);
- }
- }
- }
- }
- }
- }
- }
- print("done");
- };
- addEventListener("keydown", this.keyDownEvent);
- addEventListener('copydata', this.copyDataEvent);
- var t = getTickCount();
- while (!handle) {
- delay(100);
- }
- DataFile.updateStats("handle", handle);
- delay(500);
- D2Bot.init();
- load("tools/heartbeat.js");
- if (!FileTools.exists("data/" + me.profile + ".json")) {
- DataFile.create();
- }
- if (me.profile === "Mule") {
- OrganSystem.waitForMaster();
- }
- print(getTickCount() - t);
- while (true) {
- if (c) {
- this.test();
- c = false;
- }
- if (me.ingame) {
- isUp = "yes";
- } else {
- isUp = "no";
- }
- /*if (me.ingame && me.gameReady && !getScript("default.dbj")) {
- print("QQ QQ");
- delay(2000);
- //sendClick(392, 500);
- confirm();
- delay(4000);
- }*/
- delay(1000);
- }
- }
- // 390, 500
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement