両儀式は最高だ!
meowcolm024 / fgo-automata Goto Github PK
View Code? Open in Web Editor NEW一个FGO脚本和API フェイトグランドオーダー自動化
Home Page: https://meowcolm024.github.io/FGO-Automata/
License: MIT License
一个FGO脚本和API フェイトグランドオーダー自動化
Home Page: https://meowcolm024.github.io/FGO-Automata/
License: MIT License
Traceback (most recent call last):
File "ceshi.py", line 4, in
fgo.quick_start(advance=True)
File "C:\youxi\FGO-Automata-dev\core\Automata.py", line 433, in quick_start
self.select_checkpoint()
File "C:\youxi\FGO-Automata-dev\core\Automata.py", line 221, in select_checkpoint
if util.standby(self.aquire_screenshot(), crds.IMAGE["no_ap"]):
File "C:\youxi\FGO-Automata-dev\core\util.py", line 58, in standby
res = cv2.matchTemplate(img, template, cv2.TM_CCOEFF_NORMED)
cv2.error: OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-k8sx3e60\opencv\modules\imgproc\src\templmatch.cpp:588: error: (-215:Assertion failed) corr.rows <= img.rows + templ.rows - 1 && corr.cols <= img.cols + templ.cols - 1 in function 'cv::crossCorr'
您好,下了新的仓库,选择地图后进入选助战界面报错了
Language:
如果我把assets資料夾內的圖片改成日/美/台服的對應圖片的話,這樣是不是就能無痛適配非國服的FGO了Orz
G:\FGO-Automata-master>python.exe name.py
Traceback (most recent call last):
File "G:\FGO-Automata-master\name.py", line 1, in
from core.Automata import Automata
File "G:\FGO-Automata-master\core\Automata.py", line 3, in
from core import util, crds
File "G:\FGO-Automata-master\core\util.py", line 2, in
from cv2 import cv2
ImportError: Bindings generation error. Submodule name should always start with a parent module name. Parent name: cv2.cv2. Submodule name: cv2
想問下,可以跟你要個QQ號或是信箱或是discord or 其他聯絡方式嗎?
主要有些建議直接可以說明比較方便
PS:因為我懶癌發作不想再重看code修改後發起pull request
或是你可以加我
Discord:(´_ゝ`)#9487
如果不方便在這邊直接公開聯繫方式的話可以寄信到我信箱:[email protected]
I think this tool is using adb to control the mobile phone,which means the PC should be connected to the real phone or use the simulator. I have a Raspberry Pi,I think it can replace the PC. Do you have suggestions about this idea? Or I misunderstand the usage of the repo?
抽池子上千个铜苹果在仓库,手动吃有点痛苦
希望大佬能加上吃铜苹果的选项,感谢
Line 22 in 03efd64
Should be:
sc = f"bb = Automata(\"assets/{ckp}.png\", \"assets/{spt}.png\", ({sft_x}, {sft_y}))"
如果带的礼装有出星,有可能会吞掉开始的技能,比如此次国服泳装活动
推测有额外buff也会有类似问题
另外更新助战之后滑动寻找助战太快了,还没加载出来就滑过了
感谢大佬
Traceback (most recent call last):
File "12-31.py", line 5, in
fgo.quick_start(advance=True)
File "E:\Butter\FGO-Automata\FGO-Automata-0.7.1\core\Automata.py", line 451, in quick_start
self.select_checkpoint()
File "E:\Butter\FGO-Automata\FGO-Automata-0.7.1\core\Automata.py", line 220, in select_checkpoint
self.wait(self.checkpoint)
File "E:\Butter\FGO-Automata\FGO-Automata-0.7.1\core\Automata.py", line 499, in wait
while not util.standby(util.get_sh(self.shifts), pic):
File "E:\Butter\FGO-Automata\FGO-Automata-0.7.1\core\util.py", line 49, in get_sh
screenshot()
File "E:\Butter\FGO-Automata\FGO-Automata-0.7.1\core\util.py", line 32, in screenshot
os.system('adb shell screencap -p /sdcard/sh.png')
KeyboardInterrupt
或者不是bug是我电脑问题?
When I select Servant skill with a target by REPL, the REPL will select a target and return
Traceback (most recent call last):
File "REPL.py", line 7, in
repl.main_loop()
File "C:\fakepath\FGO-Automata\core\Scripter.py", line 141, in main_loop
print(self.itp.evaluate(cmd.replace(' ', '')))
File "C:\fakepath\FGO-Automata\core\Scripter.py", line 62, in evaluate
return self._eval(cmd)
File "C:\fakepath\FGO-Automata\core\Scripter.py", line 103, in _eval
return ('Servant skill: ' + out)
TypeError: can only concatenate str (not "list") to str
I try changing line 103 in Scripter.py
from return ('Servant skill: ' + out)
to return ('Servant skill: ' + str(out))
,
then it seem to run well.
Language:
模拟器已经到达选择关卡的界面(即可以看到自由本名字、奖励的页面)
C:\Users\79261>cd /d D:\FGO-Automata-master
D:\FGO-Automata-master>adb connect 127.0.0.1:21503
connected to 127.0.0.1:21503
D:\FGO-Automata-master>python chentu.py
/sdcard/sh.png: 1 file pulled. 6.2 MB/s (2417720 bytes in 0.374s)
/sdcard/sh.png: 1 file pulled. 5.9 MB/s (2421372 bytes in 0.394s)
/sdcard/sh.png: 1 file pulled. 6.7 MB/s (2424910 bytes in 0.346s)
/sdcard/sh.png: 1 file pulled. 5.9 MB/s (2420982 bytes in 0.393s)
/sdcard/sh.png: 1 file pulled. 6.3 MB/s (2420126 bytes in 0.366s)
模拟器已经到达选择关卡的界面(即可以看到狗粮本名字、奖励的页面)
C:\Users\79261>adb connect 127.0.0.1:21503
connected to 127.0.0.1:21503
C:\Users\79261>cd /d D:\FGO-Automata-master
D:\FGO-Automata-master>python example.py
/sdcard/sh.png: 1 file pulled. 3.7 MB/s (2513660 bytes in 0.653s)
/sdcard/sh.png: 1 file pulled. 5.8 MB/s (2567608 bytes in 0.422s)
/sdcard/sh.png: 1 file pulled. 5.1 MB/s (2489003 bytes in 0.469s)
/sdcard/sh.png: 1 file pulled. 3.9 MB/s (2487221 bytes in 0.602s)
python版本:3.8.2
Package版本
Package Version
--------------------- --------
configparser 5.0.0
cycler 0.10.0
kiwisolver 1.2.0
matplotlib 3.2.1
numpy 1.18.5
opencv-contrib-python 4.2.0.34
opencv-python 4.2.0.34
Pillow 7.1.2
pip 20.1.1
playsound 1.2.2
pyparsing 2.4.7
PyQt5 5.15.0
PyQt5-sip 12.8.0
pytesseract 0.3.4
python-dateutil 2.8.1
setuptools 41.2.0
six 1.15.0
you-get 0.4.1432
从https://github.com/UB-Mannheim/tesseract/wiki下载,64位,默认安装,已加入环境变量
adb
Android Debug Bridge version 1.0.41
Version 29.0.5-5949299
Installed as D:\adb\adb.exe
模拟器
逍遥模拟器 7.2.1 版
分辨率:1920*1080,DPI288
端口:127.0.0.1:21503
py程序文件
用config.bat创建
代码如下
from core.Automata import Automata
# start
fgo = Automata("assets/chentu.png", "assets/cba.png", sft=(0, 0))
fgo.quick_start(advance=True)
# battle1
fgo.select_servant_skill(1, 2)
fgo.select_servant_skill(2)
fgo.select_servant_skill(3, 2)
fgo.select_servant_skill(7, 2)
fgo.select_master_skill(3, 1, 1)
fgo.select_master_skill(1)
fgo.select_cards([7])
# battle2
fgo.select_servant_skill(3)
fgo.select_servant_skill(9, 2)
fgo.select_servant_skill(6)
fgo.select_cards([7])
# battle3
fgo.select_servant_skill(1, 2)
fgo.select_servant_skill(2)
fgo.select_servant_skill(8)
fgo.select_cards([7])
#finish
fgo.finish_battle()
助战、关卡图片:按照模板截取
另外,在试用williamgateszhao大佬的脚本时,也出现了类似的问题(一直截屏,但是不会继续执行)
Language:
Please describe the issue specifically. It's recommended to attach the output log and the screenshot.
请具体描述您遇到的问题。建议附上输出记录和截图。
每次运行脚本之前连接的模拟器就会断开连接 但是在真机上可以运行。使用mumu模拟器 分辨率是1920*1080 DPI 480
以下为报错
`(venvp) E:\Programme\Python\FGO-Automata-master>adb devices & python Qp.py & adb devices
List of devices attached
127.0.0.1:7555 device
List of devices attached
`
First, great project, thanks!
But I found some problems when using automatic battle, the source of these problems are usually caused by failure to interpret battle id, and I tried adding grayscale/binary conversion to solve the problem, now it works well.
for core.util get_battle_id function:
Replace
text = image_to_string(
region, config='--psm 7 --oem 3 -c tessedit_char_whitelist=/1234')
to
THRESHOLD = 200
BINARY_TABLE=[0 if i < THRESHOLD else 1 for i in range(256)]
text = image_to_string(
region.convert('L').point(BINARY_TABLE, '1'), config='--psm 7 --oem 3 -c tessedit_char_whitelist=/1234')
脚本结束一次运行
after-battle related
def finish_battle(self):
while not util.standby(util.get_sh(self.shifts), "assets/item.png"):
xs = util.get_crd(util.get_sh(self.shifts), "assets/close.png")
if len(xs) != 0:
self.tap(xs[0])
self.tap((660, 840), 40, 1)
time.sleep(0.9)
time.sleep(0.9)
x = util.get_crd(util.get_sh(self.shifts), "assets/item.png")
self.tap(x[0])
print("[INFO] Battle Finished.")
def is_finished(self) -> bool:
time.sleep(0.5)
return util.standby(util.get_sh(self.shifts), "assets/finish.png", 0.5)
程序在点击finish.png(下一项)的时候,就默认完成了一次执行。然后就会停留在close.png(关闭),再次出战 的界面上,必须手动点关闭才能进行下一次
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.