Matrixchung / EDAutopilot-v2

An autopilot bot for Elite: Dangerous based on computer vision
MIT License
49 stars 12 forks source link

when High -value mission is found enters in a loop #9

Closed DLAcoding closed 2 years ago

DLAcoding commented 2 years ago

When a high-value mission is detected, it goes back to the mission panel and keep selecting the same mission. I am not sure if is related to the offsets or the way the logic works.

result = locateImageInGame(mission_dest,confidence=0.7)
result1 = locateImageInGame(mission_destHL,confidence=0.7)
if result[0]==-1 and result1[0]==-1: break # No more mission
if result1[0]!=-1: pyautogui.moveTo(result1[0]-200,result1[1]) 
else: pyautogui.moveTo(result[0]-200,result[1])

As I understand it sais:

my solution: What I did was simply add a UI_Down to make sure that the next mission at the bottom will be the highlighted

else: # high-value
  if isDebug: print("get-mission: High-value target detected")
  mouseClick(getAbsoluteCoordByOffset(windowCoord,offset_button_reward_back))
  # Now go one down to avoid infinite loop in the same mission
  session.sendKey('UI_Down')
  session.sendDelay(1)
Matrixchung commented 2 years ago

Fixed in 9ca57d0a25a74c1b4dbeb4ac6e2d1c1c791cf89c