Page 9 of 11 FirstFirst ... 7891011 LastLast
Results 81 to 90 of 102

Thread: [PYTHON] GHOUL CATCHERS BOT

  1. #81
    GetJinxed's Avatar
    Joined
    May 2015
    Posts
    155
    Userbars
    4
    Thanks
    228
    Thanked
    220/58
    DL/UL
    146/0
    Mentioned
    27 times
    Time Online
    13d 10h 41m
    Avg. Time Online
    5m
    Quote Originally Posted by Atlas View Post
    @(you need an account to see links) @(you need an account to see links)

    You're going to have to update the coordinates yourself. I wonder if--since you're both using Windows--if you guys would share the same coordinates? I'm on a Mac, and so I notice that the address bar is a different size than the address bar in Windows (etc).

    So Daviid, if the program isn't reading the box correctly, you'll have to update the coordinates yourself.
    You can see if the box coordinates are aligned by running the program, loading level one, and then interrupting the program (press CTRL + C a few times)

    Then, while the game grid with the ghouls is active, run the line:
    Code:
    ImageGrab.grab(BOX).show()
    A preview window should pop up and it'll show you a screenshot of the box coordinates. You should see the grid. From then, you can judge if you need to modify your coordinates if part of the grid is cut off or misaligned.

    Hopefully that makes sense?
    How would you do that? I checked the image that taught how to do it on the first version but it still doesn't play :/

  2. #82
    Atlas's Avatar
    Joined
    Jun 2013
    Posts
    260
    Userbars
    6
    Thanks
    668
    Thanked
    430/149
    DL/UL
    67/8
    Mentioned
    123 times
    Time Online
    27d 4h 44m
    Avg. Time Online
    9m
    Quote Originally Posted by GetJinxed View Post
    How would you do that? I checked the image that taught how to do it on the first version but it still doesn't play :/
    The game was loading for me last night and the past few days..is it down again?

  3. #83
    GetJinxed's Avatar
    Joined
    May 2015
    Posts
    155
    Userbars
    4
    Thanks
    228
    Thanked
    220/58
    DL/UL
    146/0
    Mentioned
    27 times
    Time Online
    13d 10h 41m
    Avg. Time Online
    5m
    Quote Originally Posted by Atlas View Post
    The game was loading for me last night and the past few days..is it down again?
    I think I didn't explain myself very well, sorry the function "ImageGrab.grab(BOX).show()" should show some lines for debugging purposes right? That's what I wanted to run as well to see what's wrong with my coordinates because it doesn't make any move at all D:

  4. #84
    Atlas's Avatar
    Joined
    Jun 2013
    Posts
    260
    Userbars
    6
    Thanks
    668
    Thanked
    430/149
    DL/UL
    67/8
    Mentioned
    123 times
    Time Online
    27d 4h 44m
    Avg. Time Online
    9m
    Quote Originally Posted by GetJinxed View Post
    I think I didn't explain myself very well, sorry the function "ImageGrab.grab(BOX).show()" should show some lines for debugging purposes right? That's what I wanted to run as well to see what's wrong with my coordinates because it doesn't make any move at all D:
    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()

  5. #85


    ww!'s Avatar
    Joined
    Jan 2016
    Posts
    67
    Userbars
    2
    Thanks
    57
    Thanked
    21/20
    DL/UL
    95/0
    Mentioned
    7 times
    Time Online
    5d 3h 31m
    Avg. Time Online
    2m
    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

  6. #86
    Atlas's Avatar
    Joined
    Jun 2013
    Posts
    260
    Userbars
    6
    Thanks
    668
    Thanked
    430/149
    DL/UL
    67/8
    Mentioned
    123 times
    Time Online
    27d 4h 44m
    Avg. Time Online
    9m
    Quote Originally Posted by ww! View Post
    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:
    Code:
    EML = """//*[@id="email"]"""  # fb email form
    PSW = """//*[@id="pass"]"""  # fb password form
    SBM = """//*[@id="u_0_n"]""" # fb submit form
    and replace it with the following:
    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']"

  7. #87


    ww!'s Avatar
    Joined
    Jan 2016
    Posts
    67
    Userbars
    2
    Thanks
    57
    Thanked
    21/20
    DL/UL
    95/0
    Mentioned
    7 times
    Time Online
    5d 3h 31m
    Avg. Time Online
    2m
    So I changed the lines and the error continues, here is what shows me on cmd:


  8. #88
    Atlas's Avatar
    Joined
    Jun 2013
    Posts
    260
    Userbars
    6
    Thanks
    668
    Thanked
    430/149
    DL/UL
    67/8
    Mentioned
    123 times
    Time Online
    27d 4h 44m
    Avg. Time Online
    9m
    Quote Originally Posted by ww! View Post
    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):
    Code:
    ff.find_element_by_xpath(SBM).click()  # clicks submit button
    and replace it with this:
    Code:
    ff.find_element_by_xpath(PSW).send_keys(Keys.RETURN)
    or

    Code:
    ff.find_element_by_xpath(PSW).submit()

  9. The Following 2 Users Say Thank You to Atlas For This Useful Post:

    Daviid (03-05-2016),Ms M. (04-06-2016)

  10. #89

    Joined
    Mar 2016
    Posts
    3
    Userbars
    0
    Thanks
    0
    Thanked
    2/2
    DL/UL
    8/0
    Mentioned
    Never
    Time Online
    4h 24m
    Avg. Time Online
    N/A
    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

  11. The Following User Says Thank You to wildsky For This Useful Post:

    Atlas (03-30-2016)

  12. #90


    ww!'s Avatar
    Joined
    Jan 2016
    Posts
    67
    Userbars
    2
    Thanks
    57
    Thanked
    21/20
    DL/UL
    95/0
    Mentioned
    7 times
    Time Online
    5d 3h 31m
    Avg. Time Online
    2m
    I have another problem, the program wont wait to my game load it all to click on the first paly buttom

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •