话不多说先上代码,后面有一些注意事项也请仔细阅读。
脚本代码
Dim hwnd
Dim LTX, LTY, RBX, RBY, screenWidth, screenHeight
Dim position, playing
Sub locate_screen
hwnd = find_hwnd("MuMu模拟器12", "nemudisplay")
screenRect = Plugin.Window.GetClientRect(hwnd)
LTX = split(screenRect, "|")(0)
LTY = split(screenRect, "|")(1)
RBX = split(screenRect, "|")(2)
RBY = split(screenRect, "|")(3)
screenWidth = RBX - LTX
screenHeight = RBY - LTY
End Sub
Sub start_fishing
MoveTo LTX + (CInt(screenWidth) * 9 / 10), LTY + (CInt(screenHeight) * 2 / 3)
LeftClick 1
Delay 500
MoveTo LTX + (CInt(screenWidth) / 2), LTY + (CInt(screenHeight) * 9 / 10)
LeftClick 1
playing = 1
End Sub
Call locate_screen
Function find_hwnd(fatherTitle, title)
fatherHwnd = Plugin.Window.Find(0, fatherTitle)
If fatherTitle = title Then
find_hwnd = fatherHwnd
Else
tempHwnd = 0
While tempHwnd = 0
tempHwnd = Plugin.Window.FindEx(fatherHwnd, 0, 0, title)
If tempHwnd = 0 Then
fatherHwnd = Plugin.Window.FindEx(fatherHwnd, 0, 0, 0)
End If
Wend
End If
find_hwnd = tempHwnd
End Function
While True
Call start_fishing
Delay 4000
While playing = 1
tempx1 = CInt(LTX) + CInt(screenWidth) * 8 / 30
tempx2 = CInt(LTX) + CInt(screenWidth) * 22 / 30
tempy = CInt(LTY) + CInt(screenHeight) * 4.2 / 17
iNum1 = Plugin.Color.GetBlockRange(tempx1, tempy, tempx2, tempy, "ADCB10", 1)
iNum2 = Plugin.Color.GetBlockRange(tempx1, tempy, tempx2, tempy, "FFFFFF", 1)
iNum3 = Plug