@@ -361,46 +361,6 @@ def action():
361361 self .get_current_char ().send_geniemon_key ()
362362
363363 return self .create_ticker (action , interval = lambda : self .config .get ("技能释放频率" , 5 ), interval_random_range = (0.8 , 1.2 ))
364-
365- def setup_jitter (self ):
366- def _jitter_loop_task ():
367- current_drift = [0 , 0 ]
368- if self .executor .current_task :
369- self .log_info ("jitter loop task start" )
370- while self .executor .current_task is not None and not self .executor .exit_event .is_set ():
371- if self .executor .paused :
372- time .sleep (0.1 )
373- continue
374- if self .afk_config .get ("鼠标抖动强制在游戏窗口内" , True ):
375- self .set_mouse_in_window ()
376-
377- dist_sq = current_drift [0 ]** 2 + current_drift [1 ]** 2
378-
379- # 距离原点太近(<2px) -> 往外润 (3~5px)
380- if dist_sq < 4 :
381- target_x = random .choice ([- 3 , - 2 , 2 , 3 ])
382- target_y = random .choice ([- 3 , - 2 , 2 , 3 ])
383- # 距离原点太远 -> 往回拉 (目标是原点附近的 -1~1px)
384- else :
385- target_x = random .randint (- 1 , 1 )
386- target_y = random .randint (- 1 , 1 )
387-
388- move_x = target_x - current_drift [0 ]
389- move_y = target_y - current_drift [1 ]
390-
391- if move_x != 0 or move_y != 0 :
392- self .genshin_interaction .do_move_mouse_relative (move_x , move_y )
393- current_drift [0 ] += move_x
394- current_drift [1 ] += move_y
395-
396- deadline = time .time () + random .uniform (3.0 , 6.0 )
397- while time .time () < deadline :
398- if self .executor .current_task is None or self .executor .exit_event .is_set ():
399- self .log_info ("jitter loop task stopped" )
400- return
401- time .sleep (0.1 )
402-
403- self .thread_pool_executor .submit (_jitter_loop_task )
404364
405365 def get_round_info (self ):
406366 """获取并更新当前轮次信息。"""
0 commit comments