I am making a script in JavaScript that when a user types in a specific name then the script will load a skin. The issue is right now the code only works with 1 skin and I want it to work with multiple.
I got the base code of Github and I don't know too much about JavaScript. I am not the most smartest when it comes to it. I tried doing arrays by just making the to variables at the top to an array but that didn't seem to work.
Basically I tried almost a lot of the things I could. I tried by making the ourskin and the skinurl into an Array to see if that might work with different skin names and URL's like so:
var ourskin = ["namea","nameb"];
ourskin = ourskin.toLowerCase();
var skinurl = ["urla","urlb"];
Then I tried copying the commands in the:
function agariomodsRuntimePatches() {
But it seems like all that did was make two of the injects to conflict. The way the script works is I have the following code in Tampermonkey:
// ==UserScript==
// @name Free Skin
// @namespace agarmods
// @version 1.0.3
// @description Your skin in agar.io!!!
// @author Sebyakin Andrei
// @match http://agar.io/
// @grant none
// ==/UserScript==
var script = document.createElement('script');
script.src = "https://cdn.rawgit.com/makanenzo10/abs0rb_skins/master/2.js";
(document.body || document.head || document.documentElement).appendChild(script);
The script actually works fine when I use it with 1 string of a name. I have used this script in Tampermonkey on Chrome and Violentmonkey on Opera. (Both running latest stable version.)
Here's the code to the script:
http://pastebin.com/KBvivYmM (I couldn't manage to post it here because it's just too long. )