Greasy Fork 还支持 简体中文。

哥特LOLI网站小辅助

哥特loli自动签到等等

目前為 2022-01-24 提交的版本,檢視 最新版本

// ==UserScript==
// @name         哥特LOLI网站小辅助
// @namespace    Sheepherder
// @version      1.1.3
// @description  哥特loli自动签到等等
// @author       Sheepherder
// @match        https://www.gtloli.gay/*
// @include      https://www.gtloli.gay/*
// @icon         https://q1.qlogo.cn/g?b=qq&nk=862223989&s=140
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_notification
// @grant        GM_info
// @grant        GM_addStyle
// @grant        GM_xmlhttpRequest
// @grant        GM_addElement
// @grant        GM_registerMenuCommand
// @grant        GM_openInTab
// @grant        GM_download
// @grant        GM_getResourceText
// @grant        unsafeWindow
// @grant        GM_setClipboard
// @grant        GM_deleteValue
// @grant        GM_unregisterMenuCommand
// @require      https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js
// ==/UserScript==


(function () {
  'use strict';
  if (document.querySelector('.logout')) {
    const formhash = document.querySelector('.logout').href.split('&')[2].split('=')[1];
    const flag = "1";
    GM_setValue('flag', flag);
    if (formhash != GM_getValue('formhash')) {
      GM_setValue('formhash', formhash); //用GM_setValue当全局变量
      GM_setValue('flag', "0");
    }
    const day = new Date().getDay();
    if (day!=GM_getValue('day')||GM_getValue('flag')==="0") {
      GM_setValue('day', day); //用GM_setValue当全局变量
      signIn();
      showPage();
      signin();
    }
    else{
      console.log("该账号今天已经签过到了");
      console.log("该账号今天已经完成了VIP任务");
      console.log("该账号今天已经访问了10个人了");
    }
    console.log(formhash);
    addBtns();
  }
})();


//每日签到
function signin(){
  const http = new XMLHttpRequest();
  http.open('GET', "https://www.gtloli.gay/plugin.php?id=k_misign:sign&operation=qiandao&formhash="+GM_getValue('formhash')+"&format=empty");
  http.send();
  console.log("签到完成");
}

//每天一次VIP任务
function signIn() {
  const pc = {
    id: 'pc',
    name: '胖次',
    applyUrl: 'https://www.gtloli.gay/home.php?mod=task&do=apply&id=32',
    drawUrl: 'https://www.gtloli.gay/home.php?mod=task&do=draw&id=32',
  };
  const gtb = {
    id: 'gtb',
    name: 'GT币',
    applyUrl: 'https://www.gtloli.gay/home.php?mod=task&do=apply&id=33',
    drawUrl: 'https://www.gtloli.gay/home.php?mod=task&do=draw&id=33',
  };
  const pcLocal = localStorage.getItem('pc');
  if (pcLocal) get(pc);
  const gtbLocal = localStorage.getItem('gtb');
  if (gtbLocal) get(gtb);
}

function get(data) {
  const http = new XMLHttpRequest();
  http.open('GET', data.applyUrl);
  http.send();
  http.onreadystatechange = (e) => {
    if (e.target.status === 200) {
      http.open('GET', data.drawUrl);
      http.send();
      http.onreadystatechange = (event) => {
        if (event.target.status === 200) {
          localStorage.setItem(data.id, 'true');
          console.log(data.name + '领取成功!');
          http.open('GET', 'https://www.gtloli.gay/home.php?mod=space&do=notice&view=system');
          http.send();
        }
      };
    }
  };
}

//低保,访问10人空间
function showPage() {
  const users = [
    'https://www.gtloli.gay/home.php?mod=space&uid=1',
    'https://www.gtloli.gay/home.php?mod=space&uid=687195',
    'https://www.gtloli.gay/home.php?mod=space&uid=250669',
    'https://www.gtloli.gay/home.php?mod=space&uid=455571',
    'https://www.gtloli.gay/home.php?mod=space&uid=596234',
    'https://www.gtloli.gay/home.php?mod=space&uid=828725',
    'https://www.gtloli.gay/home.php?mod=space&uid=831814',
    'https://www.gtloli.gay/home.php?mod=space&uid=911716',
    'https://www.gtloli.gay/home.php?mod=space&uid=644482',
    'https://www.gtloli.gay/home.php?mod=space&uid=911905',
    'https://www.gtloli.gay/home.php?mod=space&uid=936765',
  ];
  users.forEach((v, i) => {
    const http = new XMLHttpRequest();
    http.open('GET', v);
    http.send();
    if (i === users.length - 1) {
      localStorage.setItem('ten', 'true');
      console.log('已查看10人主页!');
    }
  });
};

function addBtns() {
  // 在打boss页面激活
  if (location.href.match(`id=zgxsh_assassin:boss`)) {
    const xs0 = document.querySelector('.xs0');
    const mnoutbox = document.querySelectorAll('.mnoutbox');
    let btn0 = genButton('立即加入', addIn); //设置名称和绑定函数
    xs0.insertBefore(btn0, mnoutbox[1]); //添加按钮到指定位置
    addin();
  }
  function genButton(text, foo, id) {
    let b = document.createElement('button'); //创建类型为button的DOM对象
    b.textContent = text; //修改内部文本为text
    b.style.cssText = 'margin: 0px 15px 10px 60px; float: middle;' //添加样式(margin可以让元素间隔开一定距离)
    b.addEventListener('click', foo); //绑定click的事件的监听器
    if (id) {
      b.id = id;
    } //如果传入了id,就修改DOM对象的id
    return b; //返回修改好的DOM对象
  }
};

function addIn() {
  const http = new XMLHttpRequest();
  http.open('GET', "https://www.gtloli.gay/plugin.php?id=zgxsh_assassin:boss_if&op=boss_add&formhash="+GM_getValue('formhash'));
  http.send();
}
//检查是否满血
function addin() {
  let temp = document.querySelector('.layui-progress.layui-progress-big>p');
  let temp0=temp.textContent.split(" ")[1].split("/")[0];
  let temp1=temp.textContent.split(" ")[1].split("/")[1];
  if(temp0==temp1){
  const http = new XMLHttpRequest();
  http.open('GET', "https://www.gtloli.gay/plugin.php?id=zgxsh_assassin:boss_if&op=boss_add&formhash="+GM_getValue('formhash'));
  http.send();
  console.log("已经加入,不要刷新页面,会重复扣钱");
  }
}