您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
3/20/2020, 12:03:44 AM
当前为
- // ==UserScript==
- // @name BTSLR COIN/NITRO Timer - bitsler.com
- // @namespace Violentmonkey Scripts
- // @match https://www.bitsler.com/*
- // @grant none
- // @version 1.06
- // @author Saaho2019
- // @description 3/20/2020, 12:03:44 AM
- // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
- // ==/UserScript==
- $(document).ready(function() {
- $(".bal-wrapper").append(
- '<button class="btn btn-success btn-deposit" id="btslrCounter">BTSLR</button>'
- );
- $(".bal-wrapper").append(
- '<button class="btn btn-success btn-deposit" id="nitroCounter">Nitro</button>'
- );
- $(".bal-container").append(
- '<div id="nitroTimer" style="display:none"><span class="minutes" id="nitroMinutes"></span> minutes <span class="seconds"id="nitroSeconds"></span> seconds </div>'
- );
- $(".bal-container").append(
- '<div id="btslrTimer"><span class="minutes" id="btslrMinutes"></span> minutes <span class="seconds"id="btslrSeconds"></span> seconds </div>'
- );
- $("#btslrTimer,#nitroTimer").css({
- "background-color": "#FFFF00",
- color: "#FF0000",
- "font-family": "Arial",
- "font-size": "12pt",
- "margin-left": "12px"
- });
- $("#btslrSeconds,#nitroSeconds").css({
- color: "#333",
- margin: "0 3px 0 15px",
- "font-size": "15px"
- });
- $("#btslrMinutes,#nitroMinutes").css({
- color: "#333",
- margin: "0 3px 0 15px",
- "font-size": "15px"
- });
- $(
- '<audio id="chatAudio"><source src="https://notificationsounds.com/notification-sounds/slow-spring-board-longer-tail-571/download/mp3" type="audio/wav"></audio>'
- ).appendTo(".bal-wrapper");
- if (isLogin()) {
- if (checkVipLevel()) {
- if (
- window.localStorage.getItem("timebtslr") === null ||
- window.localStorage.getItem("timebtslr") === "10:00"
- ) {
- $("#btslrCounter").show();
- $("#btslrTimer").hide();
- } else if (
- window.localStorage.getItem("timenitro") === null ||
- window.localStorage.getItem("timenitro") === "59:59"
- ) {
- $("#nitroCounter").show();
- $("#nitroTimer").hide();
- } else {
- console.log(window.localStorage.getItem("timebtslr"));
- window.localStorage.getItem("timebtslr");
- customFun.setTimer(window.localStorage.getItem("timebtslr"), "btslr");
- customFun.setTimer(window.localStorage.getItem("timenitro"), "nitro");
- $("#btslrCounter").hide();
- $("#btslrTimer").show();
- $("#nitroTimer").show();
- }
- }
- $("#btslrCounter").click(function() {
- $("#btslrCounter").hide();
- $("#btslrTimer").show();
- customFun.setTimer("10:00", "btslr");
- });
- $("#nitroCounter").click(function() {
- $("#nitroCounter").hide();
- $("#nitroTimer").show();
- customFun.setTimer("59:59", "nitro");
- });
- }
- });
- customFun = {
- setTimer: function(time, name) {
- var timer2 =
- window.localStorage.getItem("time" + name) ||
- window.localStorage.setItem("time" + name, time);
- timer2 = window.localStorage.getItem("time" + name);
- var interval = setInterval(function() {
- var timer = timer2.split(":");
- //by parsing integer, I avoid all extra string processing
- var minutes = parseInt(timer[0], 10);
- var seconds = parseInt(timer[1], 10);
- --seconds;
- minutes = seconds < 0 ? --minutes : minutes;
- if (minutes < 0) clearInterval(interval);
- seconds = seconds < 0 ? 59 : seconds;
- seconds = seconds < 10 ? "0" + seconds : seconds;
- if (minutes < 0) {
- $("#" + name + "Timer").hide();
- $("#" + name + "Counter").show();
- resetStartTime(name);
- var timerId = setInterval(function() {
- console.log(name);
- $("#chatAudio")[0].play();
- if (name == "nitro") {
- // console.log('hahahha');
- $(".na-username")
- .get(0)
- .click();
- // $('.na-burger').get(0).click();
- // $(".ns-nav button").attr("aria-expanded","true");
- } else {
- var list = document.getElementsByClassName("bal-amount")[0];
- var demo = list.getElementsByClassName("currency-small")[0];
- demo.alt == "BTSLR"
- ? $(".btn-claim")
- .get(0)
- .click()
- : alert("Time to claim your BTSLR COIN");
- }
- clearTimeout(timerId);
- }, 1000);
- } else {
- $("#" + name + "Minutes").text(minutes);
- $("#" + name + "Seconds").text(seconds);
- timer2 = minutes + ":" + seconds;
- window.localStorage.setItem("time" + name, timer2);
- }
- }, 1000);
- }
- };
- function checkVipLevel() {
- const nonNitro = [
- "platinum",
- "diamond black",
- "diamond",
- "diamond_master",
- "diamond_legend"
- ];
- var vipLevel = document
- .getElementsByClassName("na-user")[0]
- .getElementsByTagName("div")[0].classList[1];
- console.log(vipLevel);
- return nonNitro.includes(vipLevel);
- }
- function isLogin() {
- var loggedIn = document
- .getElementsByClassName("cs-button")[0]
- .getElementsByTagName("span")[0].textContent.length;
- if (loggedIn > 1) {
- console.log("***************Logged in**********************");
- return true;
- }
- }
- function resetStartTime(name) {
- name == "btslr" ? (k = "10:00") : (k = "59:59");
- window.localStorage.setItem("time" + name, k);
- }