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

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

按键精灵安卓版
立即下载

软件版本:4.0.2
软件大小:45M
更新时间:2025-07-01

按键精灵iOS版
立即下载

软件版本:2.3.3
软件大小:29.2M
更新时间:2025-07-01

按键手机助手
立即下载

软件版本:4.3.0
软件大小:242M
更新时间:2025-07-01

快捷导航

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

发新话题 回复该主题

[问题] 哪个大神帮忙看看代码,打包成小精灵就不能正常运行 [复制链接]

1#
'-----------------------------------------
' 全局变量
'-----------------------------------------
Dim User(6)' 最多 7 个输入框
'-----------------------------------------
' 窗体加载事件
'-----------------------------------------
Sub Form1_Load()
' 初始化输入框
' 按键精灵不支持循环访问控件,所以每个控件单独写
Form1.InputBox1.Text = ""
Delay 50
Form1.InputBox1.SetCueBanner "请输入 TG用户名"
Form1.InputBox2.Text = ""
Delay 50
Form1.InputBox2.SetCueBanner "可选"
Form1.InputBox3.Text = ""
Delay 50
Form1.InputBox3.SetCueBanner "可选"
Form1.InputBox4.Text = ""
Delay 50
Form1.InputBox4.SetCueBanner "可选"
Form1.InputBox5.Text = ""
Delay 50
Form1.InputBox5.SetCueBanner "可选"
Form1.InputBox6.Text = ""
Delay 50
Form1.InputBox6.SetCueBanner "可选"
Form1.InputBox7.Text = ""
Delay 50
Form1.InputBox7.SetCueBanner "可选"
End Sub
'-----------------------------------------
' 启动按钮事件
'-----------------------------------------
Event Form1.Button1.Click
Dim idx
idx = 0
' 检查输入框1是否为空
If Trim(Form1.InputBox1.Text) = "" Then
MsgBox "请先在第一个输入框输入内容!"
Exit Event
End If
' 收集输入框内容
If Trim(Form1.InputBox1.Text) <> "" Then
User(idx) = Form1.InputBox1.Text
idx = idx + 1
End If
If Trim(Form1.InputBox2.Text) <> "" Then
User(idx) = Form1.InputBox2.Text
idx = idx + 1
End If
If Trim(Form1.InputBox3.Text) <> "" Then
User(idx) = Form1.InputBox3.Text
idx = idx + 1
End If
If Trim(Form1.InputBox4.Text) <> "" Then
User(idx) = Form1.InputBox4.Text
idx = idx + 1
End If
If Trim(Form1.InputBox5.Text) <> "" Then
User(idx) = Form1.InputBox5.Text
idx = idx + 1
End If
If Trim(Form1.InputBox6.Text) <> "" Then
User(idx) = Form1.InputBox6.Text
idx = idx + 1
End If
If Trim(Form1.InputBox7.Text) <> "" Then
User(idx) = Form1.InputBox7.Text
idx = idx + 1
End If
'--------------------------------------------
' 创建目录
Dim workDir
workDir = "C:\test_game"
Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FolderExists(workDir) Then
fso.CreateFolder (workDir)
Delay 1000
End If
Delay 500
'--------------------------------------------
' 释放附件
PutAttachment workDir, "*.*"
PutAttachment AppPath & "\Plugin", "RegDll.dll"
PutAttachment AppPath & "\Plugin", "dm.dll"
' 大漠操作函数
'-----------------------------------------
Dim hwnd, x, y, sizeY, i, dm
'-----------------------------------------
' 大漠插件初始化
'-----------------------------------------
' 注册 DLL
Plugin.RegDll.Reg workDir & "\RegDll.dll"
Plugin.RegDll.Reg workDir & "\dm.dll"
' 创建 dm 对象
Set dm = CreateObject("dm.dmsoft")
'判断是否创建dm成功
If dm Is Nothing Then
MessageBox "创建大漠对象失败,无法执行!"
End If
x = 0
y = 239
sizeY = 800

For i = 0 To 6

If Trim(User(i)) <> "" Then

hwnd = dm.FindWindow("Qt51515QWindowIcon", User(i))

Delay 500
If hwnd > 0 Then
dm.BindWindow hwnd, "gdi2", "windows3", "windows", 101
Delay 200
Plugin.Window.Move hwnd, x, y
Delay 100
Plugin.Window.Size hwnd, 605, sizeY
Delay 50
'鼠标移动过去激活窗口
MoveTo x, y
Delay 50
LeftClick 1
Else
Call Plugin.Msg.Tips("未找到窗口")
Delay 1000
End If
x = x + 65
y = y - 30
sizeY = sizeY + 30
Else
Call Plugin.Msg.Tips("判断失败未循环")
Delay 1000
End If
Next
End Event






我的代码 为什么在调试的时候 可以正常使用,只要打包成小精灵 就无法运行了,点击启动完全没有反应 我加了弹窗提示 发现执行创建大漠对象完成后 就不执行了

2#

弹窗不是创建失败吗 那就不运行拉

有事就QQ 136874377 QQ交流群300857068   接各种脚本定做 价格优惠
发新话题 回复该主题