📄 form1.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmMain
ClientHeight = 4920
ClientLeft = 60
ClientTop = 450
ClientWidth = 4320
Icon = "Form1.frx":0000
LinkTopic = "Form1"
ScaleHeight = 4920
ScaleWidth = 4320
StartUpPosition = 1 '所有者中心
Begin VB.Timer Timer2
Enabled = 0 'False
Left = 480
Top = 1800
End
Begin VB.CheckBox chkGather
Caption = "Gather"
Height = 375
Left = 1080
TabIndex = 4
Top = 0
Width = 855
End
Begin MSComctlLib.ListView lvMonster
Height = 2295
Left = 120
TabIndex = 2
Top = 2520
Width = 4095
_ExtentX = 7223
_ExtentY = 4048
View = 3
LabelWrap = -1 'True
HideSelection = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 5
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "ID"
Object.Width = 1411
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "名称"
Object.Width = 2469
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "X"
Object.Width = 882
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 3
Text = "Y"
Object.Width = 882
EndProperty
BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 4
Text = "类型"
Object.Width = 882
EndProperty
End
Begin VB.CommandButton btnProcess
Caption = "Attach"
Height = 375
Left = 0
TabIndex = 0
Top = 0
Width = 975
End
Begin VB.Timer Timer1
Enabled = 0 'False
Left = 480
Top = 1200
End
Begin MSComctlLib.ListView lvGather
Height = 2415
Left = 2160
TabIndex = 3
Top = 0
Width = 2055
_ExtentX = 3625
_ExtentY = 4260
View = 3
LabelWrap = -1 'True
HideSelection = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 3
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "名称"
Object.Width = 1058
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "X"
Object.Width = 1058
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "Y"
Object.Width = 1058
EndProperty
End
Begin VB.Label lblInfo
Height = 2055
Left = 120
TabIndex = 1
Top = 480
Width = 1935
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub btnProcess_Click()
frmProcess.Show 1
frmProcess.GetProcessList
Me.Caption = Hex(hWndGame) & " | " & Hex(dwProcessId)
Timer1.Interval = 1000
Timer1.Enabled = True
Timer2.Interval = 1000
Timer2.Enabled = True
lDistCur = 1 '目标地点游标,从1开始
End Sub
Private Sub Form_Load()
Dim li As ListItem
Dim x As Long, y As Long, cnt As Long
cnt = 0
Open App.Path & "\pt.txt" For Input As #1
While Not EOF(1)
Input #1, x, y
cnt = cnt + 1
Set li = lvGather.ListItems.Add(, , cnt)
li.SubItems(1) = x
li.SubItems(2) = y
Wend
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
End
End Sub
Private Sub lvMonster_Click()
Debug.Print lvMonster.SelectedItem.SubItems(1), lvMonster.SelectedItem.SubItems(2), lvMonster.SelectedItem.SubItems(3)
End Sub
Private Sub DisplayInfo()
Dim ii As Long
Dim li As ListItem
'读取信息
Call GetCharInfo
Call GetMonster
With lblInfo
'显示角色信息
.Caption = Trim(Left(bbChar.sz, 10))
.Caption = .Caption & vbCrLf & "LV: " & CStr(bbChar.lvl)
.Caption = .Caption & vbCrLf & "ID: " & Hex(bbChar.id)
.Caption = .Caption & vbCrLf & "HP: " & CStr(bbChar.hp) & "/" & CStr(bbChar.hpmax)
.Caption = .Caption & vbCrLf & "MP: " & CStr(bbChar.mp) & "/" & CStr(bbChar.mpmax)
.Caption = .Caption & vbCrLf & "EX: " & CStr(bbChar.exp)
.Caption = .Caption & vbCrLf & "XY: " & CInt(bbChar.x) & "," & CInt(bbChar.y) & "," & CInt(bbChar.z)
.Caption = .Caption & vbCrLf & "SK: " & Hex(lLastSkill) & "/" & Hex(lTargetId)
.Caption = .Caption & vbCrLf & "BS: " & CStr(lBusy)
.Caption = .Caption & vbCrLf & "HL: " & CStr(bbChar.huoli)
.Caption = .Caption & vbCrLf & "JL: " & CStr(bbChar.jingli)
End With
'显示周围怪
lvMonster.ListItems.Clear
For ii = 0 To cntMonster - 1
Set li = lvMonster.ListItems.Add(, , Hex(bbMonster(ii).id))
li.SubItems(1) = Trim(bbMonster(ii).sz)
li.SubItems(2) = CStr(CLng(bbMonster(ii).x))
li.SubItems(3) = CStr(CLng(bbMonster(ii).y))
li.SubItems(4) = Hex(CLng(bbMonster(ii).cls))
Next
End Sub
Private Sub Timer1_Timer()
'走路
If bbChar.jingli < 5 Then Exit Sub
If chkGather.Value = 1 Then
Dim x As Single, y As Single
x = Val(lvGather.ListItems(lDistCur).SubItems(1))
y = Val(lvGather.ListItems(lDistCur).SubItems(2))
Call GetCharXY
If Sqr((x - bbChar.x) ^ 2 + (y - bbChar.y) ^ 2) < 5 Then
lDistCur = lDistCur + 1
If lDistCur > lvGather.ListItems.Count Then lDistCur = 1
End If
Call fnWalk(x, y)
End If
End Sub
Private Sub Timer2_Timer()
'采集
Call DisplayInfo
If bbChar.jingli < 5 Then Exit Sub
If chkGather.Value = 1 Then
Dim jj As Long
For jj = 0 To cntMonster - 1
If bbMonster(jj).cls = 12 Or bbMonster(jj).cls = 13 Then
Timer1.Enabled = False
Call PickPack(bbMonster(jj).id, bbMonster(jj).x, bbMonster(jj).y)
Timer1.Enabled = True
End If
Next
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -