Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
- 修复 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
HCLonely committed May 3, 2021
1 parent 31448e8 commit c7c403f
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 29 deletions.
2 changes: 1 addition & 1 deletion auto-task-helper.user.js
Expand Up @@ -3,7 +3,7 @@
// @name:en Auto Task Helper
// @name:zh-CN 自动任务辅助
// @namespace auto-task-helper
// @version 3.5.7
// @version 3.5.8
// @description 自动任务脚本的辅助脚本,用于获取discord auth
// @description:en Auxiliary script of automatic task script, used to obtain discord auth
// @description:zh-CN 自动任务脚本的辅助脚本,用于获取discord auth
Expand Down
38 changes: 28 additions & 10 deletions auto-task-test.user.js
Expand Up @@ -3,7 +3,7 @@
// @name:en Auto Task Test
// @name:zh-CN 自动任务 Test
// @namespace auto-task
// @version 3.5.7
// @version 3.5.8
// @description 自动完成赠key站任务
// @description:en Automatically complete giveaway tasks
// @description:zh-CN 自动完成赠key站任务
Expand Down Expand Up @@ -37,8 +37,8 @@
// @include https://auto-task-test.hclonely.com/setting.html
// @include https://auto-task-test.hclonely.com/notice-list.html

// @require https://cdn.jsdelivr.net/gh/HCLonely/auto-task@3.5.7/require/require.min.js#md5=68007d36810a2097bd1e638b54bea766
// @resource CSS https://cdn.jsdelivr.net/gh/HCLonely/auto-task@3.5.7/require/fuck-task.min.css#md5=9d0ff55f65f10782c682f6c9a917aa6f
// @require https://cdn.jsdelivr.net/gh/HCLonely/auto-task@3.5.8/require/require.min.js#md5=68007d36810a2097bd1e638b54bea766
// @resource CSS https://cdn.jsdelivr.net/gh/HCLonely/auto-task@3.5.8/require/fuck-task.min.css#md5=a9d18bf747e71f3267da29d4abebd7f6

// @grant GM_setValue
// @grant GM_getValue
Expand Down Expand Up @@ -922,7 +922,7 @@ try {
break
}

