Autotouch tap position between x,y

我正在尝试使用 Autotouch 在我的 iPhone 上设置一个脚本,并且已经将其设置为可用状态,但我想知道是否可以使用 tap xy 函数在给定的范围内按压,以便它不总是按压精确相同的像素,而是在给定范围内具有一定的随机性,以避免易于检测。 我已经注意到 getColor 函数可以在范围内搜索,但是 tap 函数是否也可以在范围内产生按压?

欢迎任何优化代码的提示,因为我很基础。

S1 = getColor(19, 667);

S2 = getColor(335, 465);

S3 = getColor(440, 342);

S4 = getColor(377, 234);

S5 = getColor(310, 206);

S6 = getColor(307, 289);

S7 = getColor(454, 360);

S8 = getColor(215, 665);

if S1 == 16763648 then

tap(266, 892);

elseif S2 == 16221852 then

tap(50, 666);

elseif S3 == 8719371 then

tap(345, 656);

elseif S4 == 11042070 then

tap(82, 669);

elseif S5 == 3530726 then

tap(377, 654);

elseif S6 == 10921638 then

tap(712, 37);

elseif S7 == 8719371 then

tap(321, 471);

elseif S8 == 8870034 then

tap(59, 662);

end

通过我弟弟的帮助,我们成功实现了随机函数, 所以我将更新的代码留在这里供任何有兴趣的人使用。:)

function rndtap(x,y)
x = math.random(x-10,x+10);
y = math.random(y-10,y+10);
tap(x, y);

end

if getColor(19, 667) == 16763648 then
rndtap(266, 892);

elseif getColor(335, 465) == 16221852 then
rndtap(50, 666);

elseif getColor(440, 342) == 8719371 then
rndtap(345, 656);

elseif getColor(377, 234) == 11042070 then
rndtap(82, 669);

elseif getColor(310, 206) == 3530726 then
rndtap(377, 654);

elseif getColor(307, 289) == 10921638 then
rndtap(712, 37);

elseif getColor(454, 360) == 8719371 then
rndtap(321, 471);

elseif getColor(215, 665) == 8870034 then
rndtap(59, 662);

end

欢迎任何进一步的改进建议。

点赞