nicoco007 / LoL-Auto-Login

Automatic login for League of Legends.
https://www.nicoco007.com/lol-auto-login/
GNU Affero General Public License v3.0
29 stars 5 forks source link

Not detecting correctly #16

Closed ruifcc closed 6 years ago

ruifcc commented 7 years ago

Hi, before anything nice work on the program ^^.

I installed it and worked fine on my computer, but on my girlfriend it didn't insert the password. As i like to program e downloaded your project and narrowed the problem to the fact that the cropped image was off with values.

So to compensate the problem and get it to work just for her i compensated the width and height values in the CaptureWindow method with :
int RightCorrection = 320; // Joana Compensation int BottomCorrection = 180; // Joana Compensation var width = windowRect.Right + RightCorrection - windowRect.Left; var height = windowRect.Bottom + BottomCorrection - windowRect.Top;

The window grabbed was correct because i moved it around and using ur handy debug capture methods the images moved too, so it was just the width and heigth that was wrong for some reason that i haven't found out yet. In log says 1280 per 720 but actual size of window is 1600 per 900.

Here is the Log with your original code.

0:00:00:00,0060039 [INFO] Started LoL Auto Login v2.0.2.0 0:00:00:00,0400261 [INFO] Loading settings from "D:\Games\League of Legends\Config\LoLAutoLoginSettings.yaml" 0:00:00:00,1921324 [INFO] Loaded settings. 0:00:00:00,3652442 [INFO] Client is not running, launching client. 0:00:00:00,3732469 [INFO] Waiting for 30000 ms. 0:00:00:01,5695578 [INFO] Found new/resized window: {Handle=3410524, Name="League of Legends", Class="RCLIENT", Rectangle={X=0,Y=0,Width=1024,Height=576}} 0:00:00:01,5765595 [INFO] Client found after 1142 ms! 0:00:00:02,1743728 [INFO] Found new/resized window: {Handle=3410524, Name="League of Legends", Class="RCLIENT", Rectangle={X=128,Y=52,Width=1280,Height=720}} 0:00:00:20,9790275 [INFO] Found new/resized window: {Handle=3410524, Name="League of Legends", Class="RCLIENT", Rectangle={X=127,Y=54,Width=1280,Height=720}} 0:00:00:21,5381344 [INFO] Found new/resized window: {Handle=3410524, Name="League of Legends", Class="RCLIENT", Rectangle={X=12,Y=119,Width=1280,Height=720}} 0:00:00:22,0965079 [INFO] Found new/resized window: {Handle=3410524, Name="League of Legends", Class="RCLIENT", Rectangle={X=-42,Y=140,Width=1280,Height=720}} 0:00:00:26,0104368 [INFO] Client window lost! 0:00:00:26,0499882 [INFO] Pixel matching statistics: 0:00:00:26,0579940 [INFO] Minimum: 0,06934 (71/1024) 0:00:00:26,0649986 [INFO] Maximum: 0,82227 (842/1024) 0:00:00:26,0720037 [INFO] Required: 0,85000 (870/1024) 0:00:00:26,0780072 [INFO] Shutting down

nicoco007 commented 7 years ago

That's very odd, but I'm happy you got it to work! It might be that it's using the wrong window handle for the size of the client (the League client creates invisible windows for some reason), so I'll try to see what I can do.

nicoco007 commented 6 years ago

If you are still around, this issue is similar to #21 where I'm posting my progress. You can try out the builds I've been posting there and see if they work; if not, feel free to post your updates in that issue.