Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

16:10分辨率平板适配 #374

Open
HowcanoeWang opened this issue Aug 15, 2022 · 4 comments
Open

16:10分辨率平板适配 #374

HowcanoeWang opened this issue Aug 15, 2022 · 4 comments

Comments

@HowcanoeWang
Copy link

HowcanoeWang commented Aug 15, 2022

目前手头有一个2800x1752的平板,屏幕比约为16:10,似乎无法成功运行代码,一直提示不在关卡界面

看了一下wiki,好像坐标是用相对位置定死的,所以就算可以手动调节悬浮窗口的界面比例,依然不能通过检测。

image

这种不能手动调节分辨率的情况,有办法解决吗

@dantmnf
Copy link
Collaborator

dantmnf commented Aug 15, 2022

如果可以让游戏全屏(无黑边)运行,那么可以通过 wm size 命令调整分辨率。

Android 直到目前(AOSP master)依然无法针对某个窗口进行截图和控制,小窗/黑边基本上无解:#338#268

@HowcanoeWang
Copy link
Author

HowcanoeWang commented Aug 15, 2022

如果可以让游戏全屏(无黑边)运行,那么可以通过 wm size 命令调整分辨率。

Android 直到目前(AOSP master)依然无法针对某个窗口进行截图和控制,小窗/黑边基本上无解:#338#268

全屏无黑边就是正常的游玩模式,wm size是不是后面还要跟一个参数?翻了一圈没找到API文档,尝试下面代码都不行

python akhelper-gui.pyw wm size

python akhelper-gui.pyw wm size 2160x1080

python akhelper-gui.pyw wm 2160x1080

http://127.0.0.1:46127/?token=1145141919
/home/hwang/Programs/miniconda3/envs/arkautohelper/lib/python3.9/subprocess.py:1048: ResourceWarning: subprocess 33969 is still running
  _warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
kf.kio.core: Malformed JSON protocol file for protocol: "trash" , number of the ExtraNames fields should match the number of ExtraTypes fields
正在现有浏览器会话中打开。
received request {'type': 'web:authorize', 'token': '1145141919'}
client authorized
spawning worker process
starting worker loop
starting worker process
starting worker thread
sending notify web:version 'master-1152+32cfe03'
starting worker process loop
sending notify web:availiable-devices ['R52T40HWCCM (adb connected)', '127.0.0.1:5555 (append)', '127.0.0.1:7555 (append)']
sending notify worker:idle None
received request {'type': 'call', 'action': 'worker:set_refill_with_item', 'args': [True], 'tag': 'Call#0@1660576670781'}
sending notify worker:busy None
sending notify worker:idle None
received request {'type': 'call', 'action': 'worker:set_refill_with_originium', 'args': [False], 'tag': 'Call#1@1660576670798'}
sending notify worker:busy None
sending notify worker:idle None
received request {'type': 'call', 'action': 'worker:set_max_refill_count', 'args': [0], 'tag': 'Call#2@1660576670844'}
sending notify worker:busy None
sending notify worker:idle None
received request {'type': 'call', 'action': 'worker:module_battle_slim', 'args': [10], 'tag': 'Call#3@1660576670888'}
sending notify worker:busy None
 Ξ 设备当前分辨率(2800x1752)不符合要求
 Ξ 需要宽高比等于或大于 16∶9,且渲染高度不小于 720。
sending alert warn 设备当前分辨率(2800x1752)不符合要求 需要宽高比等于或大于 16∶9,且渲染高度不小于 720。 None
sending notify current-device 'eeb9c72ef95380fc'
sending notify worker:idle None

GUI内报错

ValueError: too many values to unpack (expected 2)

  File "/home/hwang/Programs/ArknightsAutoHelper/webgui2/worker.py", line 122, in run
    return_value = func(*args)
  File "/home/hwang/Programs/ArknightsAutoHelper/webgui2/worker.py", line 87, in <lambda>
    "worker:module_battle_slim": lambda count: self.helper.addon('CombatAddon').combat_on_current_stage(int(count)) and None,
  File "/home/hwang/Programs/ArknightsAutoHelper/Arknights/addons/combat.py", line 122, in combat_on_current_stage
    self.operation_once_statemachine(c_id, )
  File "/home/hwang/Programs/ArknightsAutoHelper/Arknights/addons/combat.py", line 395, in operation_once_statemachine
    smobj.state(smobj)
  File "/home/hwang/Programs/ArknightsAutoHelper/Arknights/addons/combat.py", line 158, in on_prepare
    recoresult = imgreco.before_operation.recognize(screenshot)
  File "/home/hwang/Programs/ArknightsAutoHelper/imgreco/before_operation.py", line 102, in recognize
    opidtext = stage_reco(opidimg)
  File "/home/hwang/Programs/ArknightsAutoHelper/imgreco/before_operation.py", line 73, in stage_reco
    return engine.recognize(img, tessedit_char_whitelist='SN-0123456789', tessedit_pageseg_mode='13').text.replace(' ', '')
  File "/home/hwang/Programs/ArknightsAutoHelper/imgreco/ocr/tesseract/cli.py", line 42, in recognize
    for key, value in kwargs:

@dantmnf
Copy link
Collaborator

dantmnf commented Aug 15, 2022

是在 adb shell 里运行 wm size 宽度x高度

@HowcanoeWang
Copy link
Author

是在 adb shell 里运行 wm size 宽度x高度

调整了之后确实可以运行了!

但是每次行动结束,控制台里都会报下面的错误,但不影响运行

Ξ 战斗结束
sending notify wait {'duration': 0.5, 'allow_skip': False}
sending notify wait {'duration': 0, 'allow_skip': False}
sending notify wait {'duration': 0.5, 'allow_skip': False}
sending notify wait {'duration': 0, 'allow_skip': False}
sending notify wait {'duration': 0.5, 'allow_skip': False}
sending notify wait {'duration': 0, 'allow_skip': False}
 Ξ 
Traceback (most recent call last):
  File "/home/hwang/Programs/ArknightsAutoHelper/Arknights/addons/combat.py", line 362, in on_end_operation
    drops = imgreco.end_operation.recognize(smobj.prepare_reco['style'], screenshot, True)
  File "/home/hwang/Programs/ArknightsAutoHelper/imgreco/end_operation.py", line 276, in recognize
    return recognize_ep10(im, learn_unrecognized_item)
  File "/home/hwang/Programs/ArknightsAutoHelper/imgreco/end_operation.py", line 431, in recognize_ep10
    groupresult = tell_group_ep10(group, session, linetop - 71.111*vh, linebottom - 71.111*vh)
  File "/home/hwang/Programs/ArknightsAutoHelper/imgreco/end_operation.py", line 91, in tell_group_ep10
    groupname, diff = tell_group_name_ocr(thim, session)
  File "/home/hwang/Programs/ArknightsAutoHelper/imgreco/end_operation.py", line 162, in tell_group_name_ocr
    ocr_result = engine.recognize(invimg, char_whitelist=all_chars)
  File "/home/hwang/Programs/ArknightsAutoHelper/imgreco/ocr/tesseract/cli.py", line 42, in recognize
    for key, value in kwargs:
ValueError: too many values to unpack (expected 2)
 Ξ 离开结算画面
sending notify wait {'duration': 1.024755686263508, 'allow_skip': False}
sending notify wait {'duration': 0, 'allow_skip': False}
 Ξ  2 次作战完成

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants