Open RuinedYourLife opened 3 years ago
It's not random. I believe the error is caused of clicking outside of the board. There causing the function getCellFromPos not being able to translate the Position into a Cell location.
This function can fail in many cases but try to follow this guidelines: 1) Open up a game while logged in to lichess (Playing as anonymous will change the board size and mess everything Also it's only tested on chrome and on 100% zoom while logged in). 2) During the freeze time open up the program choose your starting color. And alt+tab back to the browser (Don't use your mouse). Keep in mind that your mouse clicks from that moment matters. So play like that: 1 click represent the from cell and 1 click represent the to cell when it's your turn. No dragging pieces. No checking youtube for a second It will mess everything and the program will crash
Keep in mind that lichess would most definitely ban you for using this against real players. So I suggest you to test against bots to learn in the process.
Thanks for the guidelines! Iirc I didn't click outside of the board cause you mentionned it would mess with it in the READ.ME I'll try that and see how it goes, thanks again! (and don't worry, I don't play with it, it's just the code that makes me interested ^^)
So, it lasted for longer, but I never clicked outside the board and it came again :// I'm not dragging and I'm not alt tabbing or nothing else. I resized the board for the cell to be 92 pixels (like in the code, even tho I could change the code I just wanted to test this way) and still had the NoneType error. I'll keep investigating!
So, it lasted for longer, but I never clicked outside the board and it came again :// I'm not dragging and I'm not alt tabbing or nothing else. I resized the board for the cell to be 92 pixels (like in the code, even tho I could change the code I just wanted to test this way) and still had the NoneType error. I'll keep investigating!
Mabey you're double clicking? Even by accident it can mess up everything. Some mouse are very sensitive for example I can use it only while being extra careful.
I highly doubt that ://
Sometimes I get this random error. I can't exactly identify when and why it does that, but it looks like it's when I try to play a piece? Sometimes instead of returning None it gives me a Point in the error msg. Hope that can help!