Matrixchung / EDAutopilot-v2

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

After picking a cabin it opens the filter panel missions and get lost #11

Closed DLAcoding closed 2 years ago

DLAcoding commented 2 years ago

Sometimes (not always) after successfully picked a cabin, when we are back in the mission panel it executes a UI_UP and space causing it to pop up the filter panel of the missions. When the filter panel is open, the destination of the missions gets hidden and stops getting missions from this provider. It is related to the code in the 'get-mission' state and some way is not breaking in time. May be a small delay sould solve it?

for t in range(maxMissionCount):
  backButton = isImageInGame(button_back_smallHL,confidence=0.6)
  acceptButton = isImageInGame(button_accept,confidence=0.7)
  acceptButton_unavail = isImageInGame(button_accept_unavail,confidence=0.8)
  acceptButton_unavailHL = isImageInGame(button_accept_unavailHL,confidence=0.7)
  if backButton == False and (acceptButton or acceptButton_unavail or acceptButton_unavailHL): # ensure we're not targetting the back button and still in the picking board
  if t == 0: # first enumerate
      session.sendKey('space')
      session.sendDelay(1)
  else:
      session.sendKey('UI_Up')
      session.sendDelay(1)
      session.sendKey('space')
      session.sendDelay(1)
  else:
      break
Matrixchung commented 2 years ago

In my tests it sometimes comes to this situation but sometimes it works well. I'm not sure if the problem is as you mentioned, so do more tests 👍

DLAcoding commented 2 years ago

Solved in cecb364