feat: mining_state 설정 최적화 및 GLM 예외 처리 개선
- `mine_resource` 함수에서 채굴 상태를 매 루프마다 반복 설정하던 로직을 제거하여, 우클릭 유지와 유사한 동작으로 최적화 - GLM API 호출 실패 시 예외 처리 로직을 개선하여, 다양한 오류 원인을 로그로 출력하고 상태 요약 기반의 폴백 로직 추가 - 새로운 연결 검사 스크립트 추가 및 README.md에 GLM API 연결 문제 디버깅 섹션 추가 - 관련 문서 및 주의사항 업데이트
This commit is contained in:
@@ -391,16 +391,17 @@ if res and #res > 0 then rcon.print("YES") else rcon.print("NO") end
|
||||
continue
|
||||
|
||||
# 3. 현재 위치에서 채굴 시도
|
||||
# 우클릭 “유지”: mining_state를 매 루프마다 다시 쓰면 릴리즈 후 재클릭처럼 동작해
|
||||
# 진행이 끊기고 RCON도 과도하게 호출된다. 한 번만 설정하고 틱 동안 그대로 둔다.
|
||||
self.rcon.lua(P + f"""
|
||||
p.update_selected_entity({{x = {mine_x}, y = {mine_y}}})
|
||||
p.mining_state = {{mining = true, position = {{x = {mine_x}, y = {mine_y}}}}}
|
||||
""")
|
||||
stall_count = 0
|
||||
last_item = self._get_item_count(ore)
|
||||
mined_this_tile = False
|
||||
|
||||
for tick in range(300): # 최대 30초
|
||||
# mining_state로 “우클릭 유지”에 가까운 수동 채굴을 시뮬레이션
|
||||
self.rcon.lua(P + f"""
|
||||
p.update_selected_entity({{x = {mine_x}, y = {mine_y}}})
|
||||
p.mining_state = {{mining = true, position = {{x = {mine_x}, y = {mine_y}}}}}
|
||||
""")
|
||||
time.sleep(0.1)
|
||||
|
||||
if tick % 8 == 7:
|
||||
|
||||
Reference in New Issue
Block a user