您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Autoscans streams for drops and enters the loot. Please set your browser to allow Vulcun popup when it asks you.
当前为
// ==UserScript== // @name Vulcun Loot Autoclicker + Streams scan // @namespace http://tampermonkey.net/ // @version 1.12 // @description Autoscans streams for drops and enters the loot. Please set your browser to allow Vulcun popup when it asks you. // @author Mihai Morcov // @match https://vulcun.com/user/lobby* // @grant none // ==/UserScript== /* jshint -W097 */ /** * Hello dear Vulcunians, * The waiting is finally over. A very smart autolooter is here and ready to grow. * If this script helps you and you get rich please consider donating me for a coffee. * Helps with the coding sessions. (Paypal: [email protected]) * * What you should do: * Open https://vulcun.com/user/lobby#page-live in a new tab * The script will scan for red drops * First time a 'red' drop is found, it will try to open it in a new tab * (YOU NEED TO CLICK ON ALLOW POPUPS FROM VULCUN IN YOUR BROWSER, only first time) * * * How it works: * 1. Scans the stream list every few minutes. * 2. If a 'red' drop is found opens it in a new tab * 3. It will click the Enter loot button * 4. It will close the loot tab after few minutes * 5. The initial tab will continue to scan for drops every minute, * and will also refresh the stream list every 10 minutes * * Good luck! * * PS: Use the Feedback forum if you have problems. */ /** Default time steps and delays: do not change these! var HIDE_TWITCH_PLAYER = true; var STREAM_SCAN_STEP = 10 * 1000; var STREAM_LOADING_TIME = 5 * 1000; var REFRESH_STREAMS_INTERVAL = 10 * 60 * 1000; var CLOSE_TAB_TIME = 2 * 60 * 1000; */ 'use strict'; var GREEN = '/img/lootdrop/long_pulse.gif'; var YELLOW = '/img/lootdrop/med_pulse.gif'; var RED = '/img/lootdrop/short_pulse.gif'; var NONE = ''; // Options, play with these, or don't: // *instructions-unclear meme here* var HIDE_TWITCH_PLAYER = true; var STREAM_SCAN_STEP = 10 * 1000; // scan next stream after 10 seconds var STREAM_LOADING_TIME = 5 * 1000; // wait 5 seconds before checking the stream status var REFRESH_STREAMS_INTERVAL = 10 * 60 * 1000; // refresh the streams list after 10 minutes var CLOSE_TAB_TIME = 2 * 60 * 1000; // keep a loot tab opened for 2 minutes var MSG_TWITCH_PLAYER_HIDDEN = "Twitch player is hidden by the Vulcun Loot Autoclicker script, to improve the performance."; function setCookie(key, value) { var expires = new Date(); //expires.setTime(expires.getTime() + (1 * 24 * 60 * 60 * 1000)); expires.setTime(expires.getTime() + (STREAM_SCAN_STEP - 1000)); console.debug('Set cookie(' + key + ',' + value + ')'); document.cookie = key + '=' + value + ';expires=' + expires.toUTCString(); } function getCookie(key) { var keyValue = document.cookie.match('(^|;) ?' + key + '=([^;]*)(;|$)'); var result = keyValue ? keyValue[2] : null; console.debug('Get cookie(' + key + ')=' + result); return result; } function scan() { var streams = $('#vu-game-listing-ongoing .vu-channel-tab'); var noOfStreams = streams.length; console.info(new Date() + " Begin cycling through "+noOfStreams+" streams..."); for (var i = 0; i < noOfStreams; i++) { var stream = streams[i]; setTimeout(check, STREAM_SCAN_STEP * (i + 1), stream); } return noOfStreams; } function hidePlayer() { var playerDiv = $('#channel-player-container'); playerDiv.attr('class' , ''); playerDiv.attr('style' , 'color: red;'); playerDiv.html('<b>'+MSG_TWITCH_PLAYER_HIDDEN+'</b>'); } function check(stream) { $(stream).click(); var idd = $(stream).attr('data-league'); if(HIDE_TWITCH_PLAYER == true) { hidePlayer(); } setTimeout(function(uniqueId) { var channelName = $("div[data-league='" + uniqueId + "'] .indexVideoPanelTitle").text(); var eta = $("#lootdrop-eta").attr('src'); var lootChestStyle = $("#lootdrop-eta").css('display'); if(lootChestStyle == 'none') { eta = NONE; } var color = ''; if(eta == RED) color = 'RED '; if(eta == YELLOW) color = 'YELLOW'; if(eta == GREEN) color = 'GREEN '; if(eta == NONE) color = 'NONE '; console.info(uniqueId + " - " + color + " - " + channelName); if(eta == RED) { console.log("Red detected on " + channelName); setCookie('redId', uniqueId); var win = window.open('https://vulcun.com/user/lobby#page-live', '_blank'); //win.focus(); } }, STREAM_LOADING_TIME, idd); } function enterContest() { $('#enter-lootdrop').each(function() { var parentDiv = $(this).parent(); console.log(parentDiv); var parentCss = parentDiv.css('display'); console.log(parentCss); var closeTimeout = 120000; if(parentCss == 'block') { this.click(); console.log("Button clicked"); //console.log("Loot dialog is open... Will close it in "+closeTimeout / 1000 +" seconds"); //setTimeout(closeModal, closeTimeout); //console.log('Stop enterLoot scanning.'); // clearInterval(enterLoot); } }); } function closeModal() { $('.close').each(function() { this.click(); console.log("Modal closed"); }); } function refresh() { location.reload(); } function closeTab() { window.top.close(); } var enterLoot; //$("div[data-league='1306']").click(); setTimeout(function() { var redId = getCookie('redId'); if (redId == null) { setTimeout(refresh, REFRESH_STREAMS_INTERVAL); if(HIDE_TWITCH_PLAYER == true) { hidePlayer(); } var noOfStreams = scan(); setInterval(scan, noOfStreams * STREAM_SCAN_STEP + STREAM_LOADING_TIME + 1000); } else { var channelName = $("div[data-league='" + redId + "'] .indexVideoPanelTitle").text(); console.log('Not scanning streams. Prepare for drop on ' + channelName); $("div[data-league='"+redId+"']").click(); if(HIDE_TWITCH_PLAYER == true) { hidePlayer(); } enterLoot = setInterval(enterContest, 10000); setTimeout(closeTab, CLOSE_TAB_TIME); } }, 2000);