您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Make da whoooole train automagically :D
当前为
// ==UserScript== // @name An auto-trainer??!! (SGChooChoo) // @namespace https://digitalfishfun.com // @version 0.2.3 // @description Make da whoooole train automagically :D // @author joonatoona // @include https://www.steamgifts.com/giveaways/new* // @include https://www.steamgifts.com/giveaway/* // @grant none // @run-at document-end // ==/UserScript== var cTrain = sessionStorage.getItem("pGid"); var doCart = sessionStorage.getItem("doCart"); var isSettings = sessionStorage.getItem("isSettings"); var timeOpen = parseInt(sessionStorage.getItem("timeOpen")); var groupId = "1898"; var cL = sessionStorage.getItem("cL"); var desc = sessionStorage.getItem("desc"); function setupTrain() { timeOpen = parseInt(prompt("It appears you haven't set up a train yet!\nHow long (In hours) would you like the giveaways to be open for?")*3600000); sessionStorage.setItem("timeOpen", timeOpen); cL = prompt("It appears you haven't set up a train yet!\nWhat should the minimum contributor level be?"); sessionStorage.setItem("cL", cL); desc = prompt("It appears you haven't set up a train yet!\nWhat should the generic description be?"); sessionStorage.setItem("desc", desc); } function formatTime(time) { var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; var date = new Date(time); var year = date.getFullYear(); var month = months[date.getMonth()]; var day = date.getDate(); var hour = date.getHours(); var stamp = "am"; if (hour >= 12) { stamp = "pm"; } if (hour > 12) { hour -= 12; } if (hour === 0) { hour = 12; } var min = date.getMinutes(); if (min < 10) { min = "0"+min; } return month + " " + day + ", " + year + " " + hour + ":" + min + " " + stamp; } function applyDates() { $("input[name='start_time']").val(formatTime(Date.now())); $("input[name='end_time']").val(formatTime(Date.now()+timeOpen)); } function applyRegionRestrictions() { $("div[data-checkbox-value='0']").trigger("click"); } function applyGroup() { $("div[data-checkbox-value='invite_only']").trigger("click"); } function applyLevel() { if (cL > 0) { $('input[name=contributor_level]').val(cL); $('.ui-slider-range').width(cL + '0%'); $('.ui-slider-handle').css('left', cL + '0%'); $('input[name=contributor_level]').next('div').find('span').text('level ' + cL); } } function applyGenericDescription(){ var newDesc = $("textarea[name='description']").val().replace(desc, "") + "\n\n" + desc; if (cTrain !== null) { newDesc += "\n[NEXT](https://steamgifts.com/giveaway/"+sessionStorage.getItem("pGid")+"/)"; } $("textarea[name='description']").val(newDesc); } function clickCreate(){ $("form").first().submit(); } var cPath = window.location.href.split("/"); console.log(cPath); if (cPath[cPath.length-1] == "new") { $(".form__rows").after('<br/><div id="addTrain" class="form__submit-button js__submit-form"><i class="fa fa-arrow-circle-right"></i> CHOOO CHOOOOOOO</div>'); $("#addTrain").click(function() { if (isSettings === null) { setupTrain(); sessionStorage.setItem("isSettings", true); } applyDates(); applyRegionRestrictions(); applyGroup(); applyLevel(); applyGenericDescription(); sessionStorage.setItem("doCart", true); clickCreate(); }); } if (cPath[cPath.length-3] == "giveaway" && doCart) { sessionStorage.setItem("pGid", cPath[cPath.length-2]); sessionStorage.setItem("doCart", false); }