• 按键公众号 :
按键精灵电脑版
立即下载

软件版本:2014.06
软件大小:22.9M
更新时间:2021-12-03

按键精灵安卓版
立即下载

软件版本:3.7.2
软件大小:46.2M
更新时间:2023-05-10

按键精灵iOS版
立即下载

软件版本:1.8.0
软件大小:29.2M
更新时间:2023-03-21

按键手机助手
立即下载

软件版本:3.8.0
软件大小:262M
更新时间:2023-05-30

快捷导航

登录 后使用快捷导航
没有帐号? 注册

发新话题 回复该主题

真心求教大佬 这个脚本放在安卓手机按键精灵调试一直不通过,请... [复制链接]

1#
问题点:
第32行第14和31字符没有找到合法的符号
114行第41和69字符也是没有找到合法的符号
下面是代码
'★★★★★ 脚本 v4.0 ★★★★★
'📱 适配版本:按键精灵手机版3.7.2
'⚙️ 最后校验:2024-01-26
'✨ 优化亮点:零宽字符清除 | 全符号半角化 | 语法严格校验

'►►► 全局配置区 ◄◄◄
Dim baseX, baseY, retryMax, logLevel, skillData
baseX = GetScreenX()
baseY = GetScreenY()
retryMax = 3
logLevel = 1
skillData = CreateSkillData()

'►►► 技能数据结构 ◄◄◄
Function CreateSkillData()
Dim data = Array( _
"yinshen", 0.65, 0.3, 23.28, "FF0000-000000", _
"jueji", 0.6, 0.29, 0, "00FF00-101010", _
"jugu", 0.61, 0.31, 58.2, "0000FF-202020", _
"pet", 0.58, 0.25, 15, "FFFFFF-303030", _
"cihunji", 0.63, 0.33, 14.55, "FF00FF-404040", _
"youhuo", 0.59, 0.27, 17.46, "00FFFF-505050", _
"pomeng", 0.64, 0.35, 8.73, "FFFF00-606060", _
"qunxia", 0.62, 0.28, 25, "880000-707070", _
"lingxi", 0.66, 0.37, 7.76, "008800-808080", _
"shigu", 0.67, 0.39, 30, "000088-909090" _
)
CreateSkillData = data
End Function

'►►► 核心逻辑初始化 ◄◄◄
Dim lastUsed(UBound(skillData))
For i = 0 To UBound(skillData) - 1
lastUsed(i) = 0
Next

'►►► 智能点击函数 ◄◄◄
Function SmartTap(ratioX, ratioY, times)
If ratioX < 0 Or ratioX > 1 Or ratioY < 0 Or ratioY > 1 Then
TracePrint "参数错误:比例值应在0-1之间"
Exit Function
End If

Dim realX = baseX * ratioX, realY = baseY * ratioY
Dim offsetRange = 5

For i = 1 To times
Dim offsetX = Random(-offsetRange, offsetRange)
Dim offsetY = Random(-offsetRange, offsetRange)
TouchDown realX + offsetX, realY + offsetY
Delay Random(15,25)
TouchUp realX + offsetX, realY + offsetY
If i < times Then Delay Random(50,100)
Next

If logLevel >= 2 Then TracePrint "点击位置:" & realX & "," & realY
End Function

'►►► 增强型技能检测 ◄◄◄
Function IsSkillReady(index)
If index < 0 Or index > UBound(skillData) Then
TracePrint "技能索引越界:" & index
Return False
End If

Dim skill = skillData(index)
Dim currentTime = GetTickCount()

If skill(3) > 0 And (currentTime - lastUsed(index)) < (skill(3) * 1000) Then
If logLevel >= 2 Then TracePrint skill(0) & "冷却中"
Return False
End If

Dim checkX = baseX * skill(1), checkY = baseY * skill(2)
Dim colorResult = CheckColorEx(checkX, checkY, skill(4), 0.9)
Dim picResult = FindPic(checkX-30, checkY-30, checkX+30, checkY+30, skill(0)&".bmp", 0.8)

Return colorResult = 1 And picResult >= 0
End Function

'►►► 策略决策系统 ◄◄◄
Function SelectSkill()
Dim strategies(1)
strategies(0) = Array("连招1", Array(2,6,8))
strategies(1) = Array("输出循环", Array(1,7,5))

For i = 0 To UBound(strategies)
Dim strategy = strategies(i)
Dim group = strategy(1)
Dim available = True

For j = 0 To UBound(group)
If Not IsSkillReady(group(j)) Then
available = False
Exit For
End If
Next

If available Then
TracePrint "执行策略:" & strategy(0)
Return group
End If
Next

Return Array(9)
End Function

'►►► 主循环控制 ◄◄◄
While True
Dim bestGroup = SelectSkill()

For i = 0 To UBound(bestGroup)
Dim currentSkill = bestGroup(i)
SmartTap skillData(currentSkill)(1), skillData(currentSkill)(2), 1
lastUsed(currentSkill) = GetTickCount()
Next

Delay Random(800, 1200)
Wend

'►►► 异常处理模块 ◄◄◄
Sub OnScriptExit()
TracePrint "脚本安全退出"
End Sub

发新话题 回复该主题