Skip to content

Commit

Permalink
修复: Steam任务完成后的换区逻辑(#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
HCLonely committed Dec 30, 2024
1 parent adbbbed commit 0a66d8e
Show file tree
Hide file tree
Showing 19 changed files with 102 additions and 78 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,9 @@ jobs:
uses: softprops/action-gh-release@v1
with:
prerelease: false
tag_name: v4.5.6
name: 4.5.6
body: |-
- 修复: Keylol存在多个ASF激活代码时识别错误(#40)
- 优化: Steam任务完成后的换区逻辑(#41)
- 优化: 使用ASF完成愿望单/关注游戏的逻辑
tag_name: v4.5.7
name: 4.5.7
body: '- 修复: Steam任务完成后的换区逻辑(#41)'
files: |-
dist/auto-task-v4-for-giveawaysu.user.js
dist/auto-task-v4.compatibility.user.js
Expand Down
4 changes: 2 additions & 2 deletions dist/auto-task-v4-for-giveawaysu.all.user.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/auto-task-v4-for-giveawaysu.user.js

Large diffs are not rendered by default.

23 changes: 14 additions & 9 deletions dist/auto-task-v4.all.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name auto-task-v4
// @namespace auto-task-v4
// @version 4.5.6
// @version 4.5.7
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
// @author HCLonely
Expand Down Expand Up @@ -1379,7 +1379,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
noAnotherArea: '请检测是否开启正确开启代理',
gettingAreaInfo: '正在获取Steam地区信息...',
changeAreaNotice: '疑似锁区游戏,尝试换区执行',
steamFinishNotice: 'Steam任务完成,尝试将购物车地区换回%s',
steamFinishNotice: 'Steam任务完成,尝试将购物车地区换回',
gettingSubid: '正在获取游戏subid',
addingFreeLicense: '正在入库',
missParams: '缺少参数',
Expand All @@ -1390,6 +1390,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
retry: '重试',
owned: '已拥有',
redirect: '重定向',
noSubid: '无法获取,跳过',
initingASF: '正在初始化ASF...',
servers: '服务器',
joiningDiscordServer: '正在加入Discord服务器',
Expand Down Expand Up @@ -1664,7 +1665,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
noAnotherArea: 'Please check whether the proxy is turned on correctly',
gettingAreaInfo: 'Getting Steam area information...',
changeAreaNotice: 'Suspected of a locked zone game, try to change the zone to execute',
steamFinishNotice: 'Steam task completed, try to change the shopping cart area back to %s',
steamFinishNotice: 'Steam task completed, try to change the shopping cart area back to ',
gettingSubid: 'Getting subid',
addingFreeLicense: 'Adding free license',
missParams: 'Missing parameters',
Expand All @@ -1676,6 +1677,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
retry: 'Retry',
owned: 'Owned',
redirect: 'Redirect',
noSubid: 'skip due to unrecognized',
initingASF: 'Initing ASF...',
servers: 'Server',
joiningDiscordServer: 'Joining Discord Server',
Expand Down Expand Up @@ -5094,8 +5096,11 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
const {
currentArea
} = await this.#getAreaInfo();
if (!this.#oldArea && currentArea) {
this.#oldArea = currentArea;
if (currentArea) {
this.#area = currentArea;
if (!this.#oldArea) {
this.#oldArea = currentArea;
}
}
if (currentArea === aimedArea) {
this.#areaStatus = 'success';
Expand Down Expand Up @@ -6146,7 +6151,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
logStatus.success();
return subid;
}
logStatus.error(`Error:${data.statusText}(${data.status})`);
logStatus.error(`Error:${i18n('noSubid')}`);
return false;
}
logStatus.error(`Error:${data?.statusText}(${data?.status})`);
Expand Down Expand Up @@ -6297,7 +6302,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
if (this.#area === 'CN' && data.responseText.includes('id="error_box"')) {
logStatus.warning(i18n('changeAreaNotice'));
const result = await this.#changeArea();
if (!result || result === 'CN') {
if (!result || [ 'CN', 'skip' ].includes(result)) {
return false;
}
return await this.#addFreeLicense(id);
Expand Down Expand Up @@ -6567,8 +6572,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
}
}
return Promise.all(prom).then(async () => {
if (this.#area !== this.#oldArea) {
scripts_echoLog({}).warning(i18n('steamFinishNotice', this.#oldArea));
if (this.#oldArea && this.#area !== this.#oldArea) {
scripts_echoLog({}).warning(i18n('steamFinishNotice') + this.#oldArea);
await this.#changeArea(this.#oldArea);
}
return true;
Expand Down
6 changes: 3 additions & 3 deletions dist/auto-task-v4.compatibility.all.user.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/auto-task-v4.compatibility.user.js

Large diffs are not rendered by default.

23 changes: 14 additions & 9 deletions dist/auto-task-v4.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name auto-task-v4
// @namespace auto-task-v4
// @version 4.5.6
// @version 4.5.7
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
// @author HCLonely
Expand Down Expand Up @@ -1360,7 +1360,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
noAnotherArea: '请检测是否开启正确开启代理',
gettingAreaInfo: '正在获取Steam地区信息...',
changeAreaNotice: '疑似锁区游戏,尝试换区执行',
steamFinishNotice: 'Steam任务完成,尝试将购物车地区换回%s',
steamFinishNotice: 'Steam任务完成,尝试将购物车地区换回',
gettingSubid: '正在获取游戏subid',
addingFreeLicense: '正在入库',
missParams: '缺少参数',
Expand All @@ -1371,6 +1371,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
retry: '重试',
owned: '已拥有',
redirect: '重定向',
noSubid: '无法获取,跳过',
initingASF: '正在初始化ASF...',
servers: '服务器',
joiningDiscordServer: '正在加入Discord服务器',
Expand Down Expand Up @@ -1645,7 +1646,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
noAnotherArea: 'Please check whether the proxy is turned on correctly',
gettingAreaInfo: 'Getting Steam area information...',
changeAreaNotice: 'Suspected of a locked zone game, try to change the zone to execute',
steamFinishNotice: 'Steam task completed, try to change the shopping cart area back to %s',
steamFinishNotice: 'Steam task completed, try to change the shopping cart area back to ',
gettingSubid: 'Getting subid',
addingFreeLicense: 'Adding free license',
missParams: 'Missing parameters',
Expand All @@ -1657,6 +1658,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
retry: 'Retry',
owned: 'Owned',
redirect: 'Redirect',
noSubid: 'skip due to unrecognized',
initingASF: 'Initing ASF...',
servers: 'Server',
joiningDiscordServer: 'Joining Discord Server',
Expand Down Expand Up @@ -5075,8 +5077,11 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
const {
currentArea
} = await this.#getAreaInfo();
if (!this.#oldArea && currentArea) {
this.#oldArea = currentArea;
if (currentArea) {
this.#area = currentArea;
if (!this.#oldArea) {
this.#oldArea = currentArea;
}
}
if (currentArea === aimedArea) {
this.#areaStatus = 'success';
Expand Down Expand Up @@ -6127,7 +6132,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
logStatus.success();
return subid;
}
logStatus.error(`Error:${data.statusText}(${data.status})`);
logStatus.error(`Error:${i18n('noSubid')}`);
return false;
}
logStatus.error(`Error:${data?.statusText}(${data?.status})`);
Expand Down Expand Up @@ -6278,7 +6283,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
if (this.#area === 'CN' && data.responseText.includes('id="error_box"')) {
logStatus.warning(i18n('changeAreaNotice'));
const result = await this.#changeArea();
if (!result || result === 'CN') {
if (!result || [ 'CN', 'skip' ].includes(result)) {
return false;
}
return await this.#addFreeLicense(id);
Expand Down Expand Up @@ -6548,8 +6553,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
}
}
return Promise.all(prom).then(async () => {
if (this.#area !== this.#oldArea) {
scripts_echoLog({}).warning(i18n('steamFinishNotice', this.#oldArea));
if (this.#oldArea && this.#area !== this.#oldArea) {
scripts_echoLog({}).warning(i18n('steamFinishNotice') + this.#oldArea);
await this.#changeArea(this.#oldArea);
}
return true;
Expand Down
6 changes: 6 additions & 0 deletions doc/docs/logs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ lang: zh-CN

## V4.5

### V4.5.7

[Release](https://github.com/HCLonely/auto-task-v4/releases/tag/v4.5.7)

- 修复: Steam任务完成后的换区逻辑([#41](https://github.com/HCLonely/auto-task-v4/issues/41))

### V4.5.6

[Release](https://github.com/HCLonely/auto-task-v4/releases/tag/v4.5.6)
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"name": "auto-task-v4",
"version": "4.5.6",
"version": "4.5.7",
"change": [
"修复: Keylol存在多个ASF激活代码时识别错误(#40)",
"优化: Steam任务完成后的换区逻辑(#41)",
"优化: 使用ASF完成愿望单/关注游戏的逻辑"
"修复: Steam任务完成后的换区逻辑(#41)"
],
"description": "赠Key站自动任务脚本",
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions page/dist/auto-task-v4-for-giveawaysu.all.user.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions page/dist/auto-task-v4-for-giveawaysu.user.js

Large diffs are not rendered by default.

23 changes: 14 additions & 9 deletions page/dist/auto-task-v4.all.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name auto-task-v4
// @namespace auto-task-v4
// @version 4.5.6
// @version 4.5.7
// @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。
// @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites.
// @author HCLonely
Expand Down Expand Up @@ -1379,7 +1379,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
noAnotherArea: '请检测是否开启正确开启代理',
gettingAreaInfo: '正在获取Steam地区信息...',
changeAreaNotice: '疑似锁区游戏,尝试换区执行',
steamFinishNotice: 'Steam任务完成,尝试将购物车地区换回%s',
steamFinishNotice: 'Steam任务完成,尝试将购物车地区换回',
gettingSubid: '正在获取游戏subid',
addingFreeLicense: '正在入库',
missParams: '缺少参数',
Expand All @@ -1390,6 +1390,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
retry: '重试',
owned: '已拥有',
redirect: '重定向',
noSubid: '无法获取,跳过',
initingASF: '正在初始化ASF...',
servers: '服务器',
joiningDiscordServer: '正在加入Discord服务器',
Expand Down Expand Up @@ -1664,7 +1665,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
noAnotherArea: 'Please check whether the proxy is turned on correctly',
gettingAreaInfo: 'Getting Steam area information...',
changeAreaNotice: 'Suspected of a locked zone game, try to change the zone to execute',
steamFinishNotice: 'Steam task completed, try to change the shopping cart area back to %s',
steamFinishNotice: 'Steam task completed, try to change the shopping cart area back to ',
gettingSubid: 'Getting subid',
addingFreeLicense: 'Adding free license',
missParams: 'Missing parameters',
Expand All @@ -1676,6 +1677,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
retry: 'Retry',
owned: 'Owned',
redirect: 'Redirect',
noSubid: 'skip due to unrecognized',
initingASF: 'Initing ASF...',
servers: 'Server',
joiningDiscordServer: 'Joining Discord Server',
Expand Down Expand Up @@ -5094,8 +5096,11 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
const {
currentArea
} = await this.#getAreaInfo();
if (!this.#oldArea && currentArea) {
this.#oldArea = currentArea;
if (currentArea) {
this.#area = currentArea;
if (!this.#oldArea) {
this.#oldArea = currentArea;
}
}
if (currentArea === aimedArea) {
this.#areaStatus = 'success';
Expand Down Expand Up @@ -6146,7 +6151,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
logStatus.success();
return subid;
}
logStatus.error(`Error:${data.statusText}(${data.status})`);
logStatus.error(`Error:${i18n('noSubid')}`);
return false;
}
logStatus.error(`Error:${data?.statusText}(${data?.status})`);
Expand Down Expand Up @@ -6297,7 +6302,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
if (this.#area === 'CN' && data.responseText.includes('id="error_box"')) {
logStatus.warning(i18n('changeAreaNotice'));
const result = await this.#changeArea();
if (!result || result === 'CN') {
if (!result || [ 'CN', 'skip' ].includes(result)) {
return false;
}
return await this.#addFreeLicense(id);
Expand Down Expand Up @@ -6567,8 +6572,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
}
}
return Promise.all(prom).then(async () => {
if (this.#area !== this.#oldArea) {
scripts_echoLog({}).warning(i18n('steamFinishNotice', this.#oldArea));
if (this.#oldArea && this.#area !== this.#oldArea) {
scripts_echoLog({}).warning(i18n('steamFinishNotice') + this.#oldArea);
await this.#changeArea(this.#oldArea);
}
return true;
Expand Down
Loading

0 comments on commit 0a66d8e

Please sign in to comment.