📄 hotkey.bas
字号:
Public Sub MHK122() '显示或隐藏窗口 F11
MF.Visible = Not MF.Visible
If MF.Visible = True Then
SetWindowPos MF.hWnd, -1, 0, 0, 0, 0, 3
End If
End Sub
Public Sub CKAutoShout()
Dim i As Integer
Dim tmp As String
tmp = "": MF.TXTShoutS.Text = ""
For i = 1 To 8
MF.LstWD.ListIndex = i - 1
If Left(MF.LstWD.Text, 1) = "√" Then tmp = tmp & MF.LstWD.ListIndex
Next i
If tmp = "" Then
MF.ShoutT.Enabled = True
MF.AutoShout.Value = 0
MF.ShoutDS.ForeColor = &H80000012
MF.ShoutDS.Caption = " "
Else
MF.TS.Interval = 1000
MF.TS.Enabled = True
MF.ShoutDS.ForeColor = &HC0&
II = 0
ShoutCount = 1
End If
MF.LstWD.ListIndex = 0
MF.TXTShoutS.Text = tmp
End Sub
Public Sub MHK35() '自动喊话
If MF.AutoShout.Value = 0 Then
MF.AutoShout.Value = 1
CKAutoShout
Else
MF.AutoShout.Value = 0
MF.TXTShoutS.Text = ""
MF.ShoutDS.Caption = " "
End If
End Sub
Function Getmousehandle() As Long
Dim Y, tid, hWnd As Long
hWnd = GetForegroundWindow()
tid = GetWindowThreadProcessId(hWnd, Y)
If tid = 0 Then
Getmousehandle = 0
Exit Function
End If
If tid <> GetCurrentThreadId() Then
Y = AttachThreadInput(GetCurrentThreadId(), tid, True)
hWnd = GetCursor()
Y = AttachThreadInput(GetCurrentThreadId(), tid, False)
End If
Getmousehandle = hWnd
End Function
Public Sub MHK33()
If MF.txtGJ.Text = "F12开助手" Then Exit Sub
If MF.CKF(4).Value = 1 Then
MF.CKF(3).Value = 0
MF.CKF(4).Value = 0
Else
MF.CKF(3).Value = 1
MF.CKF(4).Value = 1
End If
End Sub
'**********************************DLL
Function WndProc(ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If Msg = WM_USER Then
If wParam = 71 And lParam < 0 And MF.CKALT.Value = 1 Then
Dim aa As POINTAPI: GetCursorPos aa
Sleep 100
If MF.CBMode.Text = "1024*768" Then
SetCursorPos 520, 384
Sleep 300
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
Sleep 300
SetCursorPos 476, 271
Else
SetCursorPos 424, 403
Sleep 300
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
Sleep 300
SetCursorPos 367, 299
End If
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
Sleep 300
SetCursorPos aa.X + 32, aa.Y
End If
If wParam = 122 And lParam < 0 Then MHK122
If wParam = 35 And lParam < 0 Then MHK35
If wParam = 34 And lParam < 0 Then MHK123
If wParam = 45 And lParam < 0 Then
SendMessage MF.hWnd, WM_APPCOMMAND, &H200EB0, APPCOMMAND_VOLUME_MUTE * &H10000
End If
If wParam = 33 And lParam < 0 Then MHK33
If wParam = 123 And lParam < 0 Then
If MF.CBF(0).Enabled <> True And MF.CBF(4).Enabled <> True And MF.txtGJ.Text = "F12开助手" Then
MF.THC.Enabled = False: MF.txtGJ.Text = "Home开挂机"
Dim i As Integer
For i = 0 To 4
MF.CKF(i).Enabled = True
MF.CBF(i).Enabled = True
Next i
MF.Cmd(0).Enabled = True
MF.Cmd(1).Enabled = True
MF.Cmd(2).Enabled = True
MF.HPD.Enabled = True
MF.MPD.Enabled = True
MF.MiNiLife.Enabled = True
MF.CKF(5).Enabled = True
MF.CBT.Enabled = True
End If
End If
If wParam = 36 And lParam < 0 Then
If MF.t36.Text = 0 Then
MF.t36.Text = 1
Else
MF.t36.Text = 0
End If
End If
End If
WndProc = CallWindowProc(prevWndProc, hWnd, Msg, wParam, lParam)
End Function
'**********************************DLL
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function
Public Sub CreateIni() '生成INI文件
Dim FSO, f1
Set FSO = CreateObject("Scripting.FileSystemObject")
Set f1 = FSO.CreateTextFile(GetApp & "myjh.ini", True)
f1.write ("[setting]" & vbCrLf)
f1.write ("加红保护=1500" & vbCrLf)
f1.write ("加蓝保护=400" & vbCrLf)
f1.write ("少血回城=800" & vbCrLf)
f1.write ("KeyPressF0=F3" & vbCrLf)
f1.write ("KeyPressF1=F4" & vbCrLf)
f1.write ("KeyPressF2=F7" & vbCrLf)
f1.write ("KeyPressF3=F6" & vbCrLf)
f1.write ("KeyPressF4=F1" & vbCrLf)
f1.write ("KeyPressF5=F8" & vbCrLf)
f1.write ("ShoutT=12" & vbCrLf)
Dim i As Integer
For i = 1 To 8
f1.write ("LST" & i & "=X:右击修改喊话内容" & vbCrLf)
Next i
f1.Close
End Sub
Public Sub CreateMemoryIni() '生成INI文件
Dim FSO, f1
Set FSO = CreateObject("Scripting.FileSystemObject")
Set f1 = FSO.CreateTextFile(GetApp & "ncjz.ini", True)
f1.write ("[setting]" & vbCrLf)
f1.write ("Memory1=" & vbCrLf) '当前生命
f1.write ("Memory2=" & vbCrLf) '当前内力
f1.write ("Memory3=" & vbCrLf)
f1.write ("Memory4=" & vbCrLf)
f1.write ("Memory5=" & vbCrLf)
f1.write ("Memory6=" & vbCrLf)
f1.write ("Memory7=" & vbCrLf)
f1.write ("Memory8=" & vbCrLf)
f1.write ("Memory9=" & vbCrLf)
f1.write ("Memory10=" & vbCrLf)
f1.write ("Memory11=" & vbCrLf)
f1.Close
End Sub
Public Sub VBShutdown()
RtlAdjustPrivilege SE_SHUTDOWN_PRIVILEGE, 1, 0, 0
NtShutdownSystem shutdown '关机
'NtShutdownSystem restart '重启动
'NtShutdownSystem poweroff '关机
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -