Kiosk 자동 국룰/다운

Kiosk 자동 국룰 입력

当前为 2024-05-27 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Kiosk 자동 국룰/다운
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2
  5. // @description Kiosk 자동 국룰 입력
  6. // @author 김머시기
  7. // @match https://kiosk.ac/c/*
  8. // @match https://arca.live/b/simya*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=kioskloud.ac
  10. // @grant GM.setValue
  11. // @grant GM.getValue
  12. // @license MIT
  13. // @run-at document-end
  14. // ==/UserScript==
  15. 'use strict';
  16. let rp;
  17. const rpw = atob("c21wZW9wbGU=");
  18. async function m(){
  19. rp = await GM.getValue("rp")
  20. if(rp != rpw) {
  21. const chk = prompt("국룰 확인");
  22. if(chk?.toLowerCase() == rpw) {
  23. GM.setValue("rp", rpw);
  24. } else {
  25. GM.setValue("rp", false);
  26. alert("국룰이 일치하지 않습니다.");
  27. }
  28. }
  29. }
  30. function pw() {
  31. document.querySelector('.input.shadow-xl.flex-grow').value = rpw;
  32. document.querySelector('.btn.btn-ghost.w-full.mt-2.rounded-md').click();
  33. }
  34. function pw1() {
  35. document.querySelector('.input.shadow-xl.flex-grow').value = "#"+rpw+"#";
  36. document.querySelector('.btn.btn-ghost.w-full.mt-2.rounded-md').click();
  37. }
  38. function dbtn() {
  39. let downButton = document.querySelector('.p-2 li:last-child button');
  40. downButton.click();
  41. }
  42. m();
  43. async function auto() {
  44. if(rp==rpw){
  45. await pw();
  46. await setTimeout(pw1,800);
  47. await setTimeout(dbtn,2500);
  48. }
  49. }
  50. function doDecode() {
  51. const article = document.querySelector("body div.article-body > div.fr-view.article-content");
  52. function dec(reg) {
  53. try {
  54. while (reg.test(article.innerHTML)) {
  55. let decoded = reg.exec(article.innerHTML)[0];
  56. while (decoded.match(/aHR0c[0-9A-Za-z+/-]{8,}[=]{0,2}/) == null) {
  57. decoded = atob(decoded);
  58. }
  59. decoded = atob(decoded); console.log(decoded);
  60. article.innerHTML = article.innerHTML.replace(reg, `<a href=${decoded} target='_blank' rel='noreferrer'>${decoded}</a>`);
  61. }
  62. } catch(i) {
  63. console.log(i,article);
  64. }
  65. }
  66. dec(/aHR0c[0-9A-Za-z+/-]{20,}[=]{0,2}/);
  67. dec(/YUhSMGN[0-9A-Za-z+/-]{80,}[=]{0,2}/);
  68. dec(/[0-9A-Za-z+/-]{30,}[=]{1,2}/);
  69. dec(/[0-9A-Za-z+/-]{200,}[=]{0,2}/);
  70. }
  71.  
  72. const currentHost = document.URL.split("/")[2];
  73. if(currentHost === "arca.live") {
  74. doDecode();
  75. } else {
  76. setTimeout(auto, 100);
  77. }