Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

209 def set_to_carrier(): #3

Open
EuropaSteve opened this issue Mar 4, 2022 · 4 comments
Open

209 def set_to_carrier(): #3

EuropaSteve opened this issue Mar 4, 2022 · 4 comments

Comments

@EuropaSteve
Copy link

EuropaSteve commented Mar 4, 2022

Hello and thank you for fc-macros. I've never really gone anywhere with my Fleet Carrier because it's just to much of a grind/wait to get anywhere. Now I can let the "crew" do their jobs and get me there while I sleep.

fc-macros-0.1.4
When the script gets to:
209 def set_to_carrier():
210 sleep(5)
211 if not ( press_and_find(ED_RIGHT_WINDOW, "inventory") or press_and_find(ED_RIGHT_WINDOW, "inventory_unselected") ): return False
212 sleep(1)
213 if not press_and_find(ED_BACK, "carrier_services"): return False
214 press(ED_UI_SELECT)

507 set_to_carrier()

I hand trouble with the image finds with this and the script still functioned. I commented out the above code and the script still runs as expected.

Also in the list of bindings Next_Panel_Tab (E) is needed by the script.

@pilotso11
Copy link
Owner

That bit does two actions:
1- its a safety check. Most of the image matching is to ensure the script doesn't go off the rails and send you somewhere unexpected (or do something stupid like sell a ship from your shipyard). In theory it could almost all just run with keypresses, but I don't really fancy it going off the wall if ED is just slow - say slow server response on jump, so I added a lot of these safety checks.
2- Its trying to workaround a bug in the latest ED where after a jump the menu is not selectable with the keyboard, you have to move to another HUD screen and back. This could all be done with just a look left and look back.

The great thing about this being open is you can tweak it for your particular setup if needed. You can skip the code or add the extra keypress. You can also try making an png for your "inventory" window text and adding in the images folder as inventory#.png (pick a number not there already). That might help.

@EuropaSteve
Copy link
Author

Thanks, I've redone all the .png files for my cutter and put the above code back and it all works fine. I've never done any coding before but I've added some if/thens so that if the ship cargo bay is full the program aborts the filling process, it then checks the carrier tritium levels if they are also full it skips the fill of the carrier and the second refill of the ship.

I'm having a blast playing with this, Thanks again!

@pilotso11
Copy link
Owner

Glad that worked! Good luck. It should already be stopping the tritium load when it detects the cargo is full (a red icon on the UI). I guess that wasn't working for you. It is one of the saved images, you can try screen capturing your own again.

@pilotso11
Copy link
Owner

The latest build has reworked the UI searching. It is now looking for the text "MAX CAPACITY" on the screen and will stop when that is detected. This should be more reliable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants