NyQuery

Makes Money

Versión del día 08/10/2017. Echa un vistazo a la versión más reciente.

Este script no debería instalarse directamente. Es una biblioteca que utilizan otros scripts mediante la meta-directiva de inclusión // @require https://update.greatest.deepsurf.us/scripts/33763/222745/NyQuery.js

Tendrás que instalar una extensión para tu navegador como Tampermonkey, Greasemonkey o Violentmonkey si quieres utilizar este script.

Necesitarás instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Userscripts para instalar este script.

Necesitará instalar una extensión como Tampermonkey para instalar este script.

Necesitarás instalar una extensión para administrar scripts de usuario si quieres instalar este script.

(Ya tengo un administrador de scripts de usuario, déjame instalarlo)

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

(Ya tengo un administrador de estilos de usuario, déjame instalarlo)

// ==UserScript==
// @name         NyQuery
// @namespace    https://greatest.deepsurf.us/users/144229
// @version      1.1.5
// @description  Makes Money
// @author       MasterNyborg
// @icon         http://i.imgur.com/wS1IQwd.jpg
// @require      http://code.jquery.com/jquery-latest.min.js
// ==/UserScript==

function hotKey(element, input){ //Adds click hotkey for given element(s) based on direct keyboard input (not event codes)
    $(document).keypress(function(event){
        if (String.fromCharCode(event.which) == input){
            $(element).click();
        }
    });
}

function clickText(text, input){ //Adds click hotkey for any element containing given text (case sensitive) based on direct keyboard input
    $(document).keypress(function(event){
        if (String.fromCharCode(event.which) == input){
            $(':contains('+text+')').click();
        }
    });
}

function randNum(min, max) { //returns a random integer between min and max
    return Math.floor(Math.random() * (max - min + 1)) + min;
}

function newPic(href, w = "auto", h = "auto"){ //returns and img html object
    return `<img src=${href} style="width:${w}px;height:${h}px;"></img>`;
}

function afterPic(obj, href, w = "auto", h = "auto"){ // adds an image after object. Object, url
    $(obj).after(newPic(href, w, h));
}

function beforePic(obj, href, w = "auto", h = "auto"){ // adds an image before object. Object, url
    $(obj).before(newPic(href, w, h));
}

function noRules(){ //replaces instructions with a hide/show button
    if($('.panel.panel-primary').length){ $('.panel.panel-primary').hide().before('<div><button id="toggle" style="background-color:#008CBA; border: none; color: white;" type="button">Show Instructions</button></div>');}
    $('#toggle').click(function () {
        $(this).text($(this).text() === 'Show Instructions' ? 'Hide Instructions' : 'Show Instructions');
        $('.panel-heading').toggle();
        $('.panel.panel-primary').toggle();
    });
}

function newButt(id, text=id, cl="nybutt", bg="green"){ //returns an html button
    return `<button id=${id} class=${cl} style="background-color:${bg}; border: none; color: white; vertical-align:top;" type="button">${text}</button>`;
}

function clickButt(obj, func=$()){ //creates a click function for button (or anything really) functions purpose is for readability.
    $(obj).click(func);
}

function gmGet(name) { //get local variable
    var theValue = GM_getValue(name);
    return theValue;
}

function gmSet(name, valuee) { //set local variable
    GM_setValue(name, valuee);
}

function newStyle(pop) { //changes style of html element
    var div = $('<div />', {
        html: '&shy;<style>' + pop + '</style>'
    } ).appendTo('body');
}