Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var chrome = {
- load: function() {
- window.addEventListener("mousemove", function(e) {
- chrome.player.mouse.x = e.clientX;
- chrome.player.mouse.y = e.clientY;
- });
- window.addEventListener("keydown", chrome.player.capture_key_press);
- window.addEventListener("keyup", chrome.player.capture_key_press);
- for (var x = 1; x < 50; x++) {
- chrome.units.blank.push(x);
- }
- },
- player: {
- last_key: "",
- capture_key_press(a) {
- chrome.player.last_key = a.key;
- if (game.chat.info.input.info.state == 0 && game.is_run == true) {
- if (chrome.macro[a.key] != undefined) {
- if (a.type == "keydown" && chrome.macro[a.key].down == false) {
- chrome.macro[a.key].down = true;
- chrome.macro[a.key].trigger();
- }
- if (a.type == "keyup" && chrome.macro[a.key].down == true) {
- chrome.macro[a.key].down = false;
- }
- }
- }
- },
- mouse: {
- x: 0,
- y: 0
- },
- scan: function(id) {
- //Returns all queen and oib data through data object
- let GameOibs = lapa28426mauve.lapa28388mauve;
- let queen = new Object();
- let oibs = new Array();
- let k = 0;
- for (k = 0; k < GameOibs.length; k++) {
- if (GameOibs[k] != undefined) {
- if (GameOibs[k].id == id) {
- if (GameOibs[k].queen == true) {
- queen = GameOibs[k];
- } else {
- oibs.push(GameOibs[k]);
- }
- }
- }
- }
- var data = {
- oibs: oibs,
- queen: queen
- }
- return data;
- },
- sendKey(charCode) {
- {
- var ev = new KeyboardEvent('keydown', {
- 'keyCode': charCode,
- 'which': charCode
- });
- window.dispatchEvent(ev);
- ev = new KeyboardEvent('keyup', {
- 'keyCode': charCode,
- 'which': charCode
- });
- window.dispatchEvent(ev);
- }
- }
- },
- math: {
- distance(x1, y1, x2, y2) {
- var a = x1 - x2;
- var b = y1 - y2;
- return Math.sqrt(a * a + b * b);
- }
- },
- units: {
- blank: [],
- move(x, y) {
- //Moves selected units to reletive map pos 0,0 = top left
- lapa28344mauve[_0xda98("0xd9")]({
- x: parseInt(x.toString(), 10),
- y: parseInt(y.toString(), 10)
- });
- },
- move_origin_queen(x, y) {
- queen = chrome.player.scan(player.id).queen;
- //Moves selected units to reletive queen pos 0,0 = queen center
- lapa28344mauve[_0xda98("0xd9")]({
- x: parseInt((x + queen.x + player.cam.rx).toString(), 10),
- y: parseInt((y + queen.y + player.cam.ry).toString(), 10)
- });
- },
- move_origin_mouse(x, y) {
- //Moves selected units to reletive mouse pos 0,0 = directly on mouse
- lapa28344mauve[_0xda98("0xd9")]({
- x: parseInt((x + chrome.player.mouse.x).toString(), 10),
- y: parseInt((y + chrome.player.mouse.y).toString(), 10)
- });
- }
- },
- macro: {
- }
- }
- chrome.load();
- var bots = new Array();
- var loop = setInterval(makebots, 500);
- var players = 0;
- var connecting = 0;
- var MousePos = new Object();
- window.addEventListener("mousemove", captureMousePos);
- function captureMousePos(event) {
- MousePos.x = event.clientX;
- MousePos.y = event.clientY;
- }
- function getplayercount() {
- players = 0;
- for (var a = 0; a < lapa28390mauve.length; a++) {
- if (lapa28390mauve[a].bot == false && lapa28390mauve[a].alive == true) {
- players++;
- }
- }
- }
- function remove() {
- for (var i = 0; i < bots.length; i++) {
- if (bots[i].readyState != 1 && bots[bots.length - 1].opened == 1) {
- bots[i].close();
- connecting = 0;
- ring_slots[bots[i].ring_perma_pos] = 0;
- bots.splice(i, 1);
- }
- }
- }
- var friend_id = [];
- var ring_slots = [];
- for(var a = 0; a < 30; a++){
- ring_slots.push(0);
- }
- function deathbybots() {
- /*for (var a = 0; a < lapa28390mauve.length; a++) {
- {
- if (lapa28390mauve[a].nickname.includes("Chromium")) {
- //friend_id.push({uuid:"leader",id:a);
- }
- }
- }*/
- if (players < 30 && connecting == 0) {
- connecting = 1;
- var b = ui.lapa28498mauve.info.choice;
- bots.push(new WebSocket("ws://" + lapa28344mauve.lapa28498mauve[b].i + ":" + lapa28344mauve.lapa28498mauve[b].p))
- bots[bots.length - 1].onopen = function() {
- var name = Math.floor(Math.random()*10000);
- bots[bots.length - 1].send(JSON.stringify([String(name), 1, 1, 1, 1, 1, lapa28362mauve.lapa28367mauve]));
- bots[bots.length - 1].opened = 1;
- bots[bots.length - 1].uuid = String(name);
- var index = ring_slots.indexOf(0)
- bots[bots.length -1].ring_perma_pos = index;
- ring_slots[index] = 1;
- connecting = 0;
- }
- }
- }
- var spawn = false;
- var regroup = false;
- var inc = 0;
- function makethemdoshit() {
- var queen = chrome.player.scan(player.id).queen;
- for (var i = 0; i < bots.length; i++) {
- if(spawn){
- bots[i].send(new Uint8Array([0]));
- }
- for (var a = 0; a < 50; a++) {
- if (a != 0) {
- if(spawn){
- bots[i].send(JSON.stringify([3, queen.x, queen.y, [a]]));
- }
- } else {
- bots[i].send(JSON.stringify([3, 400+i*150, 0, [a]]));
- inc+=.001;
- }
- }
- }
- }
- window.addEventListener('keypress', function(e) {
- if (game.chat.info.input.info.state == 0 && game.is_run == true) {
- if (e.key == "e") {
- spawn = true;
- }
- if (e.key == "q"){
- spawn = false;
- }
- if(e.key=="`"){
- regroup = true;
- }
- if(e.key =="-"){
- regroup = false;
- }
- }
- });
- function makebots() {
- getplayercount();
- remove();
- deathbybots();
- makethemdoshit();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement