Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.20 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Tundra Advanced Example
  3. // @version 1.4
  4. // @description Advanced UserScript Example for Tundea
  5. // @author Goodra
  6. // @match http://*.moomoo.io/*
  7. // @match https://*.moomoo.io/*
  8. // @grant none
  9. // @namespace https://greasyfork.org/users/216897
  10. // ==/UserScript==
  11.  
  12. //TO RUN THIS SCRIPT YOU MUST HAVE TUNDRA INSTALLED
  13. //YOU CAN GET TUNDRA FROM https://discord.gg/NdQzvtE
  14.  
  15. //I made this really fast. It probably has bugs and can be improved. This is just an example its not perfect
  16.  
  17. (function() {
  18. 'use strict';
  19. setTimeout(function(){
  20. var ret = !1;
  21. if(typeof(Storage) == "undefined")return console.error('There was an unexpected issue loading Tundra Advanced Example'); //if no storage returns an error
  22. console.log('Tundra advanced example loaded');
  23. var p = {
  24. ver: 1, //version number
  25. vSpike: {//mods
  26. a: !1,//a is my enable/disable varable. if you change this here change it everywhere else
  27. desc: 'Click "v" to place 4 spike'
  28. },
  29. aChat: {
  30. a: !1,
  31. desc: 'Automaticly chats'
  32. }
  33. };
  34. var itemCount = $('.settingsItem').length;//amount of default tundra mods
  35. var pKeys = Object.keys(p);//names of mods
  36. pKeys.shift();//delets version from the names list
  37. window.itemCount = itemCount;
  38. if(localStorage.advancedExample){//tests if you have this mod
  39. localStorage.advancedExample.ver<p.ver?(alert('Advanced Example has been updated! Please re-enable your mods'),localStorage.advancedExample = JSON.stringify(p)):void 0;//checks if needs to update
  40. window.advancedExample = JSON.parse(localStorage.advancedExample);
  41. p = window.advancedExample;
  42. pKeys = Object.keys(p);//same stuff as before
  43. pKeys.shift();
  44. }else{
  45. window.advancedExample = p;//if no mod set this as the mod
  46. localStorage.advancedExample = JSON.stringify(p);
  47. }
  48. window.changeMods = function(l){
  49. window.advancedExample[pKeys[l-itemCount]].a = !window.advancedExample[pKeys[l-itemCount]].a; //sets your mod to be the oposite of what it was
  50. localStorage.advancedExample = JSON.stringify(window.advancedExample);//saves
  51. $(`#settingsDisplay${l}`)[0].innerHTML = `\<span>${pKeys[l-itemCount]}\<span>\<div class="joinAlBtn" style="margin-top: 5px;" onclick="changeMods(${l});">${window.advancedExample[pKeys[l-itemCount]].a}\</div>\</span>\</span>`;//shows in settings menu
  52. }
  53. window.pKeys = pKeys;
  54. for (let i = 0; i < pKeys.length; i++) { //adds your mods to settings menu
  55. setTimeout(function() {
  56. var k = document.createElement('div');
  57. k.id = `settingsDisplay${i+itemCount}`;
  58. k.className = 'settingsItem';
  59. k.innerHTML = `\<span>${pKeys[i]}\<span>\<div class="joinAlBtn" style="margin-top: 5px;" onclick="changeMods(${i+itemCount});">${window.advancedExample[pKeys[i]].a}\</div>`;
  60. k.onmouseover = function(){var pp = document.getElementById('itemInfoHolder');pp.innerHTML = `\<div id="itemInfoName">${pKeys[i]}\</div>\<div id="itemInfoDesc">${window.advancedExample[pKeys[i]].desc}\</div>`;pp.classList.add('visible');};
  61. k.onmouseout = function(){document.getElementById('itemInfoHolder').classList.remove('visible');}
  62. document.getElementById('settingsHolderU').append(k);
  63. }, 0);
  64. }
  65. function place(id, rot){
  66. window.ws.send('5', id, null);
  67. window.ws.send('c', 1, rot);
  68. window.ws.send('c', 0, rot);
  69. }
  70. setInterval(function(){if(!window.advancedExample.aChat.a)return;window.ws.send('ch', window.chat);}, 3000);//if you have aChat enabled it will autochat
  71. document.addEventListener('keydown', function(e){
  72. if(document.activeElement.id.toLowerCase() == 'chatbox')return;
  73. switch (e.keyCode) {
  74. case 86: if(!window.advancedExample.qSpike.a)return;place(window.items[2], 0); place(window.items[2], 1.55); place(window.items[2], 3.1); place(window.items[2], -1.55);break;//if you have qSpike enabled and click 'v' it will quad spike
  75. }
  76. })
  77. }, 1000);
  78. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement