Venipa / NulledBB V3 - RPS no cooldown

// ==UserScript==
// @name         NulledBB V3 - RPS no cooldown
// @namespace    https://venipa.net
// @version      0.1
// @description  try to take over the world!
// @license GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
// @author       Venipa
// @match        https://nulledbb.com/rps
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    const pageScript = Array.from(document.head.querySelectorAll("script")).reverse()[0];
    const csrf = pageScript.textContent.match(/key\: \'(\w+)\'/)[1];
    jQuery('.rps-box').off('click');
    jQuery(function(){
		var choice = null;
		var clickDisabled = false;
		jQuery('.rps-box').on( "click", function(e){
			choice = jQuery(this).attr('data-type');
			jQuery.ajax({
				url: 'https://nulledbb.com/credits/?action=rps&request=ajax',
				method: 'POST',
				data: { key: csrf, userchoice: choice },
				dataType: 'json',
				success: function(data){
					if( data.status == '3' || data.status == 3 )
					{
						toastr.error( data.string );
					}
					refreshStats();
					globalStats();
				}
			});
			return false;
		});
	});
})();