MessageBox	"IP注册次数过多!本程序关闭~~"
Goto	Endw

Rem Endw
EndScript

Sub ToDisplayClient()
//查找窗口类名(WSGAME)或者标题("梦幻西游ONLINE"),返回找到的句柄Hwnd
Hwnd = Plugin.Window.Find(0, "梦幻西游ONLINE")
//检测不到窗口,则转向本程序结束
If Hwnd<=0 Then
Goto	TheEnd
End If
//激活游戏窗口
Call Plugin.Window.Active(Hwnd)

//得到窗口句柄的客户区大小
sRect = Plugin.Window.GetClientRect(Hwnd)

//猎取游戏窗口,左上角坐标(起点定位坐标)
Dim MyArray
MyArray=Split(sRect,"|")
Ux=CLng(MyArray(0))
Uy=CLng(MyArray(1))
Delay DelayTime
End Sub

Sub ToRegisteInterface()
//点击注册账号
MoveTo	Ux+545,Uy+240
//Delay	20
LeftClick	1
Delay	500+DelayTime
End Sub


Sub AccountCreate()
//先创建,再检测
//检测成功继续,失败刚再生成账号
Rem Create
i=i+1
Call	ToDisplayClient()
Call	ToRegisteInterface()
MoveTo	Ux+300,Uy+100
LeftClick	1
Delay	50
SayString ID
Delay	50
KeyPress  CStr(i), 1
Delay	50


MoveTo	Ux+450,Uy+100
//Delay	100
LeftClick	1
Delay	100+DelayTime/2
//检测账号类别
    Call	ToDisplayClient()
    AccountTemp=0
    AccountResult=""
    For 15
        GetColor=GetPixelColor(Ux+165+AccountTemp,Uy+170)
        If GetColor="00FCF8" Then
            AccountTempA = "1"
        Else
            AccountTempA = "0"
        End If
        AccountResult = AccountResult + AccountTempA
        AccountTemp=AccountTemp+1
    Next
    
	If AccountResult=idis Then
//		MessageBox "可用"
		Delay	DelayTime
		Call	Registe()
		
	ElseIf	AccountResult=idno Then
//		MessageBox "不可用"
		Delay	DelayTime
		Call	Registe()
		Goto Create
	Else	
//		MessageBox "没检测到"+AccountResult
		Call	Registe()
		Goto Create
	End If

//密码
Delay	DelayTime  
MoveTo	Ux+300,Uy+125
//Delay	30
LeftClick	1
//Delay	50
SayString PASSWD
Delay	50
//重复密码
MoveTo	Ux+300,Uy+150
//Delay	30
LeftClick	1
//Delay	50