forked from GH6324/LazyStudy
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c78e81
commit cc8c6e9
Showing
3 changed files
with
86 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* @description: 延时函数 | ||
* @param: seconds-延迟秒数 | ||
* @return: null | ||
*/ | ||
var commentText=["支持党,支持国家!","为实现中华民族伟大复兴而不懈奋斗!","紧跟党走,毫不动摇!","不忘初心,牢记使命","努力奋斗,回报祖国!"];//评论内容,可自行修改,大于5个字便计分 | ||
|
||
function delay(seconds) | ||
{ | ||
sleep(1000*seconds);//sleep函数参数单位为毫秒所以乘1000 | ||
} | ||
|
||
function begin() | ||
{ | ||
toastLog("正在进行收藏分享评论..."); | ||
//收藏 | ||
var collectIcon = className("com.uc.webview.export.WebView").findOnce().parent().child(7);//右下角收藏按钮 | ||
collectIcon.click();//点击收藏 | ||
delay(2); | ||
toastLog("收藏成功!"); | ||
//分享 | ||
var shareIcon = className("com.uc.webview.export.WebView").findOnce().parent().child(8);//右下角分享按钮 | ||
shareIcon.click();//点击分享 | ||
while(!textContains("分享到学习强").exists());//等待弹出分享选项界面 | ||
delay(2); | ||
click("分享到学习强国"); | ||
delay(2); | ||
toastLog("分享成功!"); | ||
delay(2); | ||
back();//返回文章界面 | ||
delay(2); | ||
//评论 | ||
|
||
var num=random(0,commentText.length-1)//随机数 | ||
click("欢迎发表你的观点"); | ||
setText(commentText[num]);//输入评论内容 | ||
delay(1); | ||
click("发布");//点击右上角发布按钮 | ||
toastLog("评论成功!"); | ||
delay(2); | ||
click("删除");//删除该评论 | ||
delay(2); | ||
click("确认");//确认删除 | ||
toastLog("评论删除成功!"); | ||
delay(2); | ||
toastLog("运行结束"); | ||
} | ||
|
||
//begin(); | ||
module.exports=begin; |