userCountryCurrency = (_data$responseText$ma5 = data.responseText.match(/a class="inactive_selection".*?id="(.+?)"/)) === null || _data$responseText$ma5 === void 0 ? void 0 : _data$responseText$ma5[1]
userCountryCurrency = (_data$responseText$ma5 = data.responseText.match(/<input id="usercountrycurrency".*?value="(.+?)"/)) === null || _data$responseText$ma5 === void 0 ? void 0 : _data$responseText$ma5[1]
country = _toConsumableArray(data.responseText.matchAll(/<div class="currency_change_option .*?" data-country="(.+?)" >/g)).map(function (e) {
return e[1]
})
Expand Down Expand Up @@ -6233,9 +6233,11 @@ try {

try {
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
var _GM_getValue2

var item = _step9.value

if (item.link === taskInfo.link) {
if (((_GM_getValue2 = GM_getValue('delayNotice-' + item)) === null || _GM_getValue2 === void 0 ? void 0 : _GM_getValue2.link) === window.location.href) {
return
}
}
Expand Down Expand Up @@ -6277,6 +6279,21 @@ try {
}
}

var neverNotice = function neverNotice (time) {
try {
var item = GM_getValue('delayNotice-' + time)
item.neverNotice = !item.neverNotice
GM_setValue('delayNotice-' + time, item)
var btn = $('[data-time='.concat(time, ']'))
btn.toggleClass('btn-primary').toggleClass('btn-outline-primary')
var svgPath = btn.find('path')
var svgColor = svgPath.attr('fill')
svgPath.attr('fill', svgColor === '#fff' ? '#1296db' : '#fff')
} catch (e) {
throwError(e, 'neverNotice')
}
}

var notice = function notice (options, callback) {
try {
var defaultOptions = {
Expand Down Expand Up @@ -7428,7 +7445,8 @@ try {
delay: delay,
addDelayNotice: addDelayNotice,
deleteDelayNotice: deleteDelayNotice,
notice: notice
notice: notice,
neverNotice: neverNotice
}
var banana = {
test: function test () {
Expand Down Expand Up @@ -14132,15 +14150,15 @@ try {

if (pageHost === 'auto-task.hclonely.com' || pageHost === 'auto-task-test.hclonely.com') {
if (window.location.pathname.includes('setting')) {
var _GM_getValue2, _GM_getValue2$global, _GM_getValue2$global$
var _GM_getValue3, _GM_getValue3$global, _GM_getValue3$global$

unsafeWindow.GM_info = GM_info // eslint-disable-line camelcase

unsafeWindow.GM_setValue = GM_setValue // eslint-disable-line camelcase

unsafeWindow.language = language
unsafeWindow.getId = getId
typeof ((_GM_getValue2 = GM_getValue('conf')) === null || _GM_getValue2 === void 0 ? void 0 : (_GM_getValue2$global = _GM_getValue2.global) === null || _GM_getValue2$global === void 0 ? void 0 : (_GM_getValue2$global$ = _GM_getValue2$global.fuck) === null || _GM_getValue2$global$ === void 0 ? void 0 : _GM_getValue2$global$.joinSteamGroup) !== 'boolean' ? loadSettings(defaultConf) : loadSettings(config)
typeof ((_GM_getValue3 = GM_getValue('conf')) === null || _GM_getValue3 === void 0 ? void 0 : (_GM_getValue3$global = _GM_getValue3.global) === null || _GM_getValue3$global === void 0 ? void 0 : (_GM_getValue3$global$ = _GM_getValue3$global.fuck) === null || _GM_getValue3$global$ === void 0 ? void 0 : _GM_getValue3$global$.joinSteamGroup) !== 'boolean' ? loadSettings(defaultConf) : loadSettings(config)
} else if (window.location.pathname.includes('announcement')) {
loadAnnouncement()
} else if (window.location.pathname.includes('notice-list')) {
Expand All @@ -14167,14 +14185,14 @@ try {

unsafeWindow.remove = /* #__PURE__ */(function () {
var _remove = _asyncToGenerator(/* #__PURE__ */regeneratorRuntime.mark(function _callee113 (item) {
var _GM_getValue3, _config$giveawaysu2, _taskInfo3, conf
var _GM_getValue4, _config$giveawaysu2, _taskInfo3, conf

return regeneratorRuntime.wrap(function _callee113$ (_context114) {
while (1) {
switch (_context114.prev = _context114.next) {
case 0:
_context114.prev = 0
_taskInfo3 = (_GM_getValue3 = GM_getValue('delayNotice-' + item)) === null || _GM_getValue3 === void 0 ? void 0 : _GM_getValue3.taskInfo
_taskInfo3 = (_GM_getValue4 = GM_getValue('delayNotice-' + item)) === null || _GM_getValue4 === void 0 ? void 0 : _GM_getValue4.taskInfo

if (_taskInfo3) {
_context114.next = 4
Expand Down
2 changes: 1 addition & 1 deletion docs/auto-task-helper.user.js
Expand Up @@ -3,7 +3,7 @@
// @name:en Auto Task Helper
// @name:zh-CN 自动任务辅助
// @namespace auto-task-helper
// @version 3.5.7
// @version 3.5.8
// @description 自动任务脚本的辅助脚本,用于获取discord auth
// @description:en Auxiliary script of automatic task script, used to obtain discord auth
// @description:zh-CN 自动任务脚本的辅助脚本,用于获取discord auth
Expand Down
38 changes: 28 additions & 10 deletions docs/auto-task-test.user.js
Expand Up @@ -3,7 +3,7 @@
// @name:en Auto Task Test
// @name:zh-CN 自动任务 Test
// @namespace auto-task
// @version 3.5.7
// @version 3.5.8
// @description 自动完成赠key站任务
// @description:en Automatically complete giveaway tasks
// @description:zh-CN 自动完成赠key站任务
Expand Down Expand Up @@ -37,8 +37,8 @@
// @include https://auto-task-test.hclonely.com/setting.html
// @include https://auto-task-test.hclonely.com/notice-list.html

// @require https://cdn.jsdelivr.net/gh/HCLonely/auto-task@3.5.7/require/require.min.js#md5=68007d36810a2097bd1e638b54bea766
// @resource CSS https://cdn.jsdelivr.net/gh/HCLonely/auto-task@3.5.7/require/fuck-task.min.css#md5=9d0ff55f65f10782c682f6c9a917aa6f
// @require https://cdn.jsdelivr.net/gh/HCLonely/auto-task@3.5.8/require/require.min.js#md5=68007d36810a2097bd1e638b54bea766
// @resource CSS https://cdn.jsdelivr.net/gh/HCLonely/auto-task@3.5.8/require/fuck-task.min.css#md5=a9d18bf747e71f3267da29d4abebd7f6

// @grant GM_setValue
// @grant GM_getValue
Expand Down Expand Up @@ -922,7 +922,7 @@ try {
break
}

userCountryCurrency = (_data$responseText$ma5 = data.responseText.match(/a class="inactive_selection".*?id="(.+?)"/)) === null || _data$responseText$ma5 === void 0 ? void 0 : _data$responseText$ma5[1]
userCountryCurrency = (_data$responseText$ma5 = data.responseText.match(/<input id="usercountrycurrency".*?value="(.+?)"/)) === null || _data$responseText$ma5 === void 0 ? void 0 : _data$responseText$ma5[1]
country = _toConsumableArray(data.responseText.matchAll(/<div class="currency_change_option .*?" data-country="(.+?)" >/g)).map(function (e) {
return e[1]
})
Expand Down Expand Up @@ -6233,9 +6233,11 @@ try {

try {
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
var _GM_getValue2

var item = _step9.value

if (item.link === taskInfo.link) {
if (((_GM_getValue2 = GM_getValue('delayNotice-' + item)) === null || _GM_getValue2 === void 0 ? void 0 : _GM_getValue2.link) === window.location.href) {
return
}
}
Expand Down Expand Up @@ -6277,6 +6279,21 @@ try {
}
}

var neverNotice = function neverNotice (time) {
try {
var item = GM_getValue('delayNotice-' + time)
item.neverNotice = !item.neverNotice
GM_setValue('delayNotice-' + time, item)
var btn = $('[data-time='.concat(time, ']'))
btn.toggleClass('btn-primary').toggleClass('btn-outline-primary')
var svgPath = btn.find('path')
var svgColor = svgPath.attr('fill')
svgPath.attr('fill', svgColor === '#fff' ? '#1296db' : '#fff')
} catch (e) {
throwError(e, 'neverNotice')
}
}

var notice = function notice (options, callback) {
try {
var defaultOptions = {
Expand Down Expand Up @@ -7428,7 +7445,8 @@ try {
delay: delay,
addDelayNotice: addDelayNotice,
deleteDelayNotice: deleteDelayNotice,
notice: notice
notice: notice,
neverNotice: neverNotice
}
var banana = {
test: function test () {
Expand Down Expand Up @@ -14132,15 +14150,15 @@ try {

if (pageHost === 'auto-task.hclonely.com' || pageHost === 'auto-task-test.hclonely.com') {
if (window.location.pathname.includes('setting')) {
var _GM_getValue2, _GM_getValue2$global, _GM_getValue2$global$
var _GM_getValue3, _GM_getValue3$global, _GM_getValue3$global$

unsafeWindow.GM_info = GM_info // eslint-disable-line camelcase

unsafeWindow.GM_setValue = GM_setValue // eslint-disable-line camelcase

unsafeWindow.language = language
unsafeWindow.getId = getId
typeof ((_GM_getValue2 = GM_getValue('conf')) === null || _GM_getValue2 === void 0 ? void 0 : (_GM_getValue2$global = _GM_getValue2.global) === null || _GM_getValue2$global === void 0 ? void 0 : (_GM_getValue2$global$ = _GM_getValue2$global.fuck) === null || _GM_getValue2$global$ === void 0 ? void 0 : _GM_getValue2$global$.joinSteamGroup) !== 'boolean' ? loadSettings(defaultConf) : loadSettings(config)
typeof ((_GM_getValue3 = GM_getValue('conf')) === null || _GM_getValue3 === void 0 ? void 0 : (_GM_getValue3$global = _GM_getValue3.global) === null || _GM_getValue3$global === void 0 ? void 0 : (_GM_getValue3$global$ = _GM_getValue3$global.fuck) === null || _GM_getValue3$global$ === void 0 ? void 0 : _GM_getValue3$global$.joinSteamGroup) !== 'boolean' ? loadSettings(defaultConf) : loadSettings(config)
} else if (window.location.pathname.includes('announcement')) {
loadAnnouncement()
} else if (window.location.pathname.includes('notice-list')) {
Expand All @@ -14167,14 +14185,14 @@ try {

unsafeWindow.remove = /* #__PURE__ */(function () {
var _remove = _asyncToGenerator(/* #__PURE__ */regeneratorRuntime.mark(function _callee113 (item) {
var _GM_getValue3, _config$giveawaysu2, _taskInfo3, conf
var _GM_getValue4, _config$giveawaysu2, _taskInfo3, conf

return regeneratorRuntime.wrap(function _callee113$ (_context114) {
while (1) {
switch (_context114.prev = _context114.next) {
case 0:
_context114.prev = 0
_taskInfo3 = (_GM_getValue3 = GM_getValue('delayNotice-' + item)) === null || _GM_getValue3 === void 0 ? void 0 : _GM_getValue3.taskInfo
_taskInfo3 = (_GM_getValue4 = GM_getValue('delayNotice-' + item)) === null || _GM_getValue4 === void 0 ? void 0 : _GM_getValue4.taskInfo

if (_taskInfo3) {
_context114.next = 4
Expand Down
2 changes: 1 addition & 1 deletion docs/version.json
@@ -1 +1 @@
{"version":"3.5.7"}
{"version":"3.5.8"}
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "auto-task",
"version": "3.5.7",
"version": "3.5.8",
"description": "Automatically complete giveaway tasks",
"main": "auto-task-test.user.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion require/fuck-task.min.css

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/scripts/function/main.js
@@ -1,5 +1,5 @@
import { getI18n } from '../i18n'
import { throwError, unique, getUrlQuery, dateFormat, isEmptyObjArr, clearTaskInfo, uniqueTaskInfo, delay, assignment, addDelayNotice, deleteDelayNotice, notice } from './tool'
import { throwError, unique, getUrlQuery, dateFormat, isEmptyObjArr, clearTaskInfo, uniqueTaskInfo, delay, assignment, addDelayNotice, deleteDelayNotice, notice, neverNotice } from './tool'

import { httpRequest, getFinalUrl, visitLink } from './httpRequest'
import { updateSteamInfo } from './social/steam'
Expand Down Expand Up @@ -35,7 +35,8 @@ const fuc = {
delay,
addDelayNotice,
deleteDelayNotice,
notice
notice,
neverNotice
}
function newTabBlock () {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/function/social/steam.js
Expand Up @@ -117,7 +117,7 @@ async function getCountryInfo () {
})
if (result === 'Success') {
if (data.status === 200) {
const userCountryCurrency = data.responseText.match(/a class="inactive_selection".*?id="(.+?)"/)?.[1]
const userCountryCurrency = data.responseText.match(/<input id="usercountrycurrency".*?value="(.+?)"/)?.[1]
const country = [...data.responseText.matchAll(/<div class="currency_change_option .*?" data-country="(.+?)" >/g)].map(e => e[1])
if (userCountryCurrency && country.length > 0) {
logStatus.success()
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/function/tool.js
Expand Up @@ -128,7 +128,7 @@ function addDelayNotice (taskInfo, echoLog, day) {
const time = new Date().getTime()
const noticeList = GM_getValue('noticeList') || []
for (const item of noticeList) {
if (item.link === taskInfo.link) {
if (GM_getValue('delayNotice-' + item)?.link === window.location.href) {
return
}
}
Expand Down

1 comment on commit c7c403f

@vercel
Copy link

@vercel vercel bot commented on c7c403f May 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.