twitch自動點擊獎勵

自動點擊50獎勵

Version vom 22.08.2020. Aktuellste Version

  1. // ==UserScript==
  2. // @name twitch自動點擊獎勵
  3. // @namespace http://tampermonkey.net/
  4. // @version 2.8
  5. // @description 自動點擊50獎勵
  6. // @author 聖冰如焰
  7. // @match https://www.twitch.tv/*
  8. // @grant none
  9. // @license BY-NC-SA 3.0 TW
  10. // ==/UserScript==
  11.  
  12. let style = document.createElement("style");
  13. style.textContent = `
  14. .self{
  15. padding : 0 10px 0 10px;
  16. align-items: center!important;
  17. position: relative;
  18. }
  19. .self:hover{
  20. background-color: rgba(0,0,0,.05);
  21. }
  22. .self::before{
  23. content: '';
  24. }
  25. .self:hover::before{
  26. content: '自動領取獎勵數';
  27. user-select: none;
  28. background-color: #040109;
  29. border-radius: 4px;
  30. color: #fff;
  31. font-size: 1.2rem;
  32. font-weight: 600;
  33. right: 0;
  34. line-height: 1.2;
  35. padding: 3px 6px;
  36. padding-top: 3px;
  37. padding-right: 6px;
  38. padding-bottom: 3px;
  39. padding-left: 6px;
  40. pointer-events: none;
  41. position: absolute;
  42. text-align: left;
  43. user-select: none;
  44. white-space: nowrap;
  45. z-index: 2000;
  46. top: 50%;
  47. transform: translate(110%,-50%);
  48. }
  49. `;
  50. let bool = true;
  51. let get_coin = 0;
  52. let x = document.cookie.split(" ").map(e=>{return e.split("=")});
  53. x.forEach(e => {
  54. if (e[0] == "gift"){
  55. get_coin = parseInt(e[1].split(";")[0]);
  56. bool = false;
  57. }
  58. return false;
  59. });
  60. if (bool) document.cookie = `gift=${0}; path=${location.pathname};expires=${new Date(+new Date()+31536000000).toString()}`;
  61. document.head.append(style);
  62. let button = document.createElement("button");
  63. button.className = "self";
  64. let timeout = 50;
  65. (function get_coins(){
  66. timeout = 50;
  67. if (document.getElementsByClassName("tw-flex tw-flex-row").length == 3 && document.getElementsByClassName("self").length == 0){
  68. button.textContent = (get_coin).toLocaleString();
  69. document.getElementsByClassName("tw-flex tw-flex-row")[1].after(button);
  70. }
  71. if(document.getElementsByClassName("tw-button tw-button--success tw-interactive")[0] != undefined){
  72. document.getElementsByClassName("tw-button tw-button--success tw-interactive")[0].click();
  73. get_coin += 50;
  74. button.textContent = (get_coin).toLocaleString();
  75. document.cookie = `gift=${get_coin}; path=${location.pathname};expires=${new Date(+new Date()+31536000000).toString()}`;
  76. timeout = 600000;
  77. console.log(new Date,get_coin);
  78. }
  79. setTimeout(get_coins,timeout)
  80. })()