Skip to content

Commit

Permalink
修复: Opquests识别不到按钮导致验证停止(#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
HCLonely committed Jan 11, 2025
1 parent 34230f7 commit aac8633
Show file tree
Hide file tree
Showing 17 changed files with 44 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
uses: softprops/action-gh-release@v1
with:
prerelease: false
tag_name: v4.5.8
name: 4.5.8
tag_name: v4.5.9
name: 4.5.9
body: '- 修复: Opquests识别不到按钮导致验证停止(#42)'
files: |-
dist/auto-task-v4-for-giveawaysu.user.js
Expand Down
2 changes: 1 addition & 1 deletion dist/auto-task-v4-for-giveawaysu.all.user.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/auto-task-v4-for-giveawaysu.user.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 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.8
// @version 4.5.9
// @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 @@ -9087,7 +9087,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
if (opquestsVerifyTasks.length > 0) {
const taskId = opquestsVerifyTasks.pop();
GM_setValue('opquestsVerifyTasks', opquestsVerifyTasks);
const [ verifyBtn ] = $(`#task_id[value="${taskId}"]`).parent().children('button[type="submit"]');
const [ verifyBtn ] = $(`#task_id[value="${taskId}"]`).parent().find('button[type="button"]').has('i.fa-check');
if (verifyBtn) {
verifyBtn.click();
return;
Expand Down Expand Up @@ -9180,11 +9180,11 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
if (!this.initialized) {
this.init();
}
const tasks = $.makeArray($('div.w-full').find('.items-center').has('button.submit-loader')).map(ele => $(ele).find('input[name="task_id"]').val());
const tasks = $.makeArray($('.items-center').has('input[name="task_id"]')).map(ele => $(ele).find('input[name="task_id"]').val());
await this.#confirm();
const taskId = tasks.pop();
GM_setValue('opquestsVerifyTasks', tasks);
$(`#task_id[value="${taskId}"]`).parent().children('button[type="submit"]')[0]?.click();
$(`#task_id[value="${taskId}"]`).parent().find('button[type="button"]').has('i.fa-check')[0]?.click();
return true;
} catch (error) {
throwError(error, 'Opquests.verifyTask');
Expand Down
4 changes: 2 additions & 2 deletions dist/auto-task-v4.compatibility.all.user.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

8 changes: 4 additions & 4 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.8
// @version 4.5.9
// @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 @@ -9068,7 +9068,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
if (opquestsVerifyTasks.length > 0) {
const taskId = opquestsVerifyTasks.pop();
GM_setValue('opquestsVerifyTasks', opquestsVerifyTasks);
const [ verifyBtn ] = $(`#task_id[value="${taskId}"]`).parent().children('button[type="submit"]');
const [ verifyBtn ] = $(`#task_id[value="${taskId}"]`).parent().find('button[type="button"]').has('i.fa-check');
if (verifyBtn) {
verifyBtn.click();
return;
Expand Down Expand Up @@ -9161,11 +9161,11 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
if (!this.initialized) {
this.init();
}
const tasks = $.makeArray($('div.w-full').find('.items-center').has('button.submit-loader')).map(ele => $(ele).find('input[name="task_id"]').val());
const tasks = $.makeArray($('.items-center').has('input[name="task_id"]')).map(ele => $(ele).find('input[name="task_id"]').val());
await this.#confirm();
const taskId = tasks.pop();
GM_setValue('opquestsVerifyTasks', tasks);
$(`#task_id[value="${taskId}"]`).parent().children('button[type="submit"]')[0]?.click();
$(`#task_id[value="${taskId}"]`).parent().find('button[type="button"]').has('i.fa-check')[0]?.click();
return true;
} catch (error) {
throwError(error, 'Opquests.verifyTask');
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.9

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

- 修复: Opquests识别不到按钮导致验证停止([#42](https://github.com/HCLonely/auto-task-v4/issues/42))

### V4.5.8

[Release](https://github.com/HCLonely/auto-task-v4/releases/tag/v4.5.8)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auto-task-v4",
"version": "4.5.8",
"version": "4.5.9",
"change": [
"修复: Opquests识别不到按钮导致验证停止(#42)"
],
Expand Down
2 changes: 1 addition & 1 deletion page/dist/auto-task-v4-for-giveawaysu.all.user.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion page/dist/auto-task-v4-for-giveawaysu.user.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 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.8
// @version 4.5.9
// @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 @@ -9087,7 +9087,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
if (opquestsVerifyTasks.length > 0) {
const taskId = opquestsVerifyTasks.pop();
GM_setValue('opquestsVerifyTasks', opquestsVerifyTasks);
const [ verifyBtn ] = $(`#task_id[value="${taskId}"]`).parent().children('button[type="submit"]');
const [ verifyBtn ] = $(`#task_id[value="${taskId}"]`).parent().find('button[type="button"]').has('i.fa-check');
if (verifyBtn) {
verifyBtn.click();
return;
Expand Down Expand Up @@ -9180,11 +9180,11 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
if (!this.initialized) {
this.init();
}
const tasks = $.makeArray($('div.w-full').find('.items-center').has('button.submit-loader')).map(ele => $(ele).find('input[name="task_id"]').val());
const tasks = $.makeArray($('.items-center').has('input[name="task_id"]')).map(ele => $(ele).find('input[name="task_id"]').val());
await this.#confirm();
const taskId = tasks.pop();
GM_setValue('opquestsVerifyTasks', tasks);
$(`#task_id[value="${taskId}"]`).parent().children('button[type="submit"]')[0]?.click();
$(`#task_id[value="${taskId}"]`).parent().find('button[type="button"]').has('i.fa-check')[0]?.click();
return true;
} catch (error) {
throwError(error, 'Opquests.verifyTask');
Expand Down
4 changes: 2 additions & 2 deletions page/dist/auto-task-v4.compatibility.all.user.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions page/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.8
// @version 4.5.9
// @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 @@ -9068,7 +9068,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
if (opquestsVerifyTasks.length > 0) {
const taskId = opquestsVerifyTasks.pop();
GM_setValue('opquestsVerifyTasks', opquestsVerifyTasks);
const [ verifyBtn ] = $(`#task_id[value="${taskId}"]`).parent().children('button[type="submit"]');
const [ verifyBtn ] = $(`#task_id[value="${taskId}"]`).parent().find('button[type="button"]').has('i.fa-check');
if (verifyBtn) {
verifyBtn.click();
return;
Expand Down Expand Up @@ -9161,11 +9161,11 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载');
if (!this.initialized) {
this.init();
}
const tasks = $.makeArray($('div.w-full').find('.items-center').has('button.submit-loader')).map(ele => $(ele).find('input[name="task_id"]').val());
const tasks = $.makeArray($('.items-center').has('input[name="task_id"]')).map(ele => $(ele).find('input[name="task_id"]').val());
await this.#confirm();
const taskId = tasks.pop();
GM_setValue('opquestsVerifyTasks', tasks);
$(`#task_id[value="${taskId}"]`).parent().children('button[type="submit"]')[0]?.click();
$(`#task_id[value="${taskId}"]`).parent().find('button[type="button"]').has('i.fa-check')[0]?.click();
return true;
} catch (error) {
throwError(error, 'Opquests.verifyTask');
Expand Down
2 changes: 1 addition & 1 deletion page/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auto-task-v4",
"version": "4.5.8",
"version": "4.5.9",
"change": [
"修复: Opquests识别不到按钮导致验证停止(#42)"
],
Expand Down
10 changes: 6 additions & 4 deletions src/scripts/website/Opquests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ class Opquests extends Website {
const taskId = opquestsVerifyTasks.pop();
GM_setValue('opquestsVerifyTasks', opquestsVerifyTasks);
const [verifyBtn] = $(`#task_id[value="${taskId}"]`).parent()
.children('button[type="submit"]');
.find('button[type="button"]')
.has('i.fa-check');
if (verifyBtn) {
verifyBtn.click();
return;
Expand Down Expand Up @@ -282,14 +283,15 @@ class Opquests extends Website {
if (!this.initialized) {
this.init();
}
const tasks: Array<string> = $.makeArray($('div.w-full').find('.items-center')
.has('button.submit-loader')).map((ele) => $(ele).find('input[name="task_id"]')
const tasks: Array<string> = $.makeArray($('.items-center').has('input[name="task_id"]'))
.map((ele) => $(ele).find('input[name="task_id"]')
.val() as string);
await this.#confirm();
const taskId = tasks.pop();
GM_setValue('opquestsVerifyTasks', tasks);
$(`#task_id[value="${taskId}"]`).parent()
.children('button[type="submit"]')[0]?.click();
.find('button[type="button"]')
.has('i.fa-check')[0]?.click();
return true;
} catch (error) {
throwError(error as Error, 'Opquests.verifyTask');
Expand Down

0 comments on commit aac8633

Please sign in to comment.