disarmyouwitha / bobber_bot

WoW (Classic) fishing bot.. for funzies
MIT License
8 stars 5 forks source link

tootlip calibrator error #2

Open kaikaiiiiiii opened 4 years ago

kaikaiiiiiii commented 4 years ago

[OPTIONAL CONFIG]: health | Would you like to skip?: n [Calibrating health: Click at the top-left of the area, && drag to lower-right and release click.] Woomy!: (517, 97) Woomy!: (697, 107) Pause. Drawing area with mouse:

[Calibration config found for scanarea | Use this?]: [Use calibration from config for bobber?]:

Click at the top-left of the tooltip, && drag to lower-right and release.] TypeError: MouseSwitch() missing 8 required positional arguments: 'msg', 'x', 'y', 'data', 'flags', 'time', 'hwnd', and 'window_name'


The mouse was very lagging when the tooltip calib starts. I've trying to move cursor, but just I moved cursor a pixel far, the error message pops out.

Seems the script doesn't monitoring left mouse click, just triggered by mouse movement event.


System: Windows 10 1809 64bit Mouse: Logitech G502

disarmyouwitha commented 4 years ago

Will def. look into this! I knew of an issue with tooltip calibration I wanted to touch up, maybe I can fix this too~

(possibly issue with PyHook?): python -m pip install install_files/pyHook-1.5.1-cp37-cp37m-win_amd64.whl

kaikaiiiiiii commented 4 years ago

I'm sure I installed pyhook.

And the first step, to set the scan area, was works well too. If PyHook has an issue, the first step should warn error too, I guess.

Maybe you can add a debug mode, debugmode = true to print all mouse events to screen, that should be more accurate to the issue.

disarmyouwitha commented 4 years ago

Hm, you're right.. scanarea is using the mouse first, and tooltip calibration uses the same code, basically..

That's the problem, though is.. I don't know if it's something my code is doing or if it's an underlying issue with one of the libraries i'm using.. I assumed maybe it was an issue with PyHook's windows implementation (?) but I'm not really sure.. It does work on my windows laptop, albeit a little laggy compared to osx, but it's my only example, so I appreciate your feedback!

kaikaiiiiiii commented 4 years ago

I pulled the new code, the warning belows:


F:\Coding\bobber_bot>py thresh.py [Calibration config found for scanarea | Use this?]: [Use calibration from config for bobber?]: Traceback (most recent call last): File "thresh.py", line 531, in bb.start() File "thresh.py", line 264, in start self.calibration_check_required() File "thresh.py", line 401, in calibration_check_required self.sp.calibrate_bobber() File "F:\Coding\bobber_bot\screen_pixel.py", line 164, in calibrate_bobber configs = json.load(config_file) File "C:\Program Files\Python37\lib\json__init.py", line 296, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "C:\Program Files\Python37\lib\json\init__.py", line 348, in loads return _default_decoder.decode(s) File "C:\Program Files\Python37\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Program Files\Python37\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)


I update to win10 1903, trying to switch wow language in enUS or zhCN, reinstall python packs, and I found this:


F:\Coding\bobber_bot\install_files>python -m pip install -U pyHook Requirement already up-to-date: pyHook in c:\program files\python37\lib\site-packages (1.5.1)

F:\Coding\bobber_bot\install_files>python -m pip install --upgrade --force-reinstall PyUserInput Collecting PyUserInput Using cached https://files.pythonhosted.org/packages/d0/09/17fe0b16c7eeb52d6c14e904596ddde82503aeee268330120b595bf22d7b/PyUserInput-0.1.11.tar.gz ERROR: Could not find a version that satisfies the requirement pyHook (from PyUserInput) (from versions: none) ERROR: No matching distribution found for pyHook (from PyUserInput)


pyHook installed, but PyUserInput didn't find the required version of pyhook, I guess PyUserInput updated? Or because win10 1903. When i first time installing the dep packs I'm sure it succeeded.

disarmyouwitha commented 4 years ago

Right now I definitely broke the bot (then committed my changes to Master).. So.. my apologies. xD

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) ^ (I will get this fixed tonight)

I definitely think you're on the right track with PyHook.. I remember having an issue with PyHook on my windows laptop, which is why I included the wheel files that worked for me -- but I didn't keep close enough notes on how I resolved it. =x

CodyBontecou commented 4 years ago

Is there a stable commit I can run while this is being worked on?

disarmyouwitha commented 4 years ago

Yes, my apologies y'all -- I'm going to revert my last changes that broke the bot entirely, as I was just adding delay_start() and "minor improvements".

Unfortunately I didn't test this properly before committing to master. I will do better. ^^b

#[REVERT]: https://github.com/disarmyouwitha/bobber_bot/commit/7d6f385c8ba0ae1922687db9fffd5d4401fb7a29

HiddevH commented 4 years ago

Perhaps this has the same reason; I couldn't select the right area of the tooltip using the popup window. In the end, I had to alt-tab to e.g. webbrowser and select the right area there (or at least, select the right area so that the calibration would go to the right place). Seems something off with the calibration (perhaps picking the wrong resolution)? My WoW is in a different resolution wrt. the standard display) that might cause it.

disarmyouwitha commented 4 years ago

So.. I'm back playing WoW again, and on my new iMac none of this works xD

I think I'm having the same problem as @HiddevH where the code doesn't scale properly to my resolution..

I'll be taking another crack at the calibration

HiddevH commented 4 years ago

Welcome back :) Yeah, adding a second screen or something completely flips the calibration.. I think it has something to do with WoW being scaled wrt resolution differently than the system itself..

Let me know if you have any help, I'm still playing but haven't coded in a while.

We could enhance the experience, create a GUI instead of using a script to start

disarmyouwitha commented 4 years ago

I've switched the calibration from using a screenshot that you click&drag across, to just clicking on the actual screen at the top-left and bottom right of the rectangle you want to grab.. This has fixed the problem for me -- let me know if it fixes your issue @HiddevH ! I do think a GUI would be cool~

I don't think this will help you kaikaiiiiiii however, sorry.