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
Refactor Bot For Code Cleanliness, Improved Performance, and Overall Usability #213
Conversation
Variable Resolution
Thanks! I will try it out today when im home :) |
GJ on all the edits but i cant seem to get it to run =[ this is the error i get. not sure how to fix it yet.. i have a feeling its due to not finding the reference LastResults
|
Thanks for error msg! I did like six mini refactors of various scales while implementing asynchronous stuff so just missed a rename before pushing, lemme fix rq |
roger that will test once you push the update =] |
#206 fixes the GUI freezing bug FYI |
I saw but it doesn't really fix freezing GUI, it just solves for how to work around it. This completely solves freezing GUI and can still integrate in keybinds in a less hacky way since I can forcefully cancel the fishing loop anywhere in the UI now |
Fixed! |
Not sure if others having this issue.. it loads and runs but the loop just does not work properly for me.
it just says in a casting cycle it will cast wait a few seconds then reel in and repeat never getting a fish. |
I changed the base images that image detection is done off of, I need to revert those changes since they were specific to my set up. Suggest also reverting specifically those images |
Just reverted the resouce changes I made to |
@srhinos Idk how you did this but it's working like a charm! Will try to understand this, maybe make some improvements and will let you know |
Mine is not very happy :D When i press "start fishing" it spits this out.
Looks like its not too happy with the 'name' in this function?
EDIT: |
So the changes I’ve made cause the minimum python version to run this to be 3.8, highly suggest installing the most recent version of python regardless but yeah, without the name variable for the task, we can’t search for it and cancel it to stop it.
…
On Oct 28, 2021 at 08:25, <syntax001 ***@***.***)> wrote:
Mine is not very happy :D When i press "start fishing" it spits this out.
bot.py:114: RuntimeWarning: coroutine 'fishing_loop' was never awaited self.asyncio_event_loop.create_task(fishing_loop(self.config), name="fishing_loop") RuntimeWarning: Enable tracemalloc to get the object allocation traceback [ERROR] Exception in callback FishingBoi.do_create_task() handle: <Handle FishingBoi.do_create_task()> Traceback (most recent call last): File "C:\Users\xxxx\AppData\Local\Programs\Python\Python37\lib\asyncio\events.py", line 88, in _run self._context.run(self._callback, *self._args) File "bot.py", line 114, in do_create_task self.asyncio_event_loop.create_task(fishing_loop(self.config), name="fishing_loop") TypeError: create_task() got an unexpected keyword argument 'name'
Looks like its not too happy with the 'name' in this function?
def do_create_task(self): self.asyncio_event_loop.create_task(fishing_loop(self.config), name="fishing_loop")
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (#213 (comment)), or unsubscribe (https://github.com/notifications/unsubscribe-auth/ABR2SQMTY4V3CMVNTPQSO6DUJF2QVANCNFSM5GZ3BNOQ).
Triage notifications on the go with GitHub Mobile for iOS (https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675) or Android (https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub).
|
Ah dang, I'll try Python 3,8. But do you think having Python 3.7.7 also made the image recognition mess up? After removing |
You need to make sure you match the recommended settings that are mentioned in the readme or do what I did and manually take screenshots + replace the current ones with ones based on your own brightness and everything (which is a lot of effort!)
…
On Oct 28, 2021 at 10:00, <syntax001 ***@***.***)> wrote:
>
>
> So the changes I’ve made cause the minimum python version to run this to be 3.8, highly suggest installing the most recent version of python regardless but yeah, without the name variable for the task, we can’t search for it and cancel it to stop it.
> … (#)
> On Oct 28, 2021 at 08:25, <syntax001 @.***)> wrote: Mine is not very happy :D When i press "start fishing" it spits this out. bot.py:114: RuntimeWarning: coroutine 'fishing_loop' was never awaited self.asyncio_event_loop.create_task(fishing_loop(self.config), name="fishing_loop") RuntimeWarning: Enable tracemalloc to get the object allocation traceback [ERROR] Exception in callback FishingBoi.do_create_task() handle: <Handle FishingBoi.do_create_task()> Traceback (most recent call last): File "C:\Users\xxxx\AppData\Local\Programs\Python\Python37\lib\asyncio\events.py", line 88, in _run self._context.run(self._callback, *self._args) File "bot.py", line 114, in do_create_task self.asyncio_event_loop.create_task(fishing_loop(self.config), name="fishing_loop") TypeError: create_task() got an unexpected keyword argument 'name' Looks like its not too happy with the 'name' in this function? def do_create_task(self): self.asyncio_event_loop.create_task(fishing_loop(self.config), name="fishing_loop") — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub (#213 (comment) (#213 (comment))), or unsubscribe (https://github.com/notifications/unsubscribe-auth/ABR2SQMTY4V3CMVNTPQSO6DUJF2QVANCNFSM5GZ3BNOQ). Triage notifications on the go with GitHub Mobile for iOS (https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675) or Android (https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub).
>
>
Ah dang, I'll try Python 3,8. But do you think having Pythong 3.7.7 also made the image recognition mess up? After removing name="fishing_loop" i wasnt able to stop the bot via the button as you said, but the bot had a lot of trouble recognizing when a fish had bit the line, and when to reel.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (#213 (comment)), or unsubscribe (https://github.com/notifications/unsubscribe-auth/ABR2SQL3LMERE2NO2PUI4FLUJGFSBANCNFSM5GZ3BNOQ).
Triage notifications on the go with GitHub Mobile for iOS (https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675) or Android (https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub).
|
My settings should be all good, im running Siterizers version perfectly fine. I just thought i'd clone yours and give it a try but it seems to be really off. Are the pictures the same as the ones provided by Siterizer? Ill give it a try with his pictures instead and see if it makes a difference. |
can anyone share a compiled version? |
Yup, no dependency changes so you should be able to just run `python bot.py` as before and it should work similarly. I cba to compile a version since running it from the terminal is just easier for me.
…
On Oct 29, 2021 at 11:02, <blablub84 ***@***.***)> wrote:
can anyone share a compiled version?
otherwise as long as i apply the changes to the 27 files, and use pyton 3.8 i should be fine with the old compile guide?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (#213 (comment)), or unsubscribe (https://github.com/notifications/unsubscribe-auth/ABR2SQL4MVDGQWCJ5LP3VLTUJLVTTANCNFSM5GZ3BNOQ).
Triage notifications on the go with GitHub Mobile for iOS (https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675) or Android (https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub).
|
@srhinos @blablub84 There are some errors in this version, will try to fix them now |
Okay, new release is here. Tested it for about an hour and it's working. But will be glad about your feedback |
Nice, I like a lot of those changes. I see a new function for processing the image too, that might need to be shifted to be async which I can do if you want but it’s not implemented just right now so no big deal. OpenCV’s image match works a lot better in greyscale but we still want to color version for color matching so it might be helpful to leave as is or refactor the image detection to two functions, one for color checking and the other for Template matching.
As a side note, if you want any help maintaining the repo, happy to help out with maintaining! Appreciate all the review you’ve given everything and there’s a few places I’d love to continue to contribute in!
…
On Oct 29, 2021 at 13:24, <Siterizer ***@***.***)> wrote:
Okay, new release is here.
Code: https://github.com/Siterizer/new-world-fishing-bot/tree/v2.0.0
Compiled .zip: https://github.com/Siterizer/new-world-fishing-bot/releases/tag/v2.0.0
Tested it for about an hour and it's working. But will be glad about your feedback
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (#213 (comment)), or unsubscribe (https://github.com/notifications/unsubscribe-auth/ABR2SQK6PJDZNI6QDZ5EAYLUJMGKJANCNFSM5GZ3BNOQ).
Triage notifications on the go with GitHub Mobile for iOS (https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675) or Android (https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub).
|
Nice work @srhinos! I was also wondering if the templatematching would be faster if we switch to greyscale. But I see that you are not using the latest version of PR #134. In commit dcaf9c4 I already added support for 16:10, 21:9 and 32:9 aspect ratios. This is also missing in the 2.0.0 Branch @Siterizer :) |
Hello buddies ! I have to admit that i'm a begginer and i dont know how to modify or use your version ? Can you do à step by step to show me ? Or add me discord Seven#9428 |
When I do a code compare between v2.0.0 and v1.2.1, the only change I see is to the README.md I've been testing the 2 major PRs and happy to see that we have multithreading now and no more "Not Responding" problems with the GUI or inability to stop/pause fishing. Testing srhinos' PR (main), my fish detection fails every other cast but otherwise hooks the fish almost immediately whereas the vanilla experience was a bit of randomness as to how fast it would hook the fish. Testing NewWorldDev's PR (feature/pause-hotkey) I've had more consistent successful hooks with; nice work with the in-window stats and colorization. @NewWorldDev have you thought about ways to animation cancel the flourish that happens when fish are caught? |
This implements several improvements found in other PRs on this repository. I also took it upon myself to refactor the bot to use Asyncio to juggle tasks on the backend and threading to seperate the GUI from said backend. This means no issues with locked GUI.
I refactored out a lot of the really egregious design decisions up to a certain point and did a half assed job merging and removing a lot of unnecessary bloat. Theres still a LOT of room for improvement too now that the CV is running on asyncio too. I'm sure I'll eventually add it but this is what I felt like doing tonight.
Edit: To clairfy, this also integrates the following active PRs as well:
#208
#164
#134
#106