#include-once
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include "NewASM.au3"
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_UseUPX=n
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
Opt("TrayMenuMode", 1)
;----------界面部分--------------开始--------
Local $GUI
Local $tab
Local $tab0
Local $tab1
Local $tab2
Local $tab3
Local $tab4, $tab4_List_Mob, $tab4_List_Mob_Attack, $tab4_Button_Break_Mob, $tab4_Button_Add_Mob, $tab4_Button_Del_Mob
Local $tab5
Local $Button_Start
Local $Button_Stop
Local $Button_Save
Local $Button_Hide
Const $GAMENAME = 'SRO_Client'
$GUI = GUICreate("精灵外挂 v1.0", 600, 400)
GUISetFont(9, 300)
$tab = GUICtrlCreateTab(10, 10, 580, 350)
$tab0 = GUICtrlCreateTabItem("启动游戏")
$tab1 = GUICtrlCreateTabItem("基本设置")
$tab2 = GUICtrlCreateTabItem("技能设置")
$tab3 = GUICtrlCreateTabItem("宠物过滤")
$tab4 = GUICtrlCreateTabItem("打怪过滤")
$Group=GUICtrlCreateGroup('周围怪物', 15, 40, 230, 310)
$tab4_List_Mob = _GUICtrlListBox_Create($GUI, "", 20, 60, 220, 293)
$Group=GUICtrlCreateGroup('只打怪物(没有设置表示打全部)', 350, 40, 230, 310)
$tab4_List_Mob_Attack = _GUICtrlListBox_Create($GUI, "", 355, 60, 220, 293)
$tab4_Button_Break_Mob = GUICtrlCreateButton("刷新怪物", 262, 50, 70, 25)
$tab4_Button_Add_Mob = GUICtrlCreateButton("增加选中", 262, 150, 70, 25)
$tab4_Button_Del_Mob = GUICtrlCreateButton("删除选中", 262, 180, 70, 25)
$tab5 = GUICtrlCreateTabItem("记录消息")
GUICtrlCreateTabItem("")
GUICtrlCreateLabel("F5开始挂机,F6停止挂机,F7设置外挂", 20, 375, 250, 25)
$Button_Start = GUICtrlCreateButton("开始挂机", 440, 365, 70, 25)
$Button_Stop = GUICtrlCreateButton("停止挂机", 520, 365, 70, 25)
$Button_Save = GUICtrlCreateButton("保存设置", 440, 3, 70, 25)
$Button_Hide = GUICtrlCreateButton("隐藏窗口", 520, 3, 70, 25)
GUISetState()
;----------界面部分--------------结束--------
While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
Case -4
Tray()
;----------------------打怪过滤动作
Case $tab4_Button_Break_Mob
$w_Handle = GetProcessHandle()
If $w_Handle <> 0 Then
_GUICtrlListBox_ResetContent($tab4_List_Mob)
_GUICtrlListBox_BeginUpdate($tab4_List_Mob)
Dim $eax, $ecx
Dim $type, $name, $mob_id
$eax = _MemoryRead($w_Handle, 0xA87018)
While 1
$ecx = $eax - 0xCC
$type = _MemoryRead($w_Handle, _MemoryRead($w_Handle, $ecx))
If $type <= 0 Then ExitLoop
If $type = 7566112 Then
If _MemoryRead($w_Handle, $ecx + 0x118) > 0x10 Then
$name = _MemoryRead($w_Handle, _MemoryRead($w_Handle, $ecx + 0x104), 'char[200]')
Else
$name = _MemoryRead($w_Handle, $ecx + 0x104, 'char[200]')
EndIf
$mob_id = _MemoryRead($w_Handle, $ecx + 0x184)
_GUICtrlListBox_AddString($tab4_List_Mob, $name & '|' & $mob_id)
EndIf
$eax = _MemoryRead($w_Handle, $eax + 0xC)
WEnd
_GUICtrlListBox_EndUpdate($tab4_List_Mob)
EndIf
Case $tab4_Button_Add_Mob
$text = _GUICtrlListBox_GetText($tab4_List_Mob, _GUICtrlListBox_GetCurSel($tab4_List_Mob))
If _GUICtrlListBox_FindInText($tab4_List_Mob_Attack, $text) = -1 Then
_GUICtrlListBox_BeginUpdate($tab4_List_Mob_Attack)
_GUICtrlListBox_AddString($tab4_List_Mob_Attack, $text)
_GUICtrlListBox_EndUpdate($tab4_List_Mob_Attack)
EndIf
Case $tab4_Button_Del_Mob
;----------------------
Case $Button_Start
Case $Button_Stop
Case $Button_Save
Case $Button_Hide
Tray()
EndSwitch
Switch TrayGetMsg()
Case -13
Tray()
EndSwitch
WEnd
Func GetProcessHandle()
Dim $Hawd, $Pid, $w_Handle
$Hawd = WinGetHandle($GAMENAME)
If $Hawd <> 0 Then
GetWindowThreadProcessId($Hawd, $Pid)
$w_Handle = OpenProcess($Pid)
If $w_Handle <> 0 Then
Return $w_Handle
Else
Return 0
EndIf
Else
Return 0
EndIf
EndFunc ;==>GetProcessHandle
Func Tray()
If BitAND(WinGetState($GUI), 2) Then
WinSetState($GUI, "", @SW_HIDE)
Else
WinSetState($GUI, "", @SW_SHOW)
EndIf
EndFunc ;==>Tray
_GUICtrlListBox_Create创建的不能放到选项卡内,其他的都能放,怎么办?