大家好,我是公众号3分钟学堂的郭立员,今天给大家带来一个给指定文章评论点赞脚本源码分享。
操作流程简介【1】根据公众号指定链接打开文章
【2】滑到文章底部点赞
【3】留言评论预先准备的内容
学习的知识点①用微信打开指定链接
②页面滑动到底检测
③检测是否点过赞了
代码Import "shanhai.lua"
Import "jsdvip.luae"
jsdvip.StartServer
Dim uri="https://mp.weixin.qq.com/s/zdpHsknsM9-IB7x5o2cyPg"
shanhai.execute ("am start -n com.tencent.mm/.plugin.webview.ui.tools.WebViewUI -d " & uri)
Delay 3000
Do
dim Tab = jsdvip.FindNodeInfo("By.res('js_bottom_zan_btn')","'rect'")
If Tab Then
If Tab[4] - Tab[2] > 10 Then
TracePrint "点赞按钮出现了"
Exit Do
Else
TracePrint "继续滑动"
End If
End If
Swipe 200, 800, 200, 300, 300
Delay 500
Loop
dim zan=jsdvip.FindNodeInfo("By.text($('赞.*'))","text")
Dim zanqian=shanhai.RegexFind(zan,"%d ")
TracePrint zanqian(0)
Delay 300
jsdvip.Click ("By.res('js_bottom_zan_btn')")
Delay 300
zan=jsdvip.GetText("By.res('js_bottom_zan_btn')")
Dim zanhou=shanhai.RegexFind(zan,"%d ")
TracePrint zanhou(0)
If CInt(zanhou(0)) > CInt(zanqian(0)) Then
TracePrint "点赞成功"
Else
TracePrint "已经点过赞,恢复点赞"
jsdvip.Click ("By.res('js_bottom_zan_btn')")
End If
Delay 1000
Do
Tab = jsdvip.FindNodeInfo("By.res('js_cmt_write')","'rect'")
If Tab Then
If Tab[4] - Tab[2] > 10 Then
TracePrint "开始留言"
Exit Do
Else
TracePrint "继续滑动"
End If
End If
Swipe 200, 600, 200, 300, 300
Delay 500
Loop
jsdvip.click ("By.res('js_cmt_write')")
Delay 1000
InputText "教程不错"
Delay 1000
jsdvip.click ("By.text('提交')")
Copyright © 2024 妖气游戏网 www.17u1u.com All Rights Reserved