Code Monkey home page Code Monkey logo

edautopilot-v2's Introduction

๐Ÿฆธ About me

  • A none-stack developer but always willing to learn new technologies.
  • Currently majoring in mechanics engineering at SMEE of UESTC.
  • I'm interested in Embedded Platform Development and so on.
  • Doing some researches on Sensorless FOC Drive.
  • I love the beauty of control systems.

๐Ÿ“„ Notes

  • If you have any problem about my work, feel free to submit issues on my repo directly or send email to me.
  • Other ways to contact me may result in slow response.

๐Ÿ“ˆ Statistics

Do not go gentle into that good night... - Dylan Thomas (1914โ€“1953)

edautopilot-v2's People

Contributors

dependabot[bot] avatar dlacoding avatar matrixchung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

edautopilot-v2's Issues

'ScriptSession' object has no attribute 'update'

Hey there,

the method ScriptSession.update() does not exist.

[12:52:50][WARN] Traceback (most recent call last):
  File "C:\Users\super\Desktop\EDAutopilot\scripts\robigo.py", line 273, in run
    session.update()
AttributeError: 'ScriptSession' object has no attribute 'update'

I don't know if this is related to this issue, but when I run robigo.py the script crashes just before selecting "Pick Cabin"

Have a nice day,
supermopf

Some image matchings are no need

Many matchings in robigo.py should be replaced by keyboard operations which are lot more robust and compatible, such as setRoute() to Robigo / Sothis can be replaced by newly-implemented session.setTargetSystem() and so on.
Odyssey support will be provided to robigo.py and entire autopilot soon.

Keybinding mappings

In the keybinds.py file, it is not clear what the following keys are to be mapped to in the game

    'space': 0x39,                          # what ED function?   
    'UI_1': 0x02, # Key 1               # Are these four associated with UI panel selection?
    'UI_2': 0x03, # Key 2
    'UI_3': 0x04, # Key 3
    'UI_4': 0x05, # Key 4
    'enter': 0x1C, # Key RETURN(ENTER)             # doesn't seem to be used
    'esc': 0x01, # Key ESC                                     # is there a specific ED function?

align is not working

I made the configurations said in the Readme but something is missing I think...

When aling is called nothing happens, but if I do the aling manually then is recognised (isAligned =1). I tried to modify the code but cant get the logic behind this point...

Weird thing happens (or maybe not): I have noticed that when isAligned = 1, targetX and targetY usually stay at =-1. Infact, to se values different than -1 I have to not center the navPointImg.

It may be anything related to graphics (like shades, etc?)

Seems to work but it does nothing.

I've been trying this for a while, i followed the instructions exactly and i get the program running, then i click the home button but nothing happens, it keeps running indefinitely without doing anything (i left it for like 10 minutes, but does not get the missions)
image
(yes, i have the game focused, this image is just to show you the status panel)

Again maybe i messed up with the keybinds, but they are the same as my game. And so with the resolution and primary screen.
FOV and GUI are good aswell.

image

Mission Selection and Auto Align not working

I did everything to set the script up like it is said in the readme file. The GUI tells me no error. When I start the script with HOME after going in to the passenger lounge, the script begins to click on the three contacts for passenger missions in a loop. It doesn't end, even after 20 minutes. No mission gets selected.

I even tried to start the script at a later point. For example TRUST_UP, when I left the station. Now the script works, until the ship has to align itself. Now the script stops (nothing happens) and crashes after a minute.

What have i done wrong? Does it have to do with recognizing the screen elements, because all other parts are working?

Using user keybindings

Recommending using either skai's routines that process user key bindings (in dev_autopilot.py: get_latest_keybinds(), get_bindings()) or the sumzer0-git EDKeys.py (https://github.com/SumZer0-git/EDAPGui.git. which puts skia's functions into a class). These routines looks up the users key bindings for the required ED functionality. This way we won't have to change our bindings between APs

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

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

wrong path for image in utils

When runing Robigo.py these warns appeared:

 [ WARN:[email protected]] global D:\a\opencv-python\opencv-python\opencv\modules\imgcodecs\src\loadsave.cpp (239) cv::findDecoder imread_('templates/dest_circle.png'): can't open/read file: check file path/integrity
            Now Creating SharedMemory Block...
            SharedMemory Block Created:  shm_Session_1
            Watchdog for Session_1 is enabled
            Image and Event Processes Started
            [ WARN:[email protected]] global D:\a\opencv-python\opencv-python\opencv\modules\imgcodecs\src\loadsave.cpp (239) cv::findDecoder imread_('templates/dest_circle.png'): can't open/read file: check file path/integrity
            [ WARN:[email protected]] global D:\a\opencv-python\opencv-python\opencv\modules\imgcodecs\src\loadsave.cpp (239) cv::findDecoder imread_('templates/dest_circle.png'): can't open/read file: check file path/integrity
            [ WARN:[email protected]] global D:\a\opencv-python\opencv-python\opencv\modules\imgcodecs\src\loadsave.cpp (239) cv::findDecoder imread_('templates/dest_circle.png'): can't open/read file: check file path/integrity

