Toradorable Agar-Networks.com

A Toradorable skin changer supporting multiple animations and variable image display times. Includes a UI. To use, press "C" in game to cycle between different animations.

  1. // ==UserScript==
  2. // @name Toradorable Agar-Networks.com
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2.10
  5. // @description A Toradorable skin changer supporting multiple animations and variable image display times. Includes a UI. To use, press "C" in game to cycle between different animations.
  6.  
  7. // @author Toradorable
  8. // @match http://agar-network.com/*
  9. // @grant none
  10. // @require https://greasyfork.org/scripts/24894-toradorable-animator/code/Toradorable%20Animator.js?version=158248
  11. // @require https://greasyfork.org/scripts/24844-toradorable-animation-for-toradorable-skin-changer/code/Toradorable%20Animation%20for%20Toradorable%20Skin%20Changer.js
  12. // @require https://greasyfork.org/scripts/24901-iwubbz-s-candy-animation-for-toradorable-skin-changer/code/iWubbz's%20Candy%20Animation%20for%20Toradorable%20Skin%20Changer.js
  13. // @require https://greasyfork.org/scripts/24858-dancing-cat-animation-for-toradorable-skin-changer/code/Dancing%20Cat%20Animation%20for%20Toradorable%20Skin%20Changer.js
  14. // ==/UserScript==
  15. setTimeout(function(){
  16.  
  17. animator.site.updateFrame= function(nick=animator.currentFrameNick(), skin=animator.currentFrameSkin(), time=animator.currentFrameDisplayTime(), displaylocal=true) {
  18. //this.elements.skinurl.value = skin;
  19. setNick(nick,document.getElementById('team_name').value,skin,$('.partyToken').val());
  20. };
  21. animator.init();
  22. animator.site.elements.skinurl=document.getElementById('skin_url');
  23. animator.site.elements.cssElement=document.getElementById('lb_detail');
  24. animator.site.initilaizeUI();
  25. animator.site.elements.animationSelector.style.height="30px";
  26. animator.site.elements.animationSelector.style.opacity=0.5;
  27. animator.site.elements.speedMultiplierBox.style.height="30px";
  28. animator.site.elements.speedMultiplierBox.style.opacity=0.5;
  29. animator.site.elements.incrementSpeedMuliplier.style.height="30px";
  30. animator.site.elements.decrementSpeedMuliplier.style.height="30px";
  31. animator.site.elements.animationStatus.style.height="30px";
  32. window.animator=animator;
  33. /*
  34. * Setup Custome Web Elements
  35. */
  36.  
  37.  
  38.  
  39. /*
  40. var overlays2=document.getElementById("overlays2");
  41. var mipmapNode = document.getElementById("mipmapNode");
  42. var chatboxInput=document.getElementById("input_box2");
  43. var StealSkinBox = chatboxInput.cloneNode(true);
  44. StealSkinBox.name="Steal Skin From:";
  45. StealSkinBox.id="StealSkinElm";
  46. StealSkinBox.value="";
  47. StealSkinBox.placeholder="Steal Skin From:";
  48. StealSkinBox.style.cssText = document.defaultView.getComputedStyle(chatboxInput, "").cssText;
  49. StealSkinBox.style.width="200px";
  50. StealSkinBox.style.right="9px";
  51. StealSkinBox.style.bottom="218px";
  52. StealSkinBox.style.position="absolute";
  53. var SkinTargetType = StealSkinBox.cloneNode(true);
  54. SkinTargetType.name="Skin Target Type:";
  55. SkinTargetType.id="SkinTargetType";
  56. SkinTargetType.value="Theft"; // Theft, Swap, Push
  57. SkinTargetType.placeholder="Skin Target Type:";
  58. SkinTargetType.style.cssText = document.defaultView.getComputedStyle(chatboxInput, "").cssText;
  59. SkinTargetType.style.width="200px";
  60. SkinTargetType.style.right="9px";
  61. SkinTargetType.style.bottom="258px";
  62. SkinTargetType.style.position="absolute";
  63. overlays2.insertBefore(SkinTargetType, overlays2.lastChild);
  64. overlays2.insertBefore(StealSkinBox, overlays2.lastChild);
  65. var LieAs = chatboxInput.cloneNode(true);
  66. LieAs.name="LieAs";
  67. LieAs.id="LieAsElm";
  68. LieAs.value="";
  69. LieAs.placeholder="Not Lying";
  70. LieAs.style.cssText = document.defaultView.getComputedStyle(chatboxInput, "").cssText;
  71. //LieAs.
  72. var chatAreaElem=document.getElementById("chatboxArea2");
  73. chatAreaElem.insertBefore(LieAs, chatAreaElem.firstChild);
  74.  
  75. */
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82. /*
  83. * Setup Hotkeys
  84. */
  85. /*
  86. var hotKeyTable = document.getElementById("hotkey_table");
  87. var hotkeyMappingREV={};
  88. var tmphotkeyMapping=JSON.parse(getLocalStorage("hotkeyMapping"));
  89. for (var prop in tmphotkeyMapping) {
  90. hotkeyMappingREV[tmphotkeyMapping[prop]]=prop;
  91. }
  92.  
  93.  
  94.  
  95.  
  96. function AddHotKey(hk) {
  97. var hkdefault = {
  98. id: "hk_change_my_hotkey_id",
  99. defaultHotkey: "",
  100. key: null,
  101. description: "Change My Description",
  102. keyDown: null,
  103. keyUp: null,
  104. type: "NORMAL"
  105. };
  106. hk = Object.assign(hkdefault,hk);
  107. if (! hk.key || hk.key === null) hk.key = hotkeyMappingREV[hk.id];
  108. if (! hk.key || hk.key === null) hk.key = hk.defaultHotkey;
  109. var hk_element = hotKeyTable.lastChild.cloneNode(true);
  110. hk_element.children[0].dataset.hotkeyid = hk.id;
  111. hk_element.children[0].innerHTML=hk.key;
  112. hk_element.children[1].innerHTML=hk.description;
  113. hk_element.children[2].innerHTML="/";
  114. console.log("Adding Hotkey: " + hk);
  115. hotKeyTable.appendChild(hk_element);
  116. hotkeyConfig[hk.id]= {
  117. defaultHotkey: hk.defaultHotkey,
  118. name: hk.description,
  119. keyDown: hk.keyDown,
  120. type: hk.type
  121. };
  122. hotkeyMapping[hk.key] = hk.id;
  123. return hk_element;
  124. }
  125. chatRoom.doTellLie=false;
  126. var hk_TellLie = AddHotKey({
  127. id: "hk_TellLie",
  128. defaultHotkey: "CTRL_ENTER",
  129. description: "Open Chatbox and send message as another player",
  130. keyDown: function() {
  131. if (chatRoom["isFocus"]()) {
  132. TellLie($("#input_box2")["val"]());
  133. $("#input_box2")["val"]("");
  134. $("#input_box2")["blur"]();
  135. $("#chatboxArea2")["hide"]();
  136. } else {
  137. chatRoom["focus"]();
  138. }
  139. }
  140. });
  141.  
  142.  
  143.  
  144.  
  145. var hk_StealNearbySkin = AddHotKey({
  146. id: "hk_StealNearbySkin",
  147. defaultHotkey: "N",
  148. description: "Grab Skin of Nearby Player",
  149. keyDown: function() {
  150. var playerId = GetNearestSkinnedCellId();
  151. if (playerId) StealSkinBox.value="#" + GetNearestSkinnedCellId();
  152. else StealSkinBox.value="";
  153. }
  154. });
  155.  
  156.  
  157.  
  158.  
  159. var hk_StealNearbyName = AddHotKey({
  160. id: "hk_StealNearbyName",
  161. defaultHotkey: "",
  162. description: "Grab Name of Nearby Player",
  163. keyDown: function() {
  164. LieAs.value=GetNearestCell()[1];
  165. }
  166. });
  167.  
  168.  
  169.  
  170.  
  171. var hk_ToggleStolenSkin = AddHotKey({
  172. id: "hk_ToggleStolenSkin",
  173. defaultHotkey: "M",
  174. description: "Use/Stop Using Stolen Skin",
  175. keyDown: function() {
  176. //skinChanger=false;
  177. Print("Will Steal Skin");
  178. if (FakeSkinWanted && !DoStealSkin) {
  179. Print("FakeSkinWanted && !DoStealSkin");
  180. RefreshSkin(0,true);
  181. //LagOnce();
  182. } else if(FakeSkinWanted) {
  183. Print("FakeSkinWanted");
  184. FakeSkinWanted=false;
  185. DoStealSkin=false;
  186. } else {
  187. Print("STARTING FAKE SKIN CALL");
  188. FakeSkinWanted=true;
  189. DoStealSkin=true;
  190. FakeSkin();
  191. }
  192. }
  193. });
  194. var hk_ToggleShareSkin = AddHotKey({
  195. id: "hk_ToggleShareSkin",
  196. defaultHotkey: "S",
  197. description: "Share/Stop Sharing Skin",
  198. keyDown: function() {
  199. DoShareSkin = !DoShareSkin;
  200. //ShareSkin();
  201. }
  202. });
  203.  
  204.  
  205. var hk_ReconnectToServer = AddHotKey({
  206. id: "hk_ReconnectToServer",
  207. defaultHotkey: "L",
  208. description: "Reconnect to Server",
  209. keyDown: function() {
  210. connect(myApp.getCurrentPartyCode());
  211. }
  212. });
  213.  
  214.  
  215.  
  216.  
  217. var hk_CycleSkinRotator = AddHotKey({
  218. id: "hk_CycleSkinRotator",
  219. defaultHotkey: "C",
  220. description: "Cycle Skin Rotator",
  221. keyDown: function() {
  222. if (skinChangerWanted && !skinChanger) {
  223. RefreshSkin(0,true);
  224. //LagOnce();
  225. } else if(skinChangerWanted) {
  226. skinChangerWanted=false;
  227. skinChanger=false;
  228. } else {
  229. skinChangerWanted=true;
  230. skinChanger=true;
  231. skinidx++;
  232. if(skinidx >= skinList.length) {skinidx = 0;}
  233. AutoChangeSkin();
  234. }
  235. }
  236. });
  237. //myApp.refreshHotkeySettingPage();
  238.  
  239.  
  240.  
  241.  
  242. //myApp.restoreSetting();
  243.  
  244.  
  245.  
  246.  
  247. myApp.setUpHotKeyConfigPage();
  248.  
  249.  
  250. */
  251. /*********************
  252. * Generic Functions *
  253. *********************/
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262. function isNumeric(n) {
  263. return !isNaN(parseFloat(n)) && isFinite(n);
  264. }
  265.  
  266.  
  267.  
  268.  
  269. function Print(msg) {
  270. console.log(msg);
  271. }
  272.  
  273.  
  274.  
  275. /*****************
  276. ** Custom Hot Keys
  277. ******************/
  278.  
  279.  
  280.  
  281.  
  282. const keycodes={
  283. backspace:8, tab:9, enter:13,
  284. shift:16, ctrl:17, alt:18,
  285. pause_break:19, capslock:20, escape:27,
  286. space:32, pageup:33, pagedown:34,
  287. end:35, home:36, leftarrow:37,
  288. uparrow:38, rightarrow:39, downarrow:40,
  289. insert:45, delete:46,
  290. 0:48, 1:49, 2:50, 3:51,
  291. 4:52, 5:53, 6:54, 7:55,
  292. 8:56, 9:57, a:65, b:66,
  293. c:67, d:68, e:69, f:70,
  294. g:71, h:72, i:73, j:74,
  295. k:75, l:76, m:77, n:78,
  296. o:79, p:80, q:81, r:82,
  297. s:83, t:84, u:85, v:86,
  298. w:87, x:88, y:89, z:90,
  299. multiply: 106, add: 107, subtract: 109,
  300. decimalpoint: 110, divide: 111,
  301. f1: 112, f2: 113, f3: 114,
  302. f4: 115, f5: 116, f6: 117,
  303. f7: 118, f8: 119, f9: 120,
  304. f10: 121, f11: 122, f12: 123,
  305. numlock: 144, scrolllock: 145,
  306. semicolon: 186, equalsign: 187,
  307. comma: 188, dash: 189, period: 190,
  308. forwardslash: 191, graveaccent: 192,
  309. openbracket: 219, backslash: 220,
  310. closebraket: 221, singlequote: 222
  311. };
  312.  
  313.  
  314.  
  315.  
  316. window.addEventListener('keydown', keydown);
  317. function keydown(e) {
  318. var chatArea=$("#chatboxArea2");
  319. var chatIsFocused=$("#input_box2").is(':focus') || $("#LieAsElm").is(':focus') || $("#StealSkinElm").is(':focus');
  320. if(e.keyCode === keycodes.c && !(chatIsFocused)) {
  321. if (animator.isPlaying) {
  322. animator.pauseAnimation();
  323. animator.nextAnimation();
  324. } else {
  325. animator.playAnimation();
  326. }
  327. }
  328. else if(e.keyCode === 27) {
  329. animator.pauseAnimation();
  330. //temporary workaround
  331. $("#overlays")["show"]();
  332. }
  333. else if(e.keyCode === keycodes.add && !(chatIsFocused)) {
  334. //naservers();
  335. animator.incrementSpeedMultiplier();
  336. } else if(e.keyCode === keycodes.subtract && !(chatIsFocused)) {
  337. //naservers();
  338. animator.decrementSpeedMultiplier();
  339. } else if(e.keyCode === keycodes[0] && !(chatIsFocused)) {
  340. //naservers();
  341. animator.setSpeedMultiplier(1);
  342. }
  343. /*else if(e.keyCode === keycodes.l && !(chatIsFocused)) {
  344. //naservers();
  345. connect(myApp.getCurrentPartyCode());
  346. }*/
  347. /*else if((e.keyCode === keycodes.space || e.keyCode === keycodes.t) && !IsDoingFireork && !($("#chatboxArea2").is(":focus"))) {
  348. fireworkidx=0;
  349. Firework();
  350. }*/
  351. }
  352.  
  353.  
  354.  
  355.  
  356. //$('.content').append('<input style="border:1px solid grey;" placeholder="Time between skin change (milliseconds)" id="skin_change_inputSpeed" value="500" type="number" min="300"/>');
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368. function HasRestarted() {
  369. if (testHasRestarted >=5) {
  370. testHasRestarted=0;
  371. } else {
  372. testHasRestarted++;
  373. return false;
  374. }
  375. var myCell;
  376. try {
  377. if(typeof getCell != 'function') throw "GetCell is NotAFunc";
  378. myCell=getCell();
  379. if(myCell === undefined) throw "GetCell Returned null";
  380. if(myCell[0] === undefined) throw "CellDataEmpty";
  381. if(myCell[0].x === undefined) throw "Cell has no X";
  382. FailCount=0;
  383. }
  384. catch(err) {
  385. console.log(err," ",FailCount);
  386. myCell=null;
  387. FailCount++;
  388. }
  389. finally {
  390. if (FailCount >= 5) return true;
  391. else if (FailCount !== 0) return false;
  392. myCell=myCell[0];
  393. }
  394. if (LastXY[0] != myCell.x || LastXY[1] != myCell.y) {
  395. LastXY=[myCell.x,myCell.y];
  396. return false;
  397. }
  398. var LB = getLB();
  399. if (LB.length != 9) return false;
  400. for (var i=0; i < 8; i++) { // Leaderboard 1-8 should be named RESTART
  401. if (LB[i].name != "RESTART") return false;
  402. }
  403. // Leaderboard 9 should be named ALIS.IO
  404. if (LB[8].name != "ALIS.IO") return false;
  405. return true;
  406. }
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415. /*************************
  416. * Skin Changing Functions
  417. *************************/
  418.  
  419.  
  420.  
  421.  
  422. /*
  423. * Change Your Skin
  424. */
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432. // Method for overloading global functions directly (functions in objects dont need this)
  433. function addJS_Node (text, s_URL, funcToRun, runOnLoad) {
  434. var D = document;
  435. var scriptNode = D.createElement ('script');
  436. if (runOnLoad) {
  437. scriptNode.addEventListener ("load", runOnLoad, false);
  438. }
  439. scriptNode.type = "text/javascript";
  440. if (text) scriptNode.textContent = text;
  441. if (s_URL) scriptNode.src = s_URL;
  442. if (funcToRun) scriptNode.textContent = '(' + funcToRun.toString() + ')()';
  443. var targ = D.getElementsByTagName ('head')[0] || D.body || D.documentElement;
  444. targ.appendChild (scriptNode);
  445. }
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454. //$('#overlays2').append('<h6 style="margin-left:500px">Agarlist Skin Changer by Torodorable</h6>')
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467. //To turn it on press c, add skins by "skin url", enjoy
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476. }, 10000);
  477.  
  478.  
  479.  
  480.  
  481.  
  482.