小弟我實在不懂手上也有1比0腳本可是就是有錯誤
請大大幫忙修改謝謝
Dim A, B, N, St, M, Back, sColor, runTime, lastTime
Sub main
B = 0
N = 0
// 1:贏家模式,0:輸家模式
M = 1
// 1:回壘模式,0:不回壘模式
Back = 1
// 1:安打模式,0:短棒全壘打模式
A = 1
While 1==1
Call 接受
Call 開始
Call 關閉
Call 過場
Call 跑壘或傳球
Call 投球或打球
Sleep 100
EndWhile
EndSub
// =================點選Start,開始比賽=================
Sub 開始
While (GetPixel(164,703) == 0xDA4238)
MoveTo 900,730
Sleep 100
LClick
LClick
Sleep 1000
EndWhile
MoveTo 512 717
B = 0
N = 0
EndIf
EndSub
// ==================關閉顯示的小視窗===================
Sub 關閉
If (GetPixel(500,325) == 0xFFFFFF) && (GetPixel(618,307) == 0x081678)
MoveTo 618 307
Sleep 100
LClick
LClick
Sleep 100
EndIf
EndSub
// ====================過場點選SKIP====================
Sub 過場
If (GetPixel(978,25) == 0xFFFFFF) && (GetPixel(946,24) == 0xE98993) && (GetPixel(953,26) == 0x422022)
KeyPressH Esc
Sleep 500
EndIf
If (GetPixel(505,254) == 0x1E33FF) && (GetPixel(503,273) == 0xDEDEDD) && (GetPixel(505,285) == 0x929192)
KeyPressH Esc
Sleep 500
EndIf
EndSub
// ===============接受比賽或取消終止比賽=================
Sub 接受
// 接受比賽
If (GetPixel(500,305) == 0xFFFFFF) && (GetPixel(500,315) == 0xDFDFDE) && (GetPixel(500,330) == 0x929192)
MoveTo 455,455
LClick
LClick
Sleep 100
EndIf
EndSub
// ===================判斷投球或打球===================
Sub 投球或打球
// 判斷投球或打球
If (GetPixel(1000,70) == 0xDBDADA) && (GetPixel(423,745) == 0x0000FF)
Sleep 1000
// 判斷先攻的分數
N = 1
If (GetPixel(1000,26) == GetPixel(1000,49)) && (GetPixel(996,23) == GetPixel(996,46)) && (GetPixel(1003,23) == GetPixel(1003,46)) && (GetPixel(1003,31) == GetPixel(1003,54)) && (GetPixel(997,32) == GetPixel(997,55))
N = 0
EndIf
// 判斷打球狀態
B = 0
If (GetPixel(441,647) == 0xFFFBFF) || (GetPixel(566,650) == 0xFFFBFF) || (GetPixel(452,637) == 0x21DBFF) || (GetPixel(555,640) == 0x21DBFF)
B = 1
EndIf
// 贏家模式 - F鍵短打
If (M == 1) && (B == 1)
KeyPressH F
While (GetPixel(423,745) == 0x0000FF)
Sleep 100
EndWhile
EndIf
If B == 0
While (GetPixel(423,745) == 0x0000FF)
Sleep 100
// 投球狀態 - S鍵
KeyPressH S
EndWhile
EndIf
runTime = GetTick()
EndIf
EndSub
// ===================判斷跑壘或傳球===================
Sub 跑壘或傳球
If (GetPixel(849,183) == 0x1E33FF)
If (GetPixel(1000,70) != 0xDBDADA) && (GetPixel(423,745) != 0x0000FF)
// 跑壘
If (B == 1) && (N == 0)
KeyPressH W
If A == 0
KeyPressH Q
EndIf
EndIf
// 傳球
If (B == 0) && (N == 1)
KeyPressH Q
KeyPressH W
St = 0
While (GetPixel(441,647) != 0xFFFBFF) && (GetPixel(566,650) != 0xFFFBFF) && (GetPixel(452,637) != 0x21DBFF) && (GetPixel(555,640) != 0x21DBFF) && (St <= 6)
KeyPressH S
Sleep 500
St = St + 1
EndWhile
EndIf
// 回壘
If (B == 1) && (N == 1) && (Back == 1)
KeyPressH E
Sleep 2000
EndIf
EndIf
// 偵測是否卡回壘
sColor = GetPixel(500,400)
Sleep 100
If (GetPixel(500,400) != sColor)
runTime = GetTick()
EndIf
lastTime = GetTick()
If (GetPixel(500,400) == sColor) && (lastTime - runTime) >= 10000
runTime = GetTick()
KeyPressH Q
Sleep 500
KeyPressH S
Sleep 500
EndIf
EndIf
EndSub |