Auto Stickers

Posts Stickers Automatically in NT Race

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Auto Stickers
// @namespace    mq
// @version      1.0
// @description  Posts Stickers Automatically in NT Race
// @author       mq
// @match        https://www.nitrotype.com/race
// @license      
// ==/UserScript==

/*
Variable frequency_of_stickers usages :
100 -> post sticker in every race i.e. 100% chance
 70 -> post sticker in 7 out of 10 races i.e. 70% chance
 50 -> post sticker every other race i.e. 50% chance
 33 -> post sticker in every thrid race i.e. 33% chance
*/
var frequency_of_stickers = 100;
/*
Variable sticker_choice usages :
0 -> Random choice from all available stickers
1 -> First sticker
2 -> Second sticker
3 -> Third sticker and so on
*/
var sticker_choice = 0;

var clt_intvl = null;
function look_for_b(){
    var a = document.getElementsByClassName('raceChat-pickerOpt');
    if(a.length != 0 && a.length != undefined){
        setTimeout(function() {
            click_the_b(a);
        }, 3900)
        clearInterval(clt_intvl);
    }
}

clt_intvl = setInterval(look_for_b, 300);

function click_the_b(a){
    if(Math.floor((Math.random() * 100) + 1) <= frequency_of_stickers){
        var total_choices = a.length;
        if(sticker_choice == 0){
            var current_choice = Math.floor((Math.random() * total_choices));
            a[current_choice].firstChild.click();
        }
        else{
            a[sticker_choice - 1].firstChild.click();
        }
    }
}