Originally Posted by
derky
Thanks for the quick response!
Edit: I just played around with the delay settings and 1.0 seems to be the most stable. It played all 50 games successfully and took about 19-20 minutes. 0.9 works to around 35 games then it crashes. @
(you need an account to see links)
Sounds about right. I just did 15 at .8 with no crash, but I'll keep mine at 1.0. I'll add that information to the downloads page. Thank you so much for your contribution. (+rep when I'm able to again).
I thought I could do a way where it screenshots the board once, creates a value for it and saves the value (before), waits a few frames later, takes another screenshot and creates a value for it (after). It would then compare before and after, and if the two values are different, that means the board is moving and the program will pause for .1 seconds and try again with the screenshots. If before was equal to after, then that means the board has stopped moving and the program can continue. I done this, thinking it would make it faster.. It either crashed it or slowed it down. Pretty interesting idea, though, I thought. The code went something like this:
Code:
def swap(c,d):
ctypes.windll.user32.SetCursorPos(cc[c][0],cc[c][1])
time.sleep(.2)
ctypes.windll.user32.mouse_event(2,0,0,0,0)#leftdown
time.sleep(.2)
ctypes.windll.user32.SetCursorPos(cc[d][0],cc[d][1])
time.sleep(.2)
ctypes.windll.user32.mouse_event(4,0,0,0,0)#leftup
time.sleep(.2) #delay time
before=ImageGrab.grab(box)
before=before.resize((1,1),Image.ANTIALIAS).getpixel((0,0))
time.sleep(.1)
after=ImageGrab.grab(box)
after=after.resize((1,1),Image.ANTIALIAS).getpixel((0,0))
while before!=after:
before=ImageGrab.grab(box)
before=before.resize((1,1),Image.ANTIALIAS).getpixel((0,0))
time.sleep(.1)
after=ImageGrab.grab(box)
after=after.resize((1,1),Image.ANTIALIAS).getpixel((0,0))
else:
move()
return
but yeah, I mean it worked but it isn't worth it.. the 1.0 works better.
& As for the quitting on a key command, still a bit lost on that one..
update:
to fix the sparkling magenta misidentification bug:
go to line 105
replace
with
Code:
elif 40<ide<60 or 168<pix[0]<173:
the ID process before would confuse it with purple, and that's why sometimes it might have got stuck trying to make an incorrect move.
the new updates will have this already in (7:45pm nst)
update: (again)
another bug I discovered: sometimes it'll keep making the same two moves over and over again, usually near purple ghouls?
this was caused by the screen reading the cursor (hand) and labeling it as a ghoul. if you really want to fix this problem, you can by finding line 50 (the delay time), and inserting this line below it:
Code:
ctypes.windll.user32.SetCursorPos(0,0)
make sure it's indented on the same level as the line above and below it.