吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 4337|回复: 11
收起左侧

[其他原创] 【Lua】支付宝自动领积分源码(积木编程 LuaBox全分辨率免 ROOT)

[复制链接]
lisaisacat 发表于 2020-9-28 14:31
本帖最后由 lisaisacat 于 2020-12-9 10:13 编辑

运行环境:LuaBox/积木编程(软件自行百度下载,关键词:触动精灵官网)
运行系统:安卓 5 以上,无需 ROOT


2020-10-27 更新:
简化代码、增加可视化源码


代码逻辑:
image.png
image.png

新版源码:
[Lua] 纯文本查看 复制代码
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
pkgname = app.getPackageName("支付宝")
app.runApp(pkgname)
mSleep(3000)
for i = 1,5 do
    local text = "签到"
    local check = widget.find({["text"]="签到"})
    if check ~= nil then
        x,y,x1,y1 = widget.region(check)
        if x ~= -1 then
            toast(text)
            event.tap(x,y)
            mSleep(3000)
        end
    else
        local text = "领积分"
        local collect = widget.find({["text"]="领积分",["type"]="View"})
        if collect ~= nil then
            x1,y1,x2,y2 = widget.region(collect)
            x = (x1+x2)/2
            y = (y1+y2)/2
            toast(text)
            event.tap(x,y)
            mSleep(3000)
        else
            local text = "积分待领取"
            local point =  widget.find({["text"]=text,["rule"]=3})
            if  point ~= nil then
                x1,y1,x2,y2 = widget.region(point)
                if x1 ~= -1 then
                    toast(text)
                    event.tap(x1,y1)
                    mSleep(3000)
                end
            else
                local text = "我的"
                local my = widget.find({["id"]="com.alipay.android.phone.wealth.home:id/tab_description",["text"]= text})
                if my ~= nil then
                    x,y,x1,y1 = widget.region(my)
                    if x ~= -1 then
                        toast(text)
                        event.tap(x,y)
                        mSleep(3000)
                    end
                end     
            end
        end
    end
end






使用方法:复制代码 - 打开软件 - 新建脚本 - 粘贴代码 - 运行
开发环境:触动精灵编辑器 3.0
image.png
脚本功能:自动打开支付宝>>打开我的界面>>领取积分
脚本语言:Lua

脚本原理
仍然是使用安卓系统的无障碍权限查找界面控件的 text 和 desc 属性

脚本源码:
[Lua] 纯文本查看 复制代码
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
pkgname = app.getPackageName("支付宝")
app.runApp(pkgname)
mSleep(3000)
local text = "我的"
local my = widget.find({["id"]="com.alipay.android.phone.wealth.home:id/tab_description",["text"]= text})
if my ~= nil then
    x,y,x1,y1 = widget.region(my)
    if x ~= -1 then
        toast(text)
        event.tap(x,y)
        mSleep(3000)
    end
end
local text = "积分待领取"
local point =  widget.find({["text"]=text,["rule"]=3})
if  point ~= nil then
    x1,y1,x2,y2 = widget.region(point)
    if x1 ~= -1 then
        toast(text)
        event.tap(x1,y1)
        mSleep(3000)
    end
end
local text = "领积分"
local collect = widget.find({["text"]="领积分"})
if collect ~= nil then
    x,y,x1,y1 = widget.region(collect)
    if x ~= -1 then
        toast(text)
        event.tap(x,y)
        mSleep(3000)
    end
end
local text = "签到"
local check = widget.find({["text"]="签到",["path"]="/FrameLayout/LinearLayout/FrameLayout/FrameLayout/RelativeLayout/RelativeLayout/RelativeLayout/RelativeLayout/FrameLayout/WebView/ba/WebView/View/View/View/View/View/View/View"})
if check ~= nil then
    x,y,x1,y1 = widget.region(check)
    if x ~= -1 then
        toast(text)
        event.tap(x,y)
        mSleep(3000)
    end
end

免费评分

参与人数 1吾爱币 +1 热心值 +1 收起 理由
涛行 + 1 + 1 我很赞同!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

 楼主| lisaisacat 发表于 2020-9-28 18:06
leonca 发表于 2020-9-28 17:47
这个牛啊,这个如果可以做成云函数就好了,那样就真的完全不用管了

不懂就要问,神马叫云函数?其实这个还是在界面上找元素,没有脱离手机的运行环境,而且支付宝是个很常用的软件也没办法托管到云手机之类的吧
 楼主| lisaisacat 发表于 2020-9-29 16:58
dokuro 发表于 2020-9-29 14:46
积木编程 中运行?能不能在做一个切换账号领的,我有很几个账号

我记得支付宝本身就支持切换账号吧,这软件支持可视化编程,你可以自己试试,我是测试时候写的这些源码。
leonca 发表于 2020-9-28 17:47
这个牛啊,这个如果可以做成云函数就好了,那样就真的完全不用管了
 楼主| lisaisacat 发表于 2020-9-28 18:10
leonca 发表于 2020-9-28 17:47
这个牛啊,这个如果可以做成云函数就好了,那样就真的完全不用管了

我百度了下微信开放平台有云函数,找技术同事研究下看看,感觉挺有意思的
good-idea 发表于 2020-9-28 18:19
不懂就要问,怎么使用呢?
 楼主| lisaisacat 发表于 2020-9-28 20:36
good-idea 发表于 2020-9-28 18:19
不懂就要问,怎么使用呢?

复制代码 - 打开软件 - 新建脚本 - 粘贴代码 - 运行
yzqhj 发表于 2020-9-28 21:31
用什么软件哎?
 楼主| lisaisacat 发表于 2020-9-28 21:49

百度搜索:触动精灵官网,产品中心里头有,新软件还没弄下来软件著作权没办法上架渠道。
dokuro 发表于 2020-9-29 14:46
积木编程 中运行?能不能在做一个切换账号领的,我有很几个账号
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2025-5-19 06:22

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表