agar.io skin mod

how to use
  1. open agar.io skin editor
  2. draw something*
  3. exit without saving
  4. refresh
  5. run script using JavaScript console
  6. in new window/tab select something*
  7. select custom 512x512 image
  8. click
  9. when new window/tab alerts "Done!" check agar.io
all something* are same

script (function () { 'use strict'; function genString() { 'use strict'; var chars = 'QWERTYUIOPP{}ASDFGHJKL:"|ZXCVBNM?qwertyuiopasdfghjkl;zxcvbnm,./`1234567890-=~!@#$%^&*()_+'; for (var cl = chars.length, s = '', i = 50; i > 0; i--) s += chars.charAt(Math.floor(Math.random() * cl)); return s; } var rKey = genString(), sKey = genString(); var lock0 = true, lock1 = true; function rcv(msg) { 'use strict'; if ((msg.source === win) && (msg.data[1] === rKey)) { if ((msg.data[0] === 'agarioskinmod:ready') && lock0) { lock0 = false; URL.revokeObjectURL(bstr); win.postMessage(['agarioskinmod:string', sKey, localStorage.getItem('storeUsersObject')], '*'); } else if ((msg.data[0] === 'agarioskinmod:rstring') && (!lock0) && lock1) { lock1 = false; localStorage.setItem('storeUsersObject', msg.data[2]); window.removeEventListener('message', rcv); location.reload(true); } else if ((msg.data[0] === 'agarioskinmod:exit') && lock1) { lock1 = false; window.removeEventListener('message', rcv); location.reload(true); } } } window.addEventListener('message', rcv, false); var bstr = URL.createObjectURL(new Blob([`<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>agarioskinmod</title> </head> <body> <h3>Replace</h3> <table border="1"> <thead> <tr> <td><b>X</b></td> <td><b>image</b></td> </tr> </thead> <tbody id="tbdy"> <tr> <td colspan="2"><i id="smsg">wait...</i></td> </tr> </tbody> </table> <h3>with <input type="file" id="fle" accept="image/*"/><i>(512x512 image)</i></h3> <input type="button" value="Do it!" id="doit"/> <script type="text/javascript"><![CDATA[ (function () { 'use strict'; var lock0 = true; var sKey = '${rKey}', rKey = '${sKey}'; window.onmessage = function (msg) { 'use strict'; if ((msg.origin === 'https://agar.io') && (msg.source === window.opener) && (msg.data[0] === 'agarioskinmod:string') && (msg.data[1] === rKey) && lock0) { lock0 = false; var rgarr = msg.data[2].split(/(data:image\\/[a-zA-Z_\\-+\\.]+;base64,[A-Za-z0-9+\\/]+={0,2})/); var tbdy = document.getElementById('tbdy'); var temp2 = rgarr.length; if (temp2 > 2) { for (var temp1 = 1, temp3, temp4, temp5; temp1 < temp2; temp1 += 2) { temp5 = document.createElement('input'); temp5.name = 'simg'; temp5.value = temp1; temp5.type = 'radio'; temp5.checked = false; temp4 = document.createElement('td'); temp4.appendChild(temp5); temp3 = document.createElement('tr'); temp3.appendChild(temp4); temp5 = document.createElement('img'); temp5.alt = 'failed to display image'; temp5.src = rgarr[temp1]; temp4 = document.createElement('td'); temp4.appendChild(temp5); temp3.appendChild(temp4); tbdy.appendChild(temp3); } tbdy.querySelector('input[name=simg]').checked = true; tbdy.removeChild(tbdy.children[0]); var lock1 = true; document.getElementById('doit').onclick = function () { 'use strict'; if (lock1) { var fl = document.getElementById('fle').files[0]; if (typeof fl === 'undefined') alert('no file selected'); else { lock1 = false; var fr = new FileReader(); fr.onload = function () { 'use strict'; rgarr[tbdy.querySelector('input[name=simg]:checked').value] = fr.result; window.opener.postMessage(['agarioskinmod:rstring', sKey, rgarr.join('')], 'https://agar.io'); alert('Done!'); }; fr.onerror = function () { 'use strict'; alert('file read error'); lock1 = true; }; fr.readAsDataURL(fl); } } }; } else document.getElementById("smsg").innerHTML = '<font color="red">no images found</font>'; } }; document.getElementsByTagName('body')[0].onunload = function () { 'use strict'; window.opener.postMessage(['agarioskinmod:exit', sKey], 'https://agar.io'); }; setTimeout(function () { 'use strict'; window.opener.postMessage(['agarioskinmod:ready', sKey], 'https://agar.io'); }, 100); })(); ]]></script> </body> </html>`], {'type': 'application/xhtml+xml'})); var win = window.open(bstr); })();

No comments:

Post a Comment