📄 frm_main.frm
字号:
VERSION 5.00
Object = "{9E6D742A-9299-11D3-AD1E-00D009224C59}#7.0#0"; "SimpleLink.ocx"
Object = "{EB8EC333-8508-11D2-BA28-0060089950F4}#1.0#0"; "pGif.ocx"
Begin VB.Form frm_main
BorderStyle = 1 'Fixed Single
Caption = "[水果小兔]"
ClientHeight = 2535
ClientLeft = 11445
ClientTop = 2355
ClientWidth = 2925
Icon = "Frm_main.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2535
ScaleWidth = 2925
Begin SimpleLinkOCX.SimpleLink SimpleLink1
Height = 180
Left = 720
TabIndex = 4
Top = 1080
Width = 1980
_ExtentX = 3493
_ExtentY = 318
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkText = "http://www.totang.com/"
AutoSize = -1 'True
LinkType = 1
End
Begin VB.Timer Timer4
Enabled = 0 'False
Interval = 5000
Left = 1080
Top = 2160
End
Begin VB.Frame Frame1
Caption = "操作:"
Height = 855
Left = 0
TabIndex = 0
Top = 1320
Width = 2895
Begin VB.CommandButton Command5
Caption = " 开始 (Ctrl+S)"
Height = 495
Left = 120
TabIndex = 3
Top = 240
Width = 855
End
Begin VB.CommandButton Command6
Caption = " 停止 (Ctrl+S)"
Enabled = 0 'False
Height = 495
Left = 1080
TabIndex = 2
Top = 240
Width = 855
End
Begin VB.CommandButton command1
Caption = "设置"
CausesValidation= 0 'False
Height = 495
Left = 2130
TabIndex = 1
Top = 240
Width = 615
End
End
Begin VB.Timer Timer2
Enabled = 0 'False
Interval = 5000
Left = 600
Top = 2160
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 500
Left = 120
Top = 2160
End
Begin AniGif.GifAni GifAni1
Height = 1035
Left = 0
TabIndex = 7
Top = 0
Width = 2940
_ExtentX = 5186
_ExtentY = 1826
FileData = "Frm_main.frx":08CA
GifFile = "(GIF File)"
Enabled = -1 'True
Autosize = -1 'True
End
Begin VB.Label Label2
Caption = "网站:"
Height = 255
Left = 120
TabIndex = 6
Top = 1080
Width = 615
End
Begin VB.Label Label1
Caption = "版权所有 【兔堂】啤酒兔"
Height = 255
Left = 480
TabIndex = 5
Top = 2280
Width = 2295
End
End
Attribute VB_Name = "frm_main"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Const KEYEVENTF_EXTENDEDKEY = &H1
Const KEYEVENTF_KEYUP = &H2
Dim logerror As Long
Private Sub Command1_Click()
Me.Hide
'Form1.Show
Form5.Show
End Sub
'##################################################################
'## 过程名称:Command5_Click
'## 参数: 无
'##################################################################
Private Sub Command5_Click()
Beginwork
End Sub
Function Beginwork()
'读取ini中已有的各水果信息
If GetIniStr("设置", "模式") = "单局" Then
Command6.Enabled = Not Command6.Enabled
Command5.Enabled = Not Command5.Enabled
Timer1.Enabled = True
Timer4.Enabled = True
Timer2.Enabled = False
Else
Command6.Enabled = Not Command6.Enabled
Command5.Enabled = Not Command5.Enabled
Timer1.Enabled = True
Timer2.Enabled = True
Timer4.Enabled = False
End If
End Function
'##################################################################
'## 过程名称:Command6_Click
'## 参数: 无
'##################################################################
Private Sub Command6_Click()
Timer1.Enabled = False
Timer2.Enabled = False
Timer4.Enabled = False
Command6.Enabled = Not Command6.Enabled
Command5.Enabled = Not Command5.Enabled
End Sub
'##################################################################
'## 过程名称:Form_Load
'## 参数: 无
'##################################################################
Private Sub Form_Load()
Dim ret As Long
preWinProc = GetWindowLong(Me.hwnd, GWL_WNDPROC)
ret = SetWindowLong(Me.hwnd, GWL_WNDPROC, AddressOf wndproc)
idHotKey = 1 'in the range &h0000 through &hBFFF
Modifiers = MOD_CONTROL 'MOD_ALT + MOD_SHIFT
uVirtKey = vbKeyS
ret = RegisterHotKey(Me.hwnd, idHotKey, Modifiers, uVirtKey)
Dim username As String
username = GetIniStr("用户", "昵称")
If username = "" Then
MsgBox "请设置昵称"
Me.Hide
Form4.Show
Else
g_WindowHwnd = FindWindow(vbNullString, "LeapFTP 2.7.1") ' "[水果] " & username & "的房间")
If g_WindowHwnd = 0 Then
logerror = 1
Timer1.Enabled = False
MsgBox ("请先运行[水果总动员]!")
'Unload Me
Exit Sub
End If
If g_WindowHwnd <> 0 Then
'窗口总在前
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
End If
Me.Caption = "[水果小兔]·" & username
'1.粉红桃子
'2.红色苹果
'3.绿色西瓜
'4.蓝色葡萄
'5.紫色葡萄
'6.红色草莓
'7.绿色茄子
'8.黄色香蕉
shuiguox(0) = GetIniStr("粉红桃子", "x")
shuiguox(1) = GetIniStr("红色苹果", "x")
shuiguox(2) = GetIniStr("绿色西瓜", "x")
shuiguox(3) = GetIniStr("蓝色葡萄", "x")
shuiguox(4) = GetIniStr("紫色葡萄", "x")
shuiguox(5) = GetIniStr("红色草莓", "x")
shuiguox(6) = GetIniStr("绿色茄子", "x")
shuiguox(7) = GetIniStr("黄色香蕉", "x")
shuiguoy(0) = GetIniStr("粉红桃子", "y")
shuiguoy(1) = GetIniStr("红色苹果", "y")
shuiguoy(2) = GetIniStr("绿色西瓜", "y")
shuiguoy(3) = GetIniStr("蓝色葡萄", "y")
shuiguoy(4) = GetIniStr("紫色葡萄", "y")
shuiguoy(5) = GetIniStr("红色草莓", "y")
shuiguoy(6) = GetIniStr("绿色茄子", "y")
shuiguoy(7) = GetIniStr("黄色香蕉", "y")
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim ret As Long
'取消Message的截取,而使之又只送往原来的Window Procedure
ret = SetWindowLong(Me.hwnd, GWL_WNDPROC, preWinProc)
Call UnregisterHotKey(Me.hwnd, uVirtKey)
Unload Form1
Unload Form2
Unload Form3
Unload Form4
Unload Me
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If logerror <> 1 Then
Dim IntR As Integer
IntR = MsgBox("确认要退出吗?", vbYesNo, "[水果小兔]")
If IntR = vbNo Then Cancel = -1
End If
End Sub
'##################################################################
'## 过程名称:Timer1_Timer
'## 参数: 无
'##################################################################
Private Sub Timer1_Timer()
killBox
End Sub
Private Sub Timer2_Timer()
'MsgBox getColor(boxs(0, 0).x + 590, boxs(0, 0).y + 465)
'判断是否结束一局,若结束则点击“重玩”/“下一关”
If getColor(boxs(0, 0).x + 590, boxs(0, 0).y + 465) = 13027270 Or getColor(boxs(0, 0).x + 590, boxs(0, 0).y + 465) = -1 Then
Timer1.Enabled = False
mouseClick2
Timer1.Enabled = True
Else
Timer1.Enabled = True
End If
End Sub
'Private Sub Timer3_Timer()
'Call keybd_event(vbKeySpace, 1, 0, 0) ' 模拟按键操作
'Call keybd_event(vbKeySpace, 1, KEYEVENTF_KEYUP, 0) ' 模拟按键操作
'End Sub
Private Sub Timer4_Timer()
'MsgBox getColor(boxs(0, 0).x + 590, boxs(0, 0).y + 465)
'判断是否结束一局,若结束则停止工作
If getColor(boxs(0, 0).x + 590, boxs(0, 0).y + 465) = 13027270 Or getColor(boxs(0, 0).x + 590, boxs(0, 0).y + 465) = -1 Then
Timer1.Enabled = False
Timer2.Enabled = False
Timer4.Enabled = False
Command6.Enabled = Not Command6.Enabled
Command5.Enabled = Not Command5.Enabled
Else
Timer1.Enabled = True
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -