---
# System prepended metadata

title: 168ROO爱如初见 70%自动主线
tags: [按鍵精靈 2014.6]

---

---
tags: 按鍵精靈 2014.6
---
[YouTube]()
# 168ROO爱如初见 70%自动主线

1.168ROO自動任務960X540
![image](https://hackmd.io/_uploads/rkLDCUTp1g.png)
```
[General]
SyntaxVersion=2
BeginHotkey=97
BeginHotkeyMod=4
PauseHotkey=98
PauseHotkeyMod=4
StopHotkey=99
StopHotkeyMod=4
RunOnce=1
EnableWindow=
MacroID=6dadb9a3-4e47-42f2-a337-9776b6264915
Description=168ROO自動任務960X540
Enable=1
AutoRun=0
[Repeat]
Type=1
Number=1
[SetupUI]
Type=1
QUI=Form1
[Relative]
SetupOCXFile=
[Comment]

[Script]
//獲得桌面宽高
ScreenX = Plugin.Sys.GetScRX()
ScreenY = Plugin.Sys.GetScRY()

//TracePrint ScreenX
//TracePrint ScreenY

//獲得视窗ID
HwndEx = Plugin.Window.SearchEx("LDPlayerMainFrame","2",0)
//下面这句用于分割字符串,将获得的句柄组分割   
dim MyArray   
MyArray = Split(HwndEx, "|")   
WID = Clng(MyArray(0))

//设定视窗起始位置与大小1002,575
Call Plugin.Window.Move(WID, ScreenX-1002, 0)
Call Plugin.Window.Size(WID, 1002, 575)

//获得视窗起始位置的WX与WY点
//下面这句是得到窗口句柄的客户区大小   
sRect = Plugin.Window.GetWindowRect(WID)   
//MsgBox "得到窗口句柄的客户区大小为："& sRect   
//下面这句用于分割字符串,将横坐标和纵坐标分成两个字符串   
dim MyArrayB   
MyArrayB = Split(sRect, "|")   
//下面这句将字符串转换成数值   
L = Clng(MyArrayB(0)): T = Clng(MyArrayB(1))   
R = Clng(MyArrayB(2)): B = Clng(MyArrayB(3))   
//Msgbox "左" & L & ",右 " & R & ",上" & T & ",下" & B

WX = L
WY = T
WW = R - L
WH = B - T
//MsgBox WX&"|"&WY

//以下是自动任务主要内容
intX = 0
intY = 0
//判断血条存在与否
FindColorEx WX+75,WY+93,WX+75,WY+93,"65DC95",0,1.0,intX,intY
If intX > 0 And intY > 0 Then 
	//血条存在动作
	intX = 0
	intY = 0
	//动作A
	XA=614
	YA=317
	XB=665
	YB=369
	FindColorEx WX+XA,WY+YA,WX+XB,WY+YB,"FFF2E2",0,0.8,intX,intY
	If intX > 0 And intY > 0 Then 
		//MsgBox "A"
		fileHandle = Plugin.File.OpenFile("C:\Users\0976370081\Downloads\168ROOA.txt")
		Call Plugin.File.CloseFile(fileHandle)
		MoveTo WX + (XA + ((XB - XA) / 2)), WY + (YA + ((YB - YA) / 2))
		Delay 555
		LeftClick 1
		Delay 4000
		Call Plugin.File.DeleteFile("C:\Users\0976370081\Downloads\168ROOA.txt")
	End If
	
	intX = 0
	intY = 0
	//动作B
	XA=711
	YA=436
	XB=802
	YB=475
	FindColorEx WX+XA,WY+YA,WX+XB,WY+YB,"D66C51",0,0.9,intX,intY
	If intX > 0 And intY > 0 Then 
		MoveTo WX + (XA + (XB - XA) / 2), WY + (YA + (YB - YA) / 2)
		Delay 555
		LeftClick 1
	End If
Else 
	//血条不存在动作
	intX = 0
	intY = 0
	//动作C
	XA=723
	XB=387
	FindColorEx WX+XA,WY+XB,WX+XA,WY+XB,"FFFFFF",0,0.9,intX,intY
	If intX > 0 And intY > 0 Then 
		MoveTo WX + XA, WY + XB
		Delay 555
		LeftClick 1
	End If
	
	intX = 0
	intY = 0
	//动作D
	XA=895
	XB=60
	FindColorEx WX+XA,WY+XB,WX+XA,WY+XB,"FFFDFD",0,0.9,intX,intY
	If intX > 0 And intY > 0 Then 
		MoveTo WX + XA, WY + XB
		Delay 555
		LeftClick 1
	End If
	
	intX = 0
	intY = 0
	//动作F
	XA=270
	YA=241
	XB=696
	YB=280
	FindColorEx WX+XA,WY+YA,WX+XB,WY+YB,"D37357",0,0.7,intX,intY
	If intX > 0 And intY > 0 Then 
		//MsgBox "A"
		MoveTo WX + (XA + ((XB - XA) / 2)), WY + (YA + ((YB - YA) / 2))
		Delay 555
		LeftClick 1
	End If
	
	//动作G 点视窗右半边黄色对话
	intX = 0
	intY = 0
	ColorA = "47A5D0"
	FindColorEx WX+(WW/2),WY+(0),WX+WW,WY+WH,ColorA,0,0.7,intX,intY
	If intX > 0 And intY > 0 Then 
		MoveTo intX, intY
		Delay 555
		LeftClick 1
	End If
	
	//动作E(放在最后)
	MoveTo WX + 75, WY + 93
	Delay 555
	LeftClick 1
End If

//intX = 0
//intY = 0
//动作D
//XA=895
//XB=60
//FindColorEx WX+XA,WY+XB,WX+XA,WY+XB,"FFFDFD",0,0.9,intX,intY
//If intX > 0 And intY > 0 Then 
//	MoveTo WX + XA, WY + XB
//	Delay 555
//	LeftClick 1
//End If
```

2.168ROO自按任
![image](https://hackmd.io/_uploads/rJOOA8aayg.png)
```
[General]
SyntaxVersion=2
BeginHotkey=97
BeginHotkeyMod=4
PauseHotkey=98
PauseHotkeyMod=4
StopHotkey=99
StopHotkeyMod=4
RunOnce=1
EnableWindow=
MacroID=1b262140-24e6-48d3-b003-8f46f6487b12
Description=168ROO自按任
Enable=1
AutoRun=0
[Repeat]
Type=1
Number=1
[SetupUI]
Type=1
QUI=Form1
[Relative]
SetupOCXFile=
[Comment]

[UIPackage]
UEsDBBQAAgAIAJ58hFqVZslgvQUAAAhKAAAJABEAVUlQYWNrYWdlVVQNAAd//O9nf/zvZ3/872ftW1lTnEUUPTMDYQaQTbZASMhCEskiCQnZyMKQEDBsAYyWVVo1IpqUw0ANRPHN3+APsCqlPvmiVfruD7BK3/MQffAv5C3g6W+BhoJKb9BOyU3d9DCZnvN19+17+5wOKYT25x/1fz37ue1vbLFbSGF1LYMD0nuJyAOrA5LRz6tra2vx22v7VlL2il4WraFY63J6BT1DT9Mr6W/Qq+jV9Jpw6VFLr6e/SW+gN9Kb6U30FvpBeiu9jX6I3k7voB+hH6Z30o/Rj9KPR/ir+8ux5zaFBf5Z5nrcQ4FtEV9Bx5oZMfF3JV7z2d9uvhq+9MPzRIqvv24M33sXI+iBuaWRSMT4La/BjVv53wYxg1GLJ6iU8MsN8Gc434uYwzhymGe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XDbf6xxW2NzXwz8Ct/iHUu/Ma+GfhV/84J+0bH/rHebjVP0Tuua4x/2/D7f37Vba9Gvg98Mt/L0jjF1x4EqF+8o0BftJz/vOtn5Q6f3Khf9yI9pRq/F2EW/3jDtvbGvi9cKt/3GJ7TQP/EvzqH6JW+9Q/+uBX/7gi4bvgv2I9sxrrfxV++e81Cd/W/u/6iSv+1GvY35b/uNA/BqCnf1yHX/3jBvzqH/3Yqn+Yrn6gf6zjD+3wmb3QP6Y08p/gaj71D1GvXd7/j7J9oDH+23DLf8eCOFbHvyPh+9ZP+jzj2+on4i7vW/r39BcG/f8L97+2+sd9hHfvqvE3AL/6RxZ+9Y9BuNU/hhFyeFX8u3Crf4yzHdHAvwe/+scQ3N7/P4zGpIp/H2757yOI36NVxx+W8Pf1E7/mmz+50D8EA5vQiL8R+NU/3oFf/eMB/Oofo3Crf4j5fF9j/cfgV/8Yh9v7//egx38n4Jf/Tkr4vvWTffNrPvSPh3CnPwLQxndtpYz/L1BLAQIXCxQAAgAIAJ58hFqVZslgvQUAAAhKAAAJAAkAAAAAAAAAAAAAgAAAAABVSVBhY2thZ2VVVAUAB3/872dQSwUGAAAAAAEAAQBAAAAA9QUAAAAA


[Script]
//獲得桌面宽高
ScreenX = Plugin.Sys.GetScRX()
ScreenY = Plugin.Sys.GetScRY()

//TracePrint ScreenX
//TracePrint ScreenY

//獲得视窗ID
HwndEx = Plugin.Window.SearchEx("LDPlayerMainFrame","2",0)
//下面这句用于分割字符串,将获得的句柄组分割   
dim MyArray   
MyArray = Split(HwndEx, "|")   
WID = Clng(MyArray(0))

//设定视窗起始位置与大小1002,575
Call Plugin.Window.Move(WID, ScreenX-1002, 0)
Call Plugin.Window.Size(WID, 1002, 575)

//获得视窗起始位置的WX与WY点
//下面这句是得到窗口句柄的客户区大小   
sRect = Plugin.Window.GetWindowRect(WID)   
//MsgBox "得到窗口句柄的客户区大小为："& sRect   
//下面这句用于分割字符串,将横坐标和纵坐标分成两个字符串   
dim MyArrayB   
MyArrayB = Split(sRect, "|")   
//下面这句将字符串转换成数值   
L = Clng(MyArrayB(0)): T = Clng(MyArrayB(1))   
R = Clng(MyArrayB(2)): B = Clng(MyArrayB(3))   
//Msgbox "左" & L & ",右 " & R & ",上" & T & ",下" & B

WX = L
WY = T
WW = R - L
WH = B - T
//MsgBox WX&"|"&WY

//以下是自动任务主要内容

//PanDuan = 0
If PanDuan < 1 Then
	Call Plugin.File.DeleteFile("C:\Users\0976370081\Downloads\168ROOA.txt")
	PanDuan = PanDuan + 1
	TracePrint PanDuan
End If

//判断全自动存在
intX = 0
intY = 0
XA = 892
YA = 191
ColorA ="E9E7E6"
FindColorEx WX+XA,WY+YA,WX+XA,WY+YA,ColorA,0,0.5,intX,intY
If intX > 0 And intY > 0 Then 
	NumberA = 1
Else 
	NumberA = Int(Form1.InputBox3.Text)
End If

intX = 0
intY = 0
XA = 5
YA = 213
XB = 221
YB = 392
XC = 51
YC = 213
XD=186
YD=68
XE=285
YE=126
FindColorEx WX+XA,WY+YA,WX+XB,WY+YB,"4BB1E1",0,0.9,intX,intY
If intX > 0 And intY > 0 Then 
	//判断另一个脚本动作A创建文件则不动作
	If Plugin.File.IsFileExist("C:\Users\0976370081\Downloads\168ROOA.txt") Then 
		TimeS = Time
	Else 
		//MsgBox "1"
		TimeA = Int(Form1.InputBox1.Text)
		iDead = Plugin.Color.IsDisplayDead(WX + XD, WY + YD, WX + XE, WY + YE, TimeA)
		//MsgBox "2"
		If iDead = True Then 
			//MsgBox "3"
    		//MsgBox "画面卡死！"
    		MoveTo WX+XC,WY+YC
    		Delay 555
    		LeftClick 1
    		TimeS = Time
		End If
		TimeB = DateDiff("s", TimeS, Time)		
		If TimeB >= (Int(Form1.InputBox2.Text)*NumberA) Then 
			MoveTo WX+XC,WY+YC
    		Delay 555
    		LeftClick 1
    		TimeS = Time
		End If
	End If
End If
```

3.168ROO全自動
![image](https://hackmd.io/_uploads/HJtK086a1x.png)
```
[General]
SyntaxVersion=2
BeginHotkey=97
BeginHotkeyMod=4
PauseHotkey=98
PauseHotkeyMod=4
StopHotkey=99
StopHotkeyMod=4
RunOnce=1
EnableWindow=
MacroID=593c5e45-c457-4032-8100-534732572718
Description=168ROO全自動
Enable=1
AutoRun=0
[Repeat]
Type=1
Number=1
[SetupUI]
Type=1
QUI=Form1
[Relative]
SetupOCXFile=
[Comment]

[UIPackage]
UEsDBBQAAgAIAOp8hFoOF4Lx2AMAAAgoAAAJABEAVUlQYWNrYWdlVVQNAAdJ/e9nSf3vZ0n972ftWMtPE0Ec/m3Loy3Yl1CQh5S3ogdJPBoTSySSFCS0ejDRWBGFuCykLYp/DgdPXjTRu3+Aid696MGTd25Sv9mdpUMDuDOzdW3CR36d0nb2m8fvHSYHX7+kvu+9H/hBDbhJYTqoRalD+MzgYiNJFOL/H9RqNffj2hlaCr8hbfwO2V23QzohUUgEEoOcg3RBuiFx5+opAUnxeWk+nqH1sEJb+KtSlm6ThbFMr0kGGWiM+yzjL799XPn16fqbb0aYuGIB92iBrpE6ImQYLn/ohN8s5x1el1/8bo6KlNdYQYzz93HbOY3fHcXvijjvbVqjJSrRJkZZpClk86e47/U6r42PzG7/ZzlDczG/Vd7UMD9i82c15hukB935uvjw7vNPnf1LmGxT5qv6nbr/Cx3J+bzemesrWdQp0RMyFdcQh//r4uHEK39I8H/3aYMqENUVJBX2Hxb4V8Baoqd0F+dgSsZe1/9382d65W8T+Ivg30Xc17h/Q3b/7cL9zyH7MCFlxZX0KPB3CPuv8+dwD6v0Qp7fzpcTEuff2XD/q5rnz/LziAR/hJwcXsRDGMU+tR46A+bfP/7M7bC0WMgWSlYlW1grbzxrEv/k20da8x/A85Thf9bwqgLmf3u5TXnVv6ig/3nYnrzVHdX/JH+eV/7YsfZfwDrWcQ5y0bAf9n+emB/2zt8l8N9C9r9tx4AyxMIa5KJQBvuPklOXe+XvFvjnsXdLz/9Ixz/mr24c7t9E9H2ONbBzt1T8vzR//Mj9l3D+VayBnUPOvgc3EtR142RcwvlnqN738sKfEPhz9vMd+/PCd4z+GT2S/EmBX9d/6Oafuliwtnequa1d3fmqOXyr1y9FaH7Vzn1VtM/2P9L2lxL0bxn8u2A3kYWrIK7An27gZ/nXDvat0oXpV+AX++VO/0m9goxBg1zugRN+c1r/y6/+0xR5jz8sXkb4+yDqT+Yvo/y9H/VnFuOIxP57ydf60xjFOC3BnyF/689B2w688/dRsPUnW2vo0P60609p/btA/tafQxgnJM5/QOCf1Wm++wDd/IHlciyfyhHLxeQRdPwNB8zvR/9hDOOwhP4NUr3/4EP9KW1/Q+Rv/TnJbdor/zD5W3/OYLwswX+R/K0/md2NS/CPULD1Z5aCrT9HScw/S4j/FXrF60BZpBX4xwT+oPtXQUO3/p35uK41f3CvGOj+F1H5mHb/Iw+xpHNQ1n9n/uSqhP2PC/q3ZOv9JqzAVO5/yOr/hMB/B3wvlbsvjv+7QnL9l8kG/7eKO6j8w/p7SuBnUadsM5u8+9V8/zct8PsBWX6/0cr8fwBQSwECFwsUAAIACADqfIRaDheC8dgDAAAIKAAACQAJAAAAAAAAAAAAAIAAAAAAVUlQYWNrYWdlVVQFAAdJ/e9nUEsFBgAAAAABAAEAQAAAABAEAAAAAA==


[Script]
//獲得桌面宽高
ScreenX = Plugin.Sys.GetScRX()
ScreenY = Plugin.Sys.GetScRY()
//TracePrint ScreenX
//TracePrint ScreenY
//獲得视窗ID
HwndEx = Plugin.Window.SearchEx("LDPlayerMainFrame","2",0)
//下面这句用于分割字符串,将获得的句柄组分割   
dim MyArray   
MyArray = Split(HwndEx, "|")   
WID = Clng(MyArray(0))
//设定视窗起始位置与大小1002,575
Call Plugin.Window.Move(WID, ScreenX-1002, 0)
Call Plugin.Window.Size(WID, 1002, 575)
//获得视窗起始位置的WX与WY点
//下面这句是得到窗口句柄的客户区大小   
sRect = Plugin.Window.GetWindowRect(WID)   
//MsgBox "得到窗口句柄的客户区大小为："& sRect   
//下面这句用于分割字符串,将横坐标和纵坐标分成两个字符串   
dim MyArrayB   
MyArrayB = Split(sRect, "|")   
//下面这句将字符串转换成数值   
L = Clng(MyArrayB(0)): T = Clng(MyArrayB(1))   
R = Clng(MyArrayB(2)): B = Clng(MyArrayB(3))   
//Msgbox "左" & L & ",右 " & R & ",上" & T & ",下" & B
WX = L
WY = T
//MsgBox WX&"|"&WY

//NumberA = Plugin.Color.CountColor(WX + XA, WY + YA, WX + XB, WY + YB, ColorA, 0.9)
//TracePrint NumberA


//以下是主程式
//判断是否进入副本，出现任务白字。
intX = 0
intY = 0
XA=370
YA=96
XB=586
YB=117
ColorA = "FAF9F8"
//相近色块大于某数才执行
NumberA = Plugin.Color.CountColor(WX + XA, WY + YA, WX + XB, WY + YB, ColorA, 0.9)
If NumberA >= Int(Form1.InputBox1.Text) Then 
	
	//判断进入副本某区域是否有色块
    FindColorEx WX+XA,WY+YA,WX+XB,WY+YB,ColorA,0,0.9,intX,intY
    If intX > 0 And intY > 0 Then 
        //B 判断是否开启全部魔物
        intX = 0
        intY = 0
        XA = 603
        YA = 204
        XB = 886
        YB = 242
        ColorA = "FFE4B8"
        FindColorEx WX+XA,WY+YA,WX+XB,WY+YB,ColorA,0,0.9,intX,intY
        If intX > 0 And intY > 0 Then 
            //C 关闭全部魔物视窗
            intX = 0
            intY = 0
            XA = 877
            YA = 185
            ColorA = "EA7850"
            FindColorEx WX+XA,WY+YA,WX+XB,WY+YB,ColorA,0,0.9,intX,intY
            If intX > 0 And intY > 0 Then 
                MoveTo WX + XA, WY + YA
                Delay 555
                LeftClick 1
            End If
        Else 
              //B 开启全部魔物
//            intX = 0
//            intY = 0
//            XA = 603
//            YA = 204
//            XB = 886
//            YB = 242
//            ColorA = "FFE4B8"
//            FindColorEx WX+XA,WY+YA,WX+XB,WY+YB,ColorA,0,0.9,intX,intY
//            If intX > 0 And intY > 0 Then 
//            Else
//                MoveTo WX + (XA+(XB-XA)/2), WY + (YA+(YB-YA)/2)
//                Delay 555
//                LeftClick 1
//            End If
            intX = 0
			intY = 0
			XA = 721
			YA = 217
			XB = 773
			YB = 230
			ColorA = "BE7559"
			NumberA = Plugin.Color.CountColor(WX + XA, WY + YA, WX + XB, WY + YB, ColorA, 0.9)
			//TracePrint NumberA
			If NumberA >= 5 Then 	
				XA = 603
            	YA = 204
            	XB = 886
            	YB = 242
            	MoveTo WX + (XA+(XB-XA)/2), WY + (YA+(YB-YA)/2)
                Delay 555
                LeftClick 1
                
                //执行到此时，删除檔案，开启自动按脚本。
                Call Plugin.File.DeleteFile("C:\Users\0976370081\Downloads\168ROOA.txt")
            Else 
            	//A 点开全自动功能
            	intX = 0
            	intY = 0
            	XA = 892
            	YA = 191
            	ColorA = "ECECED"
            	XB = 879
            	YB = 175
            	FindColorEx WX+XA,WY+YA,WX+XA,WY+YA,ColorA,0,0.3,intX,intY
            	If intX > 0 And intY > 0 Then 
            	
            		//执行到此时，创建檔案，暂停自动按脚本。
            		fileHandle = Plugin.File.OpenFile("C:\Users\0976370081\Downloads\168ROOA.txt")
					Call Plugin.File.CloseFile(fileHandle)
            	
                	MoveTo WX + XB, WY + YB
                	Delay 555
                	LeftClick 1
                	Delay 555*2
            	End If
			End If

        End If
    End If
    
End If
```