Skip to content

Commit af30ac8

Browse files
committed
blog: ant forest rainy
Signed-off-by: 82Flex <82flex@gmail.com>
1 parent 6a031db commit af30ac8

2 files changed

Lines changed: 63 additions & 69 deletions

File tree

blog/2025-04/ant-forest-rainy.mdx

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ tags: [touch, screen, find_color, showcase, lua]
44
---
55

66
import { QRCodeSVG } from 'qrcode.react';
7-
import useBaseUrl from '@docusaurus/useBaseUrl';
87
import VCR from './assets/707aca481a605277b1204639d60b806d.mp4';
98

109
# 蚂蚁森林自动能量雨
@@ -25,10 +24,69 @@ import VCR from './assets/707aca481a605277b1204639d60b806d.mp4';
2524

2625
----
2726

28-
:::note Download
27+
```lua title="自动能量雨@zqbb.lua" showLineNumbers
28+
function 点击(x, y)
29+
if x > 0 then
30+
touch.on(x, y):msleep(10):off()
31+
sys.log("点击" .. x ..",".. y)
32+
end
33+
end
2934

30-
Scan QR code below with “X.X.T.E.” app to get the script.
35+
function 弹窗并退出脚本(tips)
36+
sys.alert(tips)
37+
os.exit()
38+
end
3139

32-
<QRCodeSVG value={"xxt://download/?path=" + encodeURI('自动能量雨@zqbb.lua') + "&url=" + encodeURI('https://xxtou.ch') + encodeURI(useBaseUrl('assets/自动能量雨@zqbb.lua'))} />
40+
;(function(old_init_orien) -- record begin
3341

34-
:::
42+
local play_speed = 1.0 -- Speed
43+
local play_times = 1 -- Repeat Times
44+
45+
local sys_ = {}
46+
for k, v in pairs(sys) do
47+
if k == 'msleep' or k == 'sleep' then
48+
sys_[k] = function(s) v(s / play_speed) end
49+
else
50+
sys_[k] = v
51+
end
52+
end
53+
54+
local sys = sys_
55+
local mSleep = sys.msleep
56+
for l____________i = 1, play_times do
57+
58+
x, y = screen.find_color({
59+
{0, 0, 0x30BE78},
60+
{-56, -12, 0xF6FCF8},
61+
{-64, -3, 0xFFFFFE},
62+
{83, -21, 0xFFFFFF},
63+
{103, 27, 0xFFFFFF},
64+
{11, 25, 0xFFFFFF}
65+
}, 95)
66+
if x < 0 then
67+
弹窗并退出脚本("没找到 立即开启")
68+
end
69+
70+
点击(x, y)
71+
mSleep(2000)
72+
73+
-- 循环执行
74+
local start_time = os.time()
75+
while os.time() - start_time < 17 do
76+
x, y = screen.find_color({
77+
{0, 0, 0x31A301},
78+
{-4, -46, 0xF0FDDD},
79+
{-35, 65, 0x189201},
80+
{47, 66, 0x33A206},
81+
{46, 16, 0x149000},
82+
{-60, 21, 0xD1FA82}
83+
}, 90,0,456,1178,654)
84+
点击(x, y + 60)
85+
86+
mSleep(100)
87+
end
88+
end
89+
90+
touch.init(old_init_orien)
91+
end)(touch.init(0)); -- record end
92+
```

blog/2025-04/assets/自动能量雨@zqbb.lua

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)