// ==UserScript== // @name 我的世界梦想之都自动签到 // @namespace http://www.mxzd.games/ // @version 1.0.5 // @description 我的世界梦想之都服务器 - MC找服网签到 MC百科签到 苦力怕论坛签到 苦力怕论坛回复 // @author 乔木真言 // @license Apache License 2.0 // @match *://*/* // @icon https://www.google.com/s2/favicons?sz=64&domain=juejin.cn // @grant GM_registerMenuCommand // @grant GM_setValue // @grant GM_getValue // @grant GM_openInTab // @run-at document-idle // @downloadURL none // ==/UserScript== (function () { ("use strict"); // Your code here... // 签到网站 const H_zfw = "https://www.fansmc.com/server/731.html"; const H_bk = "https://play.mcmod.cn/sv20186914.html"; // const H_klpqd = "https://klpbbs.com/k_misign-sign.html"; // const H_klphf = // "https://klpbbs.com/forum.php?mod=viewthread&tid=67975&extra=page%3D1&page=1"; const H_MxzdHD = "http://www.mxzd.games/activity.html"; // 获取浏览器地址进行判断 var host = window.location.host; // 菜单按钮 GM_registerMenuCommand("自动签到", auto, "h"); // 进入浏览器自动执行签到 window.onload = autoBtn(); function auto() { GM.openInTab(H_zfw); GM.openInTab(H_bk); GM.openInTab(H_MxzdHD, { active: true }); // window.open(H_klpqd); // window.open(H_klphf); } function autoBtn() { // 判断是否是找服网 if (host.indexOf("fansmc") > -1) { // 判断登录没登陆 var zfwSignStatus = document.getElementsByClassName("dropdown"); var zfwSignText = zfwSignStatus[2].innerText; // 登录判断 if (!(zfwSignText.indexOf("登录") > -1)) { const btns = document.querySelectorAll(".btn-group"); const btna = btns[2].getElementsByTagName("a"); btna[0].click(); GM_setValue("Gzfw", true); } else { GM_setValue("Gzfw", false); // alert("找服网未登录,无法点赞,请登录"); } //判断是不是MC百科 } else if (host.indexOf("mcmod") > -1) { var bkSignText = document.querySelector(".header-user").innerText; // 登录判断 if (!(bkSignText.indexOf("登录") > -1)) { const bkbtn = document.querySelector(".thumbup"); const masterup = document.querySelector(".masterup"); bkbtn.click(); if (masterup) { setTimeout(() => { masterup.click(); }, 2000); } GM_setValue("Gbk", true); } else { GM_setValue("Gbk", false); // alert("MC百科未登录,无法点赞,请登录"); } } /* else if (host.indexOf('klpbbs.com') > -1) { //苦力怕回帖 const text = document.getElementById("fastpostmessage"); const textBtn = document.getElementById("fastpostsubmit"); if (text) { text.value = "一起来玩吧,欢迎大家"; textBtn.click(); } // 苦力怕签到 const klpqd = document.querySelector(".lineB .qdleft .btn"); if (klpqd) { klpqd.click(); } } */ if (host.indexOf("mxzd.games") > -1) { // 检查弹窗状态的函数 // 在页面加载时调用检查弹窗状态的函数 checkPopupStatus(); } function checkPopupStatus() { // 获取当前日期 const currentDate = new Date().toDateString(); // 从本地存储中获取弹窗状态标记 const popupStatus = localStorage.getItem("popupStatus"); // 如果标记不存在或者标记表示上一次弹窗是在前一天 if (!popupStatus || popupStatus !== currentDate) { // 显示弹窗 displayPopup(); // 更新本地存储中的标记为当前日期 localStorage.setItem("popupStatus", currentDate); } } // 显示弹窗的函数 function displayPopup() { // 签到成功提示 var bkqdVal = GM_getValue("Gbk"); var zfwqdVal = GM_getValue("Gzfw"); // 在这里编写显示弹窗的逻辑,可以是通过修改 DOM 元素显示弹窗,或者调用自定义的弹窗组件等 var now = new Date(); var nowTime = now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate(); if (bkqdVal && zfwqdVal) { alert( "百科,找服网,你今日已点赞 截取此弹窗发送至Q群@服主即可获得奖励,时间" + nowTime ); } else { alert("未能成功点赞,请检查找服网和MC百科是否都已经登录"); } } } })();