增加标准注释

This commit is contained in:
lingling 2024-08-24 11:17:58 +08:00
parent 006d6bb027
commit 720df836d2
2 changed files with 39 additions and 7 deletions

View File

@ -2,7 +2,7 @@
* @Author: lingling 1077478963@qq.com * @Author: lingling 1077478963@qq.com
* @Date: 2024-08-19 09:47:04 * @Date: 2024-08-19 09:47:04
* @LastEditors: lingling 1077478963@qq.com * @LastEditors: lingling 1077478963@qq.com
* @LastEditTime: 2024-08-23 08:17:05 * @LastEditTime: 2024-08-24 09:25:13
* @FilePath: \谷歌自动搜索邮箱自动点击v3\js\popup.js * @FilePath: \谷歌自动搜索邮箱自动点击v3\js\popup.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@ -98,7 +98,7 @@ $(function () {
} }
//函数队列 //函数队列
let queue = []; let queue = [];
queue.push(play_finance);//好像js注入不进去 // queue.push(play_finance);//好像js注入不进去
// queue.push(shopping); // queue.push(shopping);
// queue.push(calendar); // queue.push(calendar);
// queue.push(mail); // queue.push(mail);

View File

@ -1,17 +1,29 @@
//延迟函数解决魔鬼定时器问题 /**
* 阻塞代码运行
* @param {*} n 秒数
* @returns
*/
function delay(n) { function delay(n) {
return new Promise(function (resolve) { return new Promise(function (resolve) {
setTimeout(resolve, n * 1000); setTimeout(resolve, n * 1000);
}); });
} }
//随机数生成器 /**
* 随机数生成
* @param {*} min 最小值
* @param {*} max 最大值
* @returns
*/
function getRandomInt(min, max) { function getRandomInt(min, max) {
min = Math.ceil(min); min = Math.ceil(min);
max = Math.floor(max); max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min; return Math.floor(Math.random() * (max - min + 1)) + min;
} }
//随机滑动函数 /**
* 随机滑动函数
* @param {*} y 滑动像素 不传递默认随机
*/
function RandomIntscrollBy(y = 0) { function RandomIntscrollBy(y = 0) {
let rand = getRandomInt(100, 600); let rand = getRandomInt(100, 600);
scrollBy(0, y == 0 ? rand : y); scrollBy(0, y == 0 ? rand : y);
@ -23,7 +35,20 @@ const naver = async (r, id) => {
// await delay(1); // await delay(1);
send_close(id); send_close(id);
}; };
/**
*
* @param {*} str 字符串
* @param {*} arr 需要匹配的字符串数组
* @returns boole
*/
function searchStringContainsArrayKeywords(str, arr) {
for (let i = 0; i < arr.length; i++) {
if (str.includes(arr[i])) {
return true;
}
}
return false;
}
//youto短视频 //youto短视频
async function youtube_shorts(r, id) { async function youtube_shorts(r, id) {
@ -273,13 +298,20 @@ async function mail(r, id) {
]; ];
await delay(8); await delay(8);
let mails = document.querySelectorAll(".zA"); let mails = document.querySelectorAll(".zA");
let mails_is_google = $(".zA");
for (let index = 0; index < mails.length; index++) { for (let index = 0; index < mails.length; index++) {
//挨个查看 //挨个查看
mails[index].click(); mails[index].click();
RandomIntscrollBy(); RandomIntscrollBy();
await delay(getRandomInt(1, 5)); await delay(getRandomInt(1, 5));
//获取邮件发送人
let mail_for = mails_is_google[index].find('.yP')[0].attr("email")
//是否回复
let whether_or_not_to_reply_to= searchStringContainsArrayKeywords(mail_for,['google','youtube'])
console.log(`当前邮件发送人:${mail_for} 是否回复${whether_or_not_to_reply_to}`)
//邮箱回复 //邮箱回复
if (getRandomInt(0, 1) == 0) { if (getRandomInt(0, 1) == 0&&whether_or_not_to_reply_to) {
$(".amn >.ams.bkH").click(); $(".amn >.ams.bkH").click();
await delay(getRandomInt(1, 5)); await delay(getRandomInt(1, 5));
let text = emailReply[getRandomInt(0, emailReply.length - 1)]; let text = emailReply[getRandomInt(0, emailReply.length - 1)];