Add: Aim clicker in daemon

This commit is contained in:
LmeSzinc 2024-01-17 18:53:33 +08:00
parent 5016f0e53b
commit 6214c8d494
10 changed files with 91 additions and 4 deletions

View File

@ -206,7 +206,8 @@
},
"Daemon": {
"Daemon": {
"Enable": true
"Enable": true,
"AimClicker": "do_not_click"
}
}
}

View File

@ -1374,6 +1374,16 @@
"option_bold": [
true
]
},
"AimClicker": {
"type": "select",
"value": "do_not_click",
"option": [
"item_enemy",
"item",
"enemy",
"do_not_click"
]
}
}
}

View File

@ -277,4 +277,6 @@ Daemon:
value: true
option: [ true ]
option_bold: [ true, ]
AimClicker:
value: do_not_click
option: [ item_enemy, item, enemy, do_not_click ]

View File

@ -148,3 +148,4 @@ class GeneratedConfig:
# Group `Daemon`
Daemon_Enable = True # True
Daemon_AimClicker = 'do_not_click' # item_enemy, item, enemy, do_not_click

View File

@ -950,6 +950,14 @@
"name": "Dialogue Clicker",
"help": "Monitor game, automatically click dialogue, phone chatting, and blessing in simulated universe (follow the simulated universe task settings)",
"True": "Enabled"
},
"AimClicker": {
"name": "Click Aimed Items and Enemies",
"help": "",
"item_enemy": "Click items and enemies",
"item": "Click items only",
"enemy": "Click enemies only",
"do_not_click": "Don't click"
}
},
"Gui": {

View File

@ -950,6 +950,14 @@
"name": "Clic de diálogo",
"help": "Monitorear el juego, hacer clic automáticamente en el diálogo, chatear por teléfono y bendecir en el universo simulado (sigue la configuración de tareas del universo simulado)",
"True": "Activado"
},
"AimClicker": {
"name": "Haz clic en Objetos y enemigos apuntados",
"help": "",
"item_enemy": "Haz clic en elementos y enemigos",
"item": "Haz clic solo en elementos",
"enemy": "Haz clic solo en enemigos",
"do_not_click": "No hacer clic"
}
},
"Gui": {

View File

@ -950,6 +950,14 @@
"name": "Daemon.Enable.name",
"help": "Daemon.Enable.help",
"True": "True"
},
"AimClicker": {
"name": "Daemon.AimClicker.name",
"help": "Daemon.AimClicker.help",
"item_enemy": "item_enemy",
"item": "item",
"enemy": "enemy",
"do_not_click": "do_not_click"
}
},
"Gui": {

View File

@ -950,6 +950,14 @@
"name": "剧情连点器",
"help": "监听画面自动点击剧情、手机聊天、模拟宇宙祝福(遵循模拟宇宙任务设置)",
"True": "已启用"
},
"AimClicker": {
"name": "点击被瞄准破坏物和敌人",
"help": "",
"item_enemy": "点击破坏物和敌人",
"item": "仅点击破坏物",
"enemy": "仅点击敌人",
"do_not_click": "不点击"
}
},
"Gui": {

View File

@ -950,6 +950,14 @@
"name": "劇情連點器",
"help": "監聽畫面自動點擊劇情、手機聊天、模擬宇宙祝福(遵循模擬宇宙任務設定)",
"True": "已啟用"
},
"AimClicker": {
"name": "點擊被瞄準破壞物和敵人",
"help": "",
"item_enemy": "點擊破壞物和敵人",
"item": "僅點擊破壞物",
"enemy": "僅點擊敵人",
"do_not_click": "不點擊"
}
},
"Gui": {

View File

@ -1,18 +1,45 @@
from module.base.timer import Timer
from module.daemon.daemon_base import DaemonBase
from module.logger import logger
from tasks.base.assets.assets_base_daemon import *
from tasks.base.main_page import MainPage
from tasks.base.page import page_main, page_rogue
from tasks.daily.assets.assets_daily_camera import PICTURE_TAKEN
from tasks.map.assets.assets_map_bigmap import TELEPORT_RIGHT
from tasks.map.interact.aim import AimDetectorMixin
from tasks.rogue.route.base import RouteBase
class Daemon(RouteBase):
class Daemon(RouteBase, DaemonBase, AimDetectorMixin):
aim_interval = Timer(0.3, count=1)
def handle_aim_click(self, item=True, enemy=True):
"""
Args:
item:
enemy:
Returns:
bool: If clicked
"""
if not item and not enemy:
return False
if not self.is_in_main():
return False
if self.aim_interval.reached_and_reset():
self.aim.predict(self.device.image, item=item, enemy=enemy)
if self.aim.aimed_enemy:
if self.handle_map_A():
return True
if self.aim.aimed_item:
if self.handle_map_A():
return True
return False
def run(self):
# Rebind daemon settings along with rogue settings
self.config.bind('Daemon', func_list=['Rogue'])
self.device.disable_stuck_detection()
teleport_confirm = Timer(1, count=5)
while 1:
@ -65,3 +92,9 @@ class Daemon(RouteBase):
continue
if self.handle_event_option():
continue
# Aim click
if self.handle_aim_click(
item='item' in self.config.Daemon_AimClicker,
enemy='enemy' in self.config.Daemon_AimClicker,
):
continue