[General]
Description=命令例子：内存进程Memory插件
BeginHotkey=121
BeginHotkeyMod=0
PauseHotkey=0
PauseHotkeyMod=0
StopHotkey=123
StopHotkeyMod=0
RunOnce=1
EnableWindow=
Enable=0
AutoRun=0
[Repeat]
Type=0
Number=1
[Relative]
SetupOCXFile=
[Comment]
Content=

[Script]
//测试OK
VBSCall RunApp("notepad.exe")
Delay 1000
//下面这句是查找窗口类名(0)或者标题("无标题 - 记事本"),返回找到的句柄Hwnd
Plugin Hwnd = Window.Find(0, "无标题 - 记事本")
MsgBox "查找到的父窗口句柄为："&Hwnd
//下面这句是设置进程优先级为(高于标准(A))
Plugin Memory.SetProcessLive(Hwnd, 4)
MsgBox "返设置进程优先级为(高于标准(A))"
//下面这句是返回进程优先级返回到变量(Live)
Plugin Live = Memory.GetProcessLive(Hwnd)
MsgBox "返回进程优先级为："&Live
//下面这句是结束句柄(Hwnd)进程
Plugin Memory.TerminateProc(Hwnd)
MsgBox "结束句柄进程"
//===========================================================================
VBSCall RunApp("winmine.exe")
Delay 1000
Plugin hwnd=Window.Find(0,"扫雷")
Dim x, y
//x, y中分别保存当前扫雷的长与宽的格子数量
Plugin x=Memory.Read32Bit(hwnd,&h1005334)
Plugin y=Memory.Read32Bit(hwnd,&h1005338)
MsgBox "扫雷的长与宽的格子数量为：" &x& "  *  " &y&"格"
//下面这句是从内存地址范围开始(&H7D7045B4到&H7D8045B4)以步长为(2)进行搜索内存字符串("雷")地址
Plugin DiZhi = Memory.FindString(Hwnd, "雷", &H7D7045B4, &H7D8045B4, 2)
MsgBox "搜索到第一个""雷""字内存地址为：&H" & Hex(DiZhi)
//下面这句是读取内存字符串(&H7D7A45B4)内存地址返回到变量(z)
Plugin z = Memory.ReadString(Hwnd, Clng(DiZhi), 2)
MsgBox "读到的内存字符串为：" &z
//建个双重循环，循环所有格子
TestMemory_resut=""
Dim i, j, value, strview
strview="说明：@代表安全，*代表雷" & vbcrlf
i=0
For x
    j=0
    For y
        Plugin value=Memory.Read8Bit(hwnd,&h1005360+(j+i*32+1))
        If value=&h8A or value=&h8F
            strview=strview & " *"
        Else 
            strview=strview & " @"
        EndIf 
        j=j+1
    EndFor 
    strview=strview & vbcrlf
    i=i+1
EndFor 
TestMemory_resut="扫雷测试:" & strview
MsgBox TestMemory_resut
//关闭扫雷
Plugin Window.Close(hwnd)
MsgBox "关闭扫雷游戏"
