// ==UserScript== // @name AuTo Redeemer Steamkey(自动激活Steamkey) // @namespace HCLonely // @description 复制网页中的Steamkey后自动打开激活页面并激活 // @include https://greasyfork.org/zh-CN/scripts/36666-auto-redeemer-steamkey-%E8%87%AA%E5%8A%A8%E6%BF%80%E6%B4%BBsteamkey // @include *://store.steampowered.com/account/registerkey* // @include *://www.dlh.net/en/* // @include *://www.chrono.gg/* // @include *://groupees.com/* // @include *://secure.nuuvem.com/account/library/* // @include *://www.humblebundle.com/* // @include *://*dailyindiegame.com/account_page.html/* // @include *://*flyingbundle.com/users/account/* // @include *://steamcompanion.com/gifts/won/* // @include *://www.bundlestars.com/* // @include *://www.greenmangaming.com/user/account/* // @include *://www.indiegala.com/* // @include *://www.oplata.info/info/buy.asp/* // @include *://www.indiedb.com/giveaways/* // @include *://mail.*.com/* // @include *://bundle.ccyycn.com/order/id/* // @include *://vk.com/* // @include *://marvelousga.com/*.php?id=* // @include *://www.orlygift.com/* // @include *://www.steamgifts.com/giveaways/won // @include *://keychampions.net/giveaways/* // @include *://giveaway.su/giveaway/* // @include *://www.chubbykeys.com/giveaway.php?id=* // @include *://giveawayhopper.com/giveaway.php?id=* // @include *://simplo.gg/index.php?giveaway=* // @include *://www.skngiveaways.com/* // @include *://dupedornot.com/giveaway.php?id=* // @include *://www.fanatical.com/* // @include *://www.oneplay.com/en/* // @include *://gogobundle.com/* // @include *://www.bunchkeys.com/* // @include *://otakubundle.com/* // @include *://www.gamersgate.com/* // @include *//*lazyguysbundle.com/* // @include *://www.flyingbundle.com/* // @include *://cubicbundle.com/* // @include *://na.alienwarearena.com/* // @include *://gleam.io/* // @include *://www.2323qp.com/user/userorder.html // @version 1.1.2.1 // @grant none // @downloadURL none // ==/UserScript== var url = window.location.href; (function() { "use strict"; if(/https?:\/\/steamcn.com\/[\w\W]{0,}/.test(url)){ alert("AuTo Redeemer Steamkey(自动激活Steamkey):\r为了抢key公平,此页面不运行本脚本"); } if(/https?:\/\/tieba\.baidu\.com[\w\W]{0,}/.test(url)){ alert("AuTo Redeemer Steamkey(自动激活Steamkey):\r为了抢key公平,此页面不运行本脚本"); } var activateProduct = function(e) { var productKey = window.getSelection().toString().trim() || e.target.value; if (/^([\w\W]*)?([\d\w]{5}(\-[\d\w]{5}){2}(\r||,||,)?){1,}/.test(productKey)) { if (confirm("检测到神秘key,是否进入steam激活页面并激活?")) { var productKey1=productKey.replace(/\r\n/g,","); var productKey2=productKey1.replace(/\n/g,","); window.open("https://store.steampowered.com/account/registerkey?key=" + productKey2, "_blank"); } else { // } } else{ // } }; if(/https?:\/\/steamcn.com\/[\w\W]{0,}/.test(url)){ return false; } if(/https?:\/\/tieba\.baidu\.com[\w\W]{0,}/.test(url)){ return false; } window.addEventListener("copy", activateProduct, false); }()); if (/^https?:\/\/store\.steampowered\.com\/account\/registerkey*/.test(url)){ (function() { 'use strict'; var autoDivideNum = 9; var waitingSeconds = 20; var ajaxTimeout = 15; var keyCount = 0; var recvCount = 0; var timer; var allUnusedKeys = []; var failureDetail = { 14: '无效激活码', 15: '重复激活', 53: '次数上限', 13: '地区限制', 9: '已拥有', 24: '缺少主游戏', 36: '需要PS3?', 50: '这是充值码', }; var myTexts = { fail: '失败', success: '成功', network: '网络错误或超时', line: '——', nothing: '', others: '其他错误', unknown: '未知错误', redeeming: '激活中', waiting: '等待中', showUnusedKey: '显示未使用的Key', hideUnusedKey: '隐藏未使用的Key', }; var unusedKeyReasons = [ '次数上限', '地区限制', '已拥有', '缺少主游戏', '其他错误', '未知错误', '网络错误或超时', ]; function redeemKey(key) { jQuery.ajax({ url: 'https://store.steampowered.com/account/ajaxregisterkey/', data: { product_key: key, sessionid: g_sessionID }, type: 'post', dataType: 'json', timeout: 1000 * ajaxTimeout, beforeSend: function(){ if (jQuery('table').is(':hidden')) { jQuery('table').fadeIn(); } }, complete: function() { }, error: function() { tableUpdateKey(key, myTexts.fail, myTexts.network, 0, myTexts.nothing); return; }, success: function(data) { //console.log(data); if (data.success == 1) { tableUpdateKey(key, myTexts.success, myTexts.line, data.purchase_receipt_info.line_items[0].packageid, data.purchase_receipt_info.line_items[0].line_item_description); return; } else if (data.purchase_result_details !== undefined && data.purchase_receipt_info) { if (!data.purchase_receipt_info.line_items[0]) { tableUpdateKey(key, myTexts.fail, failureDetail[data.purchase_result_details] ? failureDetail[data.purchase_result_details] : myTexts.others, 0, myTexts.nothing); } else { tableUpdateKey(key, myTexts.fail, failureDetail[data.purchase_result_details] ? failureDetail[data.purchase_result_details] : myTexts.others, data.purchase_receipt_info.line_items[0].packageid, data.purchase_receipt_info.line_items[0].line_item_description); } return; } tableUpdateKey(key, myTexts.fail, myTexts.nothing, 0, myTexts.nothing); } }); } function setUnusedKeys(key, success, reason, subId, subName) { if (success && allUnusedKeys.includes(key)) { allUnusedKeys = allUnusedKeys.filter(function(keyItem){ return keyItem != key; }); var listObjects = jQuery('li'); for(var i = 0; i < listObjects.length; i++) { var listElement = listObjects[i]; var listObject = jQuery(listElement); if(listElement.innerHTML.includes(key)) { listObject.remove(); } } } else if (!success && !allUnusedKeys.includes(key) && unusedKeyReasons.includes(reason)) { var listObject = jQuery('
'); listObject.html(key + ' ( ' + reason + (subId != 0 ? (':' + subId + '
' + subName) : '') +
' )');
jQuery('#unusedKeys').append(listObject);
allUnusedKeys.push(key);
}
}
function tableInsertKey(key) {
keyCount++;
var row = jQuery('' + key + '
' + key + '
' + subId + '
' + subName + '