The problem with this line of code:

destCircleImg = cv2.imread("templates/dest_circle.png",0)

If I declare your funcion joinPath at the begining and change your destCircleImg for destCircleImg = cv2.imread(joinPath("templates/dest_circle.png"),0) fix the problem

auto keybinding issues

As many other players in ED I have a josytick to play. My primary controls usually are mapped to it but not all. I assume its only parsing the primary?

Parsing keybinds: Custom
JOY_3 is not in SCANCODE list!!
POS_JOY_RZAXIS is not in SCANCODE list!!
NEG_JOY_RZAXIS is not in SCANCODE list!!
JOY_POV1UP is not in SCANCODE list!!
JOY_POV1RIGHT is not in SCANCODE list!!
KEY_ENTER is not in SCANCODE list!!
JOY_2 is not in SCANCODE list!!
JOY_POV1LEFT is not in SCANCODE list!!
JOY_POV1UP is not in SCANCODE list!!
JOY_POV1DOWN is not in SCANCODE list!!
 is not in SCANCODE list!!
 is not in SCANCODE list!!
Error in setting keybind(s): ['UI_Back', 'Pause']
Successfully added 24 keybinds, 2 failed.

when High -value mission is found enters in a loop

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:

  • Find both mission_dest and mission_destHL.
  • IF you cannont find any means there are no more missions available in the screen, break the loop (and go next provider).
  • IF there is a highlight mission click it -> I think here is the problem: when you go back from a mission where you found a hight-value target, that mission keeps highlighted and the loop will enter again as it first looks for a highlight mission.
  • ELSE select the not highligh mission

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)

Robigo Script accepts missions and then gets stuck on passenger mission screen.

I have gone through and changed my settings to exactly as you have them listed. The script will go through, and successfully pick up missions until it fills up all my cabins. But then it will get stuck just going into and out of missions that are "requirement not met". The message in the gui displays "success" at this point.

I know python pretty well, but I have never messed around with computer vision. So, it's possible that I am making a simple, stupid mistake.

Can't quite get all the template images to match

First off: Thanks for building this code. I have experience with cv and python building a couple bots for Star Trek Online. I have been thinking about building one for Elite. It is so nice to read someone else's code and see similar patterns and how they solve problems. And I agree that carriers are too expensive! That is hundreds of days of "just playing the game" to amass the 5b + services + reserve. I would rather put 200 hours into a coding project that then made the money for me :)

Ok, the issue I am having is probably due to slight differences in the graphics settings. I followed your instructions: color pallete, fov, etc. I tried all the intensities 4-8. 5 seems closest. Some images match, some don't. For example, the Plot (highlighted) button on the galaxy map doesn't seem to match,. If I replace the image in templates with one I make from my game screen it DOES match. I notice that my text in my images are "slightly" ore blurry than yours. Could you share your exact graphics "quality settings" so I can see if this is supersampling, texture quality, filtering or something else? I would rather use your images than recapture all of them myself.

Needs to account for supercharge and/or (more importantly) Neutron/White Dwarf Stars

I think adding the ability to see the message about 'use neutron start to supercharge fsd to jump' and then flying into a lobe until it says the fsd is supercharged would be simple enough.

or Setting the ship to orbit the star would work too, as long as it orbited long enough to charge the fsd.

With this feature, you could use the autopilot from the bubble to the opposite end of the galaxy

Key bindings needs a UI_select

When detecting the key bindings every thing is ok but in the robigo script will use the key space rather than the binded in the UI_select control from ED

Color

I use the default Colors in ED. Was thinking to load all the template images and convert to gray scale
image = cv2.cvtColor(image, cv2.COLOR_GRAY2RGB)

Then when grabbing screen captures, to convert that to gray scale also and attempt template matching that way.

This way a user does not have to adjust their ED color scheme.

Thoughts?
(also nice work on the key bindings)

'ScriptSession' object has no attribute 'windowCoord'

When starting the robigo.py via gameui.py and pressing the HomeButton I receive this error:

[22:18:27][WARN] Traceback (most recent call last):
  File "C:\Users\super\Desktop\EDAutopilot\scripts\robigo.py", line 203, in run
    windowCoord = session.windowCoord
AttributeError: 'ScriptSession' object has no attribute 'windowCoord', which is trying to be set.

The class ScriptSession does not seem to have the property 'windowCoord'
https://github.com/Matrixchung/EDAutopilot/blob/84354850eea1682b5c697ec62a28d7f0fa7ba1c8/gameui.py#L92-L146

Have a nice day,
supermopf

Align just working with Python ship?

I am testing your game api with an Aliance Chieftain but when doing the aling it goes crazy as it moves more faster than a Python. How could I adjust the function so it moves slower? I was messing with the KEY_DEFAULT_DELAY value to make the key hold shorter but keeps skiping the center

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.