span:contains("Join ")').click();
$('button>span:contains("Follow ")').click();
doTask(wgn_enter,new Date().getTime(),($('button>span:contains("Join ")').length+$('button>span:contains("Follow ")').length)*3);
};
HCL.id("Verify").onclick=function(){
alert("请手动完成加组任务!");
HCL.id("exInfo").style.display="block";
wgn_enter();
};
btn_class("btn btn-primary");
//wgn获取key
function wgn_enter(){
httpSend({
type: "post",
url: url,
data:{submit: "Enter"},
callback: function (data) {
if(data.status==200){
if(/Steam key:<\/h3>
[\w\d]{5}(-[\w\W]{5}){2}<\/strong><\/p>/i.test(data)){
var key=data.match(/Steam key:<\/h3>
[\w\d]{5}(-[\w\W]{5}){2}<\/strong><\/p>/i)[0];
key=key.replace(/(Steam key:<\/h3>
)|(<\/strong><\/p>)/gi,"");
data=data.replace(key,`${key}`);
}
document.write(data);
}else{
info("","color:red",data.statusText+":"+data.status);
}
},
});
}
}
if(/gamehag/.test(url)){//gamehag领key
if($("div.strong").eq(0).text()==0){
$("div.strong").eq(0).parent()[0].style.backgroundColor="red";
confirm("此页面已经没有key了,是否关闭?")&&(window.close());
}else if($("div.strong").eq(1).text()==0){
$("div.strong").eq(1).parent()[0].style.backgroundColor="red";
confirm("此领key页面已过期,是否关闭?")&&(window.close());
}
var success,error,a,survey=0;;
btn_class("btn btn-primary btn-sm box-collapse-verify");
$("#doTaskDiv").css({"right": "340px","top": "100px"});
$("#doTask").width("105px");
$("#Verify").width("105px");
$("#Remove").width("105px");
HCL.css.gm(`.misty-notification{display:none !important}`);
//gamehag按钮定义
HCL.id("doTask").onclick=function(){
HCL.id("exInfo").style.display="block";
$('button>span:contains("Join ")').click();
$('button>span:contains("Follow ")').click();
info("card-text monospace","",`正在做加组、关注等任务(此功能需要Giveaway Helper脚本,没有则自动跳过此步骤),请稍候!`);
doTask(function(){
success=0;
error=0;
survey=$("a.giveaway-survey").length>0&&(/\+1/gim.test($("a.giveaway-survey").parent().parent().next().text()))?1:0;
a=0;
var p=info("card-text monospace","",`正在做任务...`);
$("button[data-id]").length>0?gamehag_task(p):gamehag_suryey(0,p);
},new Date().getTime(),($('button>span:contains("Join ")').length+$('button>span:contains("Follow ")').length)*3);
};
HCL.id("Verify").onclick=function(){
HCL.id("exInfo").style.display="block";
success=0;
error=0;
survey=$("a.giveaway-survey").length>0&&(/\+1/gim.test($("a.giveaway-survey").parent().parent().next().text()))?1:0;
$("button[data-id]").length>0&&($("button[data-id]").map(function(i,e){gamehag_verify(e)}));
survey==1&&(gamehag_verify($("a.giveaway-survey")[0],"data-task_id"));
};
!empty(HCL.id("getkey"))&&(HCL.id("getkey").onclick=function(){HCL.css.gm(`.misty-notification{display:block !important}`)});
//gamehag做任务
function gamehag_task(p){
$("button[data-id]").map(function(i,e){
httpSend({
mode:"gm",
url:'//gamehag.com/giveaway/click/'+$(e).attr("data-id"),
type:'get',
headers:{'x-csrf-token': $('meta[name="csrf-token"]').attr('content')},
callback:function(data){
httpSend({mode:"gm",url:data.finalUrl,type:'get',headers:{'x-csrf-token': $('meta[name="csrf-token"]').attr('content')}});
a++;
if(a==$("button[data-id]").length){
$.ajax({url:'//gamehag.com/games',type:'get',headers:{'x-csrf-token': $('meta[name="csrf-token"]').attr('content')},complete:function(){
$.ajax({url:'//gamehag.com/games/war-thunder/play',type:'get',headers:{'x-csrf-token': $('meta[name="csrf-token"]').attr('content')},complete:function(){gamehag_start(p)}});
}});
}
}
});
});
}
//gamehag开始执行
function gamehag_start(p){
addR(p,"OK");
gamehag_suryey();
$("button[data-id]").map(function(i,e){gamehag_verify(e)});
}
//gamehag问卷调查任务
function gamehag_suryey(e=1,p=0){
p!=0&&(addR(p,"OK"));
if(survey==1){
info("card-text monospace","",`正在做问卷调查任务,如果没有此任务请忽视!`);
$.ajax({url:'//gamehag.com/giveaway/click/'+$("a.giveaway-survey").attr("data-task_id"),type:'get',headers:{'x-csrf-token': $('meta[name="csrf-token"]').attr('content')}});
gamehag_verify($("a.giveaway-survey")[0],"data-task_id");
}else if(e==0){
info("","color:green",`所有任务验证完成,请手动完成验证领取key!`);
}
}
//gamehag验证任务
function gamehag_verify(e,s="data-id"){
if(/\+1/gim.test($(e).parent().parent().next().text())){
var p=info("card-text monospace","",`验证任务:${$(e).parent().parent().find("a.tooltip-trigger").clone().html()}...`);
$.ajax({
url:'//gamehag.com/api/v1/giveaway/sendtask',
type:'post',
data:'task_id='+$(e).attr(s),
headers:{'x-csrf-token': $('meta[name="csrf-token"]').attr('content')},
complete:function(XMLHttpRequest, textStatus){
if(XMLHttpRequest.status==429||/timeout/gim.test(textStatus)){
$(p).remove();
gamehag_verify(e);
}else{
var data=eval('('+XMLHttpRequest.responseText+')');
data.status=="success"?success++:error++;
var color=data.status=="success"?"green":"red";
p.innerHTML+=`${data.message}!`;
data.status=="success"&&($(e).parent().parent().parent().find("div.task-reward.tooltip-trigger").html(``));
if(/The task has not been completed/gim.test(data.message)&&autoOpen==1){
window.open('https://gamehag.com/giveaway/click/'+$(e).attr("data-id"),"_blank");
}
}
if(success+error==$("button[data-id]").length+survey){
error>0?info("","color:red",`所有任务验证完成,${error}个任务验证失败!`):info("","color:green",`所有任务验证完成,请手动完成验证领取key!`);
btn_class("btn btn-primary btn-sm box-collapse-verify");
}
}
});
}else{
success++;
if(success+error==$("button[data-id]").length+$("a.giveaway-survey").length){
error>0?info("","color:red",`所有任务验证完成,${error}个任务验证失败!`):info("","color:green",`所有任务验证完成,请手动完成验证领取key!`);
btn_class("btn btn-primary btn-sm box-collapse-verify");
}
}
}
}
if(/giveawayhopper/.test(url)){//giveawayhopper领key
btn_class("btn btn-outline-primary");
//giveawayhopper按钮定义
HCL.id("doTask").onclick=function(){
alert("点击确定后页面可能会卡一段时间,属于正常现象!");
$('button>span:contains("Join ")').click();
$('button>span:contains("Follow ")').click();
doTask(function(){
var ghBtn=$(".task-item-btn-verify");
for(var i=0;ispan:contains("Join ")').length+$('button>span:contains("Follow ")').length)*3);
};
HCL.id("Verify").onclick=function(){
alert("点击确定后页面可能会卡一段时间,属于正常现象!");
var ghBtn=$(".task-item-btn-verify");
for(var i=0;i0&&(confirm("此页面已经没有key了,是否关闭?")&&(window.close()));
!empty($(".steam-login"))&&(location.href="/steam/redirect");
btn_class("btn btn-success btn-sm");
HCL.ele({ele:"button",parent:div,class:"btn btn-round auto-task btn-theme btn-outline-dark btn-min-width mr-1 mb-1 btn-success btn-sm",title:"一键加入愿望单&关注游戏",onclick:function(){atw_fg(1)},html:"愿望单&关注"});
HCL.ele({ele:"button",parent:div,class:"btn btn-round auto-task btn-theme btn-outline-dark btn-min-width mr-1 mb-1 btn-success btn-sm",title:"一键移除愿望单&取关游戏",onclick:function(){atw_fg(0)},html:"移除愿望单&取关"});
var gameArray=[];
var gameLength=0;
var gameId=location.href.match(/[\d]+/gim)[0];
function atw_fg(a=1){
gameLength=0;
HCL.id("exInfo").style.display="block";
var p=info("","",`正在获取游戏列表`);
//console.log(gameId);
if(empty(getCookie("game"+gameId))){
$("a").map(function(i,e){
if(/Wishlist the game|press \"Follow\" button/gim.test($(e).text())){
w_f(e,a);
gameLength++;
}
});
if(a==1){
var getGame=setInterval(function(){
//console.log(gameArray);
//console.log(gameLength);
if(unique(gameArray).length>=gameLength){
var game=gameArray.join("h");
document.cookie="game"+gameId+"="+game+"; path=/";
clearInterval(getGame);
}
},1000);
}
}else{
//console.log(unique(getCookie("game"+gameId).split("h")));
unique(getCookie("game"+gameId).split("h")).map(function(i){
w_f({href:"https://store.steampowered.com/app/"+i},a);
});
}
addR(p,"OK","success");
}
function w_f(e,a){
httpSend({
mode:"gm",
url:e.href,
type:"get",
callback:function(data){
var appId=data.finalUrl.match(/[\d]+/)[0];
gameArray.push(appId);
if(data.text.indexOf('${appId}...`);
httpSend({
mode:"gm",
url:"https://store.steampowered.com/api/"+act,
type:"post",
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' },
data:`sessionid=${sessionID}&appid=${appId}`,
callback:function(data){
if(!empty(data.text)&&(data.json.success==true)){
addR(p,"OK","success");
}else{
httpSend({
mode:"gm",
url:"https://store.steampowered.com/app/"+appId,
type:"get",
callback:function(data){
if(/添加至您的愿望单/.test(data.text)){
act=="addtowishlist"?addR(p,"ERROR","err"):addR(p,"OK","success");
}else{
act=="addtowishlist"?addR(p,"OK","success"):addR(p,"ERROR","err");
}
}
});
}
}
});
}
function followGame(appId,sessionID,act){
var p=info("","",`正在${act==0?"关注":"取关"}游戏${appId}...`);
httpSend({
mode:"gm",
url:"https://store.steampowered.com/explore/followgame/",
type:"post",
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' },
data:`sessionid=${sessionID}&appid=${appId}&unfollow=${act}`,
callback:function(data){
if(!empty(data.text)&&(data.text=="true")){
addR(p,"OK","success");
}else{
httpSend({
mode:"gm",
url:"https://store.steampowered.com/app/"+appId,
type:"get",
callback:function(data){
if(data.text.indexOf(`class="btnv6_blue_hoverfade btn_medium queue_btn_active" style="">`)>-1){
act==0?addR(p,"OK","success"):addR(p,"ERROR","err");
}else{
act==0?addR(p,"ERROR","err"):addR(p,"OK","success");
}
}
});
}
}
});
}
//giveaway.su按钮定义
HCL.id("doTask").onclick=function(){
HCL.id("exInfo").style.display="block";
info("","color:yellow;background-color:black",`只会自动做加steam组和关注鉴赏家任务(需要Giveaway Helper脚本,没有则自动跳过此步骤),其他任务需手动完成!`);
if($("a.pull-right").length>0&&$("a.pull-right").parent().parent()[0].className!="hidden"){
$("a.pull-right")[0].click();
return false;
}
$('tr[data-action-id="adjs"]').remove();
$('a[data-type="link"]').attr("href","javascript:void(0)");
$('a[data-type="link"]').find("i").click();
$("a.btn-success").removeClass("disabled");
$('button>span:contains("Join ")').click();
$('button>span:contains("Follow ")').click();
doTask(function(){giveaway_su_verify($("i.glyphicon-refresh"),0)},new Date().getTime(),($('button>span:contains("Join ")').length+$('button>span:contains("Follow ")').length)*3);
};
HCL.id("Verify").onclick=function(){
HCL.id("exInfo").style.display="block";
info("","color:yellow;background-color:black",`只会循环验证任务,未完成的任务需手动完成!`);
$('tr[data-action-id="adjs"]').remove();
$('a[data-type="link"]').attr("href","javascript:void(0)");
$('a[data-type="link"]').find("i").click();
$("a.btn-success").removeClass("disabled");
giveaway_su_verify($("i.glyphicon-refresh"),0);
};
//giveaway.su验证任务
function giveaway_su_verify(vBtn,i){
if(vBtn.length==0){
$("a.btn-success").click();
}else{
if(!/glyphicon-ok/gim.test(vBtn[i].className)){
vBtn.eq(i).parent().attr("disabled");
vBtn.eq(i).parent().removeAttr("disabled");
vBtn.eq(i).parent().click();
}
i++;
setTimeout(function(){ispan:contains("Join ")').click();
$('button>span:contains("Follow ")').click();
doTask(function(){
gleam_do_task($("a.enter-link"),0);
},new Date().getTime(),($('button>span:contains("Join ")').length+$('button>span:contains("Follow ")').length)*3);
};
HCL.id("Verify").onclick=function(){
HCL.id("exInfo").style.display="block";
gleam_do_task($("a.enter-link"),0);
};
//gleam做任务+验证任务
function gleam_do_task(a,i,t=0){
if(i0){
window.open("https://www.hclonely.cn/time.html?time="+time,"_blank");
var hidden=setInterval(function(){
if(!document.hidden){
clearInterval(hidden);
setTimeout(function(){
b[0].click();
i++;
gleam_do_task(a,i);
},1000);
}
},1000);
}else{
b[0].click();
i++;
gleam_do_task(a,i);
}
}
}
if(/gamehunt/.test(url)){//gamehunt领key
$(".card-title").text()=="0"&&(confirm("此页面已经没有key了,是否关闭?")&&(window.close()));
$("a.nav-link.btn-outline-secondary").length>0&&(location.href="/auth/vkontakte");
btn_class("btn btn-outline-secondary btn-sm");
//gamehunt按钮定义
HCL.id("doTask").onclick=function(){
gamehunt(1);
};
HCL.id("Verify").onclick=function(){
gamehunt(0);
};
function gamehunt(o){
HCL.id("exInfo").style.display="block";
info("","color:yellow;background-color:black",'只会自动做"Go to"任务(可能需要多次点击才能完成所有此任务),其他任务请手动完成!');
autoOpen==1&&o==1&&(info("","color:yellow;background-color:black",'请关闭弹窗拦截,否则不会自动打开任务页面!'));
httpSend({
url:"https://gamehunt.net/end/distribution",
type:"post",
timeout:15000,
data:{id:location.href.match(/[\d]+/gim)[0]},
callback:function(data){
if(data.status==200){
if(data.json.err=="err"&&data.json.res.length>0){
$("a.btn-info[id]").css("background-color","#17a2b8");
data.json.res.map(function(e){
$("#"+e).css("background-color","red");
/Go to/gim.test($("#"+e).text())&&(visitLink(e));
if(autoOpen==1&&o==1){
if(!/Go to/gim.test($("#"+e).text())){
window.open($("#"+e).attr("href"),"_blank");
}
}
});
}else if(data.json.err=="err01"){
info("","color:red","I thought about it and I will not give you a key, since you already received it!");
}else if(data.json.err=="0"){
info("","color:green","Steam Key:"+data.json.res);
}else if(data.json.err=="01"){
info("","color:red","你已经获取过key了!");
}else if(data.json.err=="02"){
info("","color:red","已经没有key了!");
}else{
info("","color:red","未知错误码:"+data.json.err);
HCL.id("go_geme").click();
}
}
}
});
}
function visitLink(e){
var p=info("","",`正在做浏览网页任务${e}...`);
httpSend({
mode:"gm",
type:"get",
url:$("#"+e).attr("href")
});
httpSend({
mode:"gm",
type:"get",
url:$("#"+e).attr("href").match(/to\=[\w\W]*?\&/)[0].replace(/to\=|\&/gi,"").replace("http:","https:"),
callback:function(data){
$("#"+e).css("background-color","#17a2b8");
addR(p,"ok","success");
}
});
}
}
if(/orlygift/.test(url)){//orlygift
/login/gim.test($(".navbar-right").text())&&(location.href="https://www.orlygift.com/steam_connect");
btn_class("btn btn-block btn-info");
//防止广告弹窗
var expireDate = new Date();
expireDate.setDate(expireDate.getDate() + 7);
document.cookie='bounceback-visited-user=1;expires='+expireDate+'path=/';
//orlygift按钮定义
HCL.id("doTask").onclick=function(){
HCL.id("exInfo").style.display="block";
info("","color:yellow;background-color:black","安装app和邀请好友任务不会自动完成!");
var ogTaskId=og_get_id();
og_do_task(ogTaskId,0);
}
HCL.id("Verify").onclick=function(){
HCL.id("exInfo").style.display="block";
var ogTaskId=og_get_id();
og_verify(ogTaskId,0);
}
//orlygift获取任务id
function og_get_id(){
var ogTaskBtn=$("button.btn-block.btn-info[id]").not(".ng-hide").not(".auto-task");
var ogTaskId=[];
ogTaskBtn.map(function(i,e){!/(install.*?app)|(Invite your friends)/gim.test($(e).parent().parent().text())&&(ogTaskId.push($(e).attr("id").replace("task-","")))});
return ogTaskId;
}
//orlygift做任务
function og_do_task(ogTaskId,i){
if(idiv>p").find("a").map(function(i,e){
var promo=$(e);
if(!promo.hasClass("buttonentered")){
var p=info("","",`正在做任务:${$(e).parents("p").text()}...`);
if(/facebookpromo|twitterpromo|visitpromo/gim.test(e.className)){
$.ajax({
type: "POST", url: urlPath("/giveaways/ajax/"+(promo.hasClass("facebookpromo") ? "facebookpromo" : (promo.hasClass("twitterpromo") ? "twitterpromo" : "visitpromo"))+"/"+id[0]), timeout: 60000, dataType: "json",
data: {ajax: "t"},
error: function(response, error, exception) {
addR(p,"An error has occurred performing the action requested. Please try again shortly.","err");
},
success: function(response) {
if(response["success"]) {
addR(p,response["text"]);
promo.addClass("buttonentered").closest("p").html(promo.closest("p").find("span").html());
} else {
addR(p,response["text"],"err");
}
}
});
}else if(promo.hasClass("emailoptinpromo")){
$.ajax({
type: "POST", url: urlPath("/newsletter/ajax/subscribeprofile/optin/"+id[1]), timeout: 60000, dataType: "json",
data: {ajax: "t",emailsystoggle: 4},
error: function(response, error, exception) {
addR(p,"An error has occurred performing the action requested. Please try again shortly.","err");
},
success: function(response) {
if(response["success"]) {
addR(p,response["text"]);
promo.toggleClass("buttonentered").closest("p").html(promo.closest("p").find("span").html());
} else {
addR(p,response["text"],"err");
}
}
});
}else if(promo.hasClass("watchingpromo")){
var data=getUrlQuery($(e).attr("href"));
data.ajax="t";
$.ajax({
type: "POST", url: urlPath($(e).attr("href").replace(/\?.*/,"")), timeout: 60000, dataType: "json",
data: data,
error: function(response, error, exception) {
addR(p,"An error has occurred performing the action requested. Please try again shortly.","err");
},
success: function(response) {
if(response["success"]) {
addR(p,response["text"]);
promo.toggleClass("buttonentered").closest("p").html(promo.closest("p").find("span").html());
$(e).saveUpdate("watch", giveawayWatch);
$(e).addClass("buttonentered");
} else {
addR(p,response["text"],"err");
}
}
});
}else if(!/the-challenge-of-adblock/gim.test($(e).attr("href"))){//watchingpromo
$.ajax({
type: "POST", url: urlPath($(e).attr("href")), timeout: 60000, dataType: "json",
data: {ajax: "t"},
error: function(response, error, exception) {
addR(p,"An error has occurred performing the action requested. Please try again shortly.","err");
},
success: function(response) {
if(response["success"]) {
addR(p,response["text"]);
promo.toggleClass("buttonentered").closest("p").html(promo.closest("p").find("span").html());
} else {
addR(p,response["text"],"err");
}
}
});
}else{
addR(p,"此任务为花钱订阅任务,脚本自动跳过!","info");
}
}else{
info("","",`正在做任务:${$(e).parents("p").text()}...ok`);
}
});
info("","color:yellow;background-color:black","所有任务验证完成,没有完成的任务请手动完成!");
}else{
info("","color:red","获取id失败,请重试!")
}
}
}
if(/spoune/.test(url)){//spoune领key
//$("#loginRightTop").length>0&&(window.open("https://www.spoune.com/login.php","_self"));
//$("#keysAvailable").text()==0&&(confirm("此页面已经没有key了,是否关闭?")&&(window.close()));
btn_class("ui big inverted download button");
HCL.id("doTask").onclick=function(){
HCL.id("exInfo").style.display="block";
spoune_get_task();
};
HCL.id("Verify").onclick=function(){
HCL.id("exInfo").style.display="block";
spoune_get_task();
};
//spoune获取任务信息
function spoune_get_task(){
if($("#GiveawayTasks>button.grey").length!=$("#submain3").text()-$("#submain1").text()){
objFrame.objCurrentScriptObject.loadTaskOverview('GiveawayTasks');
var getButton=setInterval(function(){
if($("#GiveawayTasks>button.grey").length==$("#submain3").text()-$("#submain1").text()){
clearInterval(getButton);
show_task($("#GiveawayTasks>button.grey"),0);
}
},1000);
}else{
show_task($("#GiveawayTasks>button.grey"),0);
}
}
//spoune显示任务详情
function show_task(e,i){
if(i0){
clearInterval(getIframe);
spoune_verify(e,i);
}
},1000);
}else{
info("","color:yellow;background-color:black","所有任务验证完成,没有完成的任务请手动完成!");
objFrame.objCurrentScriptObject.loadTaskOverview('GiveawayTasks');
$("#GiveawayBackButton")[0].style.visibility="hidden";
}
}
//spoune验证任务
function spoune_verify(t,i,e=0){
var p=info("","","正在验证任务:"+$(t).eq(i).text()+"...");
httpSend({
type:"get",
url:$("iframe").contents().find("#link").attr("href").replace("./","./werbung/"),
callback:function(data){
if(data.status==200){
if(/Task completed/gim.test(data.text)){
addR(p,"ok");
e=1;
}else{
$("iframe").contents().find("html").html(data.text);
e==0?setTimeout(function(){
$(p).remove();
spoune_verify(t,i,1);
},1500):addR(p,"error","err");
}
}else{
e==0?setTimeout(function(){
$(p).remove();
spoune_verify(t,i,1);
},1500):addR(p,`error:${data.status}`,"err");
}
e==1&&(show_task(t,++i));
}
});
}
}
//if(/chubbykeys/.test(url)){//chubbykeys领key
/*
if($("button.btn-lg.hvr-grow-rotate").length>0){
location.href="?login";
}
btn_class("btn btn-outline-primary");
//chubbykeys按钮定义
HCL.id("doTask").onclick=function(){
HCL.id("exInfo").style.display="block";
$('button>span:contains("Join ")').click();
$('button>span:contains("Follow ")').click();
doTask(function(){
},new Date().getTime(),($('button>span:contains("Join ")').length+$('button>span:contains("Follow ")').length)*3);
};
HCL.id("Verify").onclick=function(){
};
}
*/
//做加组、关注等任务
function doTask(callback,time,limitTime){
$('button>span:contains("Join ")').length+$('button>span:contains("Follow ")').length==0||new Date().getTime()-time>limitTime*1000?callback():setTimeout(function(){doTask(callback,time,limitTime)},300);
}
//做退组、取关等任务
HCL.id("Remove").onclick=function(){
HCL.id("exInfo").style.display="block";
info("","",`正在退组、取关,请稍候!`);
$('button>span:contains("Leave ")').click();
$('button>span:contains("Unfollow ")').click();
};
//显示信息
function info(cText,sText,iText){
var p=HCL.ele({ele:"p","class":cText,"style":sText,html:iText,parent:div2});
p.scrollIntoView();
return p;
}
//任务执行结果
function addR(p,t,r="success"){
switch(r){
case "success":
p.innerHTML+=`${t}`;
break;
case "info":
p.innerHTML+=`${t}`;
break;
case "err":
p.innerHTML+=`${t}`;
break;
default:
p.innerHTML+=`${t}`;
break;
}
}
//button样式
function btn_class(e){
var task_btn=HCL.class("auto-task");
for(var tb=0;tb