🏠 Home 

GiveAway精灵

GiveAway精灵,2步#Key


Install this script?
  1. // ==UserScript==
  2. // @name GiveAway精灵
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1
  5. // @description GiveAway精灵,2步#Key
  6. // @author Chuck
  7. // @include *giveaway.su/giveaway/view/*
  8. // @include *store.steampowered.com/curator/*
  9. // @include *store.steampowered.com/app/*
  10. // @include *store.steampowered.com/account/registerkey*
  11. // @include *discordapp.com/invite*
  12. // @include *www.youtube.com/channel/*
  13. // @include *steamcommunity.com/groups/*
  14. // @include *twitter.com/*
  15. // @grant none
  16. // ==/UserScript==
  17. (function() {
  18. var autoClose = 1;//1为自动关闭,0为不自动关闭,会生效在鉴赏家,愿望单,还有discord页面
  19. //var autoTask = 1;// 待开发;1为开启自动任务,0为不开启,开启时,会自动点击所有任务的链接
  20. var url = window.location.href;
  21. function checkUrl(str){
  22. return(url.indexOf(str)!=-1)
  23. }
  24. function closeThisWeb(){
  25. if(autoClose)
  26. setTimeout(function(){
  27. window.opener=null;
  28. window.open('','_self');
  29. window.close()
  30. },5000);
  31. }
  32. function c(str){
  33. console.log(str);
  34. }
  35. function loadCssCode(code){
  36. var style = document.createElement('style');
  37. style.type = 'text/css';
  38. style.rel = 'stylesheet';
  39. try{
  40. //for Chrome Firefox Opera Safari
  41. style .appendChild(document.createTextNode(code));
  42. }catch(ex){
  43. //for IE
  44. style.styleSheet.cssText = code;
  45. }
  46. var head = document.getElementsByTagName('head')[0];
  47. head.appendChild(style);
  48. }
  49. if(checkUrl("registerkey")){
  50. //steam礼包自动兑换确认
  51. c("steam礼包自动兑换确认");
  52. document.querySelector("#purchase_confirm_ssa input").checked=true;
  53. RegisterProductKey();
  54. }
  55. else if(checkUrl("curator")){
  56. //Steam鉴赏家自动关注
  57. c(" Steam鉴赏家自动关注");
  58. document.querySelector(".follow_controls>div>span~span").click();
  59. closeThisWeb()
  60. }
  61. else if(checkUrl("groups")){
  62. //Steam 自动进组
  63. c(" Steam 自动进组");
  64. try{
  65. document.forms['join_group_form'].submit();
  66. }catch(err){ }
  67. closeThisWeb()
  68. }
  69. else if(checkUrl("giveaway/view")){
  70. //Giveaway 自动检查状态,强制按钮可用
  71. c(" Giveaway 自动检查状态,强制按钮可用");
  72. setInterval(function(){$("td>button").map(function(i,v){v.click()}); $("#getKey a").removeClass("disabled");},5000)
  73. //让discord的标签更明显
  74. loadCssCode('.mdi-discord{ border: 3px solid #00e8de; color: #00e8de;}');
  75. //隐藏不需要点击的打开网页任务
  76. setTimeout(function(){
  77. $(".glyphicon-share-alt").parent().parent().parent().hide();
  78. try{
  79. $(".giveaway-key div").show()
  80. }catch(err){ }
  81. },3000)
  82. //待开发,存在问题:自动做任务
  83. //if(autoTask){
  84. //$("#actions a").map(function(i,v){window.open(v.href)});
  85. //}
  86. }
  87. else if(checkUrl("store.steampowered.com/app")){
  88. //steam 自动关注与添加愿望单
  89. //自动绕过年龄限制
  90. c(" Giveaway 自动关注与添加愿望单");
  91. try{
  92. $(ageYear).value=1991;
  93. DoAgeGat###bmit();
  94. }catch(err){ }
  95. try{
  96. document.querySelector("#add_to_wishlist_area a").click();
  97. document.querySelector(".queue_btn_follow div").click()
  98. }catch(err){ }
  99. closeThisWeb()
  100. }
  101. else if(checkUrl("discordapp")){
  102. //discordapp自动接受邀请
  103. c(" discordapp自动接受邀请");
  104. setTimeout(function(){
  105. document.querySelector("button").click();
  106. },3000)
  107. closeThisWeb();
  108. }
  109. else if(checkUrl("twitter.com")){
  110. //twitter自动关注
  111. c(" twitter自动关注");
  112. setTimeout(function(){
  113. $(".follow-text")[0].click()
  114. },3000)
  115. closeThisWeb();
  116. }
  117. else if(checkUrl("www.youtube.com/channel")){
  118. //youtube自动关注
  119. c(" youtube自动关注");
  120. document.querySelector("#confirm-button").click()
  121. closeThisWeb();
  122. }
  123. // else if(checkUrl("")){
  124. //
  125. // }
  126. })();