//传入变量youxi
Plugin youxi=WindowEx.EnumWindowA(0,0,"《星尘传说》",65536)
i=UBound(youxi)
//设置环境变量key为1
SetEnvironmentVar "Key0","1"
SetEnvironmentVar "Key1","1"
SetEnvironmentVar "Key2","1"
//......上面3条分线程3个环境变量,如果要开跟多可以加//SetEnvironmentVar "Key3","1"等等
//a为数组下标.c为技能使用延时时间
a=0:cd=2000/(i+1)
//位置可以改变
For i+1
    //设置窗口位置
    Plugin WindowEx.MoveWindow(youxi(a),876,717)
    a=a+1
    Delay 200
EndFor 
//---------设置坐标怪HP条最左颜色-----
x=418:y=78
Gosub 窗口坐标转屏幕坐标
MLx=x:MLy=y
//怪HP随意一点颜色2点判断
x=515:y=105
Gosub 窗口坐标转屏幕坐标
LVx=x:LVy=y
//HP补充位置
x=1004:y=796
Gosub 窗口坐标转屏幕坐标
HPx=x:HPy=y
//MP补充位置
x=994:y=829
Gosub 窗口坐标转屏幕坐标
MPx=x:MPy=y
//循环内设置坐标颜色
Delay 200
//----------------------------主程序----------------------------
While 1
    If a>i
        a=0
    EndIf 
    TracePrint youxi(a)
    //窗口是否激活
    Gosub 是否激活
    Delay 100
    //获取分线程局部变量值
    While 1
        //分线程状态正在执行,则跳这轮循环
        Key0=GetEnvironmentVar("Key0")
        Key1=GetEnvironmentVar("Key1")
        Key2=GetEnvironmentVar("Key2")
        //.....可加,同环境变量
        If Key0=0
            Goto 1
        EndIf 
        If Key1=0
            Goto 1
        EndIf 
        If Key2=0
            Goto 1
        EndIf 
        //.....可加,同环境变量
        //坐标颜色这里设置
        IfColor MLx,MLy,37d861,2
            IfColor LVx,LVy,0,0
                KeyPress 50,1
            EndIf 
        Else 
            IfColor HPx,HPy,63f09e,0
                IfColor MPx,MPy,e6ab67,0
                    KeyPress 32,1
                    Delay 100
                    KeyPress 9,1
                    Delay 100
                    KeyPress 50,1
                EndIf 
            Else 
                BeginThread "Thread"&a
            EndIf 
        EndIf 
        Rem 1
        Delay cd
        a=a+1
    EndWhile 
    //---------------------------子程序--------------------
    Sub 是否激活
        //判断窗口是否激活
        Plugin F=WindowEx.GetWindowState(youxi(a),1)
        TracePrint F
        While F
            Goto 1
        EndWhile 
        //激活窗口
        Plugin WindowEx.SetWindowState(youxi(a),1)
        Delay 100
        Rem 1
    Return 
    Sub 窗口坐标转屏幕坐标
        Plugin WindowEx.ClientToScreen(youxi(a),x,y)
    Return 
    //---------------------------分线程--------------------