It should take a screenshot of the box, and then show the screenshot in a preview window.
What you could do is have the game open and loaded and the window positioned in the same position the program positions it in (so just run the original program and then close it when the level is loaded), and then in a Python shell you can enter each of these lines one by one:
Code:from PIL import ImageGrab box = 100, 100, 600, 600 (example coordinates, use your own) im = ImageGrab.grab(box) im.show()
I don`t know its a bug or so but after the program put the email a password of facebook on the new window, the program close
Some people have a problem with facebook's submit xpath.
As @(you need an account to see links) pointed out:
Find this part of the code:
and replace it with the following:Code:EML = """//*[@id="email"]""" # fb email form PSW = """//*[@id="pass"]""" # fb password form SBM = """//*[@id="u_0_n"]""" # fb submit form
Code:EML = "//input[@class='inputtext' and @(you need an account to see links)='email' and @id='email' and @value='' and @tabindex='1' and @type='email']" PSW = "//input[@class='inputtext' and @(you need an account to see links)='pass' and @id='pass' and @tabindex='2' and @type='password']" SBM = "//input[@tabindex='4' and @id='u_0_m' and @type='submit']"
So I changed the lines and the error continues, here is what shows me on cmd:
Sorry, I went out for dinner:
Let's try so it hits ENTER instead of clicking the submit button.
Add this line near the top of the program with all the other import statements (so like line 5)
Code:from selenium.webdriver.common.keys import Keys
Then find this line (around line 254):
and replace it with this:Code:ff.find_element_by_xpath(SBM).click() # clicks submit button
orCode:ff.find_element_by_xpath(PSW).send_keys(Keys.RETURN)
Code:ff.find_element_by_xpath(PSW).submit()
I tried to get it to show my cords, but on windows 10, paint and the picture editor wasn't giving to me . so I uses daviids.
well using this
PLY1 = 365, 590 # position of first play button
PLY2 = 365, 540 # position of second play button
LVL1 = 175, 590 # position of level one house (on map)
RES = 465, 645 # position of resume button
AGN = 370, 530 # position of play again button
BOX = 220, 260, 520, 558 # left, top, right, bottom coordinates of main grid,
and when I did show using above it shows pic of it just around all visible monsters without the grey border visible if that helps any..
did get me all the way into playing part, but, then its first move is to go for the yellow/purple swap in bottom left, rather then the mandatory move near the top, and just keeps trying over and over.
tried again this time just messed up on last move. so don't have clue
edit
ok finally got paint to give me co-ords, and entering them has corrected the issue with weird gameplay. I left lvl 1 same as daviids. but change box to mine, which was small difference. BOX = 216, 259, 521, 563, but was more then enough to break the autoplay. lol. thanks for all your hard work.
Last edited by wildsky; 03-29-2016 at 09:31 AM. Reason: resolved
A (03-30-2016)tl a s
I have another problem, the program wont wait to my game load it all to click on the first paly buttom