lolesports觀賽引擎腳本
一、前言
lolesports官網(wǎng)地址:https://lolesports.com/
腳本開源地址:https://github.com/LeagueOfPoro/CapsuleFarmerEvolved
windows系統(tǒng):https://github.com/LeagueOfPoro/CapsuleFarmerEvolved/wiki/Quickstart-Guide-(Windows)
二、使用
(一)可科學(xué)上網(wǎng)
? ? 進(jìn)入網(wǎng)址:https://github.com/LeagueOfPoro/CapsuleFarmerEvolved/releases/tag/v1.4,頁(yè)面最下方下載CapsuleFarmerEvolved.zip后,解壓縮,修改config.yaml配置文件的內(nèi)容,示例:
accounts:
? accountName:
? ? username: "riot account"
? ? password: "riot account password"
注意:accountName隨便起,沒有要求,username和password分別為拳頭賬號(hào)的賬號(hào)名與密碼(即登錄英雄聯(lián)盟的賬號(hào)密碼)。
? ? 配置完成后,雙擊exe文件啟動(dòng)。Status為L(zhǎng)IVE即可。

(二)無(wú)法科學(xué)上網(wǎng)
? ? 不確定是否成功,只是有個(gè)途徑。
? ? 腳本基于Python編寫,下載源碼后,進(jìn)入main.py腳本目錄,打開Windows Shell,使用Python命令:python.exe .\main.py運(yùn)行。

? ? 安裝Python環(huán)境百度即可。對(duì)版本的要求:Windows10/11,Python為>=3.10.1

1.出現(xiàn)CRITICAL ERROR: Beststreams couldn't be loaded. Are you connected to the internet?錯(cuò)誤
? ? 原因:讀取賽區(qū)數(shù)據(jù)時(shí)會(huì)訪問https://raw.githubusercontent.com/LeagueOfPoro/CapsuleFarmerEvolved/master/config/bestStreams.txt,無(wú)法科學(xué)上網(wǎng)或網(wǎng)絡(luò)不好可能訪問不到。其實(shí)作者給了本地的bestStreams.txt,

直接使用讀取文件的方式替換網(wǎng)絡(luò)請(qǐng)求應(yīng)該也可以,最簡(jiǎn)單的是直接把bestStreams.txt寫死即可。
? ? 方法:修改Config.py,將
remoteBestStreamsFile = requests.get(self.REMOTE_BEST_STREAMS_URL)
if remoteBestStreamsFile.status_code == 200:
? ? self.bestStreams = remoteBestStreamsFile.text.split()
三行代碼注釋,新增:
self.bestStreams = ['riotgames', 'lckcl', 'lpl', 'lck', 'lec', 'lcs', 'lco', 'cblol', 'lla', 'riotgamesjp',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'riotgamesturkish', 'lolpacific', 'EUMasters']
其實(shí)就是將項(xiàng)目里的config/bestStreams.txt的內(nèi)容拼成了數(shù)組。

2.運(yùn)行后賬號(hào)一直處于Login狀態(tài),而不是Live???
? ? 原因:可能是因?yàn)橘~號(hào)開啟了郵箱二次認(rèn)證(控制臺(tái)出現(xiàn)Enter 2FA code類似提示文字)。
? ? 方法:要么關(guān)閉郵箱二次認(rèn)證,要么輸入認(rèn)證碼。
? ? 輸入驗(yàn)證碼:
? ? ? ? 運(yùn)行Python腳本后,打開郵箱會(huì)看到拳頭發(fā)送的驗(yàn)證碼,光標(biāo)點(diǎn)到PowerShell里,輸入驗(yàn)證碼回車即可(可能看不到有輸入,但是其實(shí)已經(jīng)輸入了)。
