// ==UserScript== // @name KeyJoker Auto Task // @namespace KeyJokerAutoTask // @version 1.6.1 // @description KeyJoker Auto Task Script // @description:zh-cn KeyJoker 的任务自动化脚本 // @author 祭夜 // @icon https://www.jysafe.cn/assets/images/avatar.jpg // @match *://www.keyjoker.com/entries* // @match *://assets.hcaptcha.com/* // @match https://www.twitch.tv/settings/profile?keyjokertask=* // @match https://twitter.com/settings/account?keyjokertask=* // @match http://localhost:3001* // @match https://msojocs.github.io/keyjoker-script* // @supportURL https://greasyfork.org/zh-CN/scripts/406476-keyjoker-auto-task/feedback // @homepage https://github.com/msojocs/keyjoker-script/ // @run-at document-start // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @grant GM_addStyle // @grant GM_xmlhttpRequest // @grant GM_setClipboard // @grant GM_setValue // @grant GM_getValue // @grant GM_listValues // @grant GM_deleteValue // @grant GM_openInTab // @grant GM_log // @grant GM_notification // @grant GM_getResourceText // @connect hcaptcha.com // @connect store.steampowered.com // @connect steamcommunity.com // @connect twitter.com // @connect facebook.com // @connect discord.com // @connect twitch.tv // @connect tumblr.com // @connect spotify.com // @connect task.jysafe.cn // @connect raw.fastgit.org // @connect 127.0.0.1 // @resource iconfont https://at.alicdn.com/t/font_3156299_07qky93uxv0e.css // @require https://lib.baomitu.com/jquery/3.3.1/jquery.min.js // @require https://lib.baomitu.com/i18next/21.3.0/i18next.min.js // @require https://lib.baomitu.com/jquery-i18next/1.2.1/jquery-i18next.min.js // @require https://unpkg.com/i18next-http-backend@1.3.2/i18nextHttpBackend.min.js // @require https://cdn.jsdelivr.net/gh/msojocs/keyjoker-script@9a84040672898ece9d677e72c7617f95d7c92c86/keyjoker.ext.js // @downloadURL https://update.greasyfork.icu/scripts/406476/KeyJoker%20Auto%20Task.user.js // @updateURL https://update.greasyfork.icu/scripts/406476/KeyJoker%20Auto%20Task.meta.js // ==/UserScript== // @require http://task.jysafe.cn/keyjoker/script/keyjoker6.ext.js (function() { 'use strict'; const debug = false; const languagePrefix = "https://cdn.jsdelivr.net/gh/msojocs/keyjoker-script@master/locales" const KJConfig = GM_getValue('KJConfig') || { language: navigator.language } // iconfont GM_addStyle(GM_getResourceText('iconfont')) const discordAuth = GM_getValue('discordAuth') || { enable: false, authorization: "", status:0, updateTime: 0 } // steam信息 const steamConfig = GM_getValue('steamInfo') || { userName: '', steam64Id: '', communitySessionID: '', storeSessionID: '', comUpdateTime: 0, storeUpdateTime: 0 } const twitchConfig = GM_getValue('twitchAuth') || { "auth-token": "", status:0, updateTime: 0 } const twitterConfig = GM_getValue('twitterAuth') || { authorization: "AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA", ct0: '', status: 0, updateTime: 0 } const ignoreList = GM_getValue('ignoreList') || []; const jq = $; const kjData = offlineData; unsafeWindow.jq = jq let completeCheck = null; // 监听处理器hook window.pro_elt_addEventListener=Element.prototype.addEventListener; Element.prototype.addEventListener=function(){ if(!this.eventList) this.eventList={}; if(!this.eventList[arguments[0]]) this.eventList[arguments[0]]=[]; this.eventList[arguments[0]].push(arguments[1]); // fix dropdown if(this.id === 'user-dropdown' && this.eventList?.click?.length === 1)return; window.pro_elt_addEventListener.apply(this,arguments); }; // 0-未动作|200-成功取得|401未登录|603正在取得 const getAuthStatus = { discord: false, spotify: false, steamStore: 0, steamCom: 0, // tumblr: false, twitch: false, twitter: 0 } var checkSwitchId = null; const noticeFrame = { loadFrame: ()=>{ log.log("loadFrame"); jq('body').append(`