Results 1 to 5 of 5

Thread: is this a scratch card autobuyer

  1. #1
    utahclock's Avatar
    Joined
    Feb 2012
    Posts
    664
    Userbars
    3
    Thanks
    360
    Thanked
    377/198
    DL/UL
    122/0
    Mentioned
    89 times
    Time Online
    15d 16h 59m
    Avg. Time Online
    5m

    is this a scratch card autobuyer

    can anyone of the programming team verify ?

    def WinterKiosk():
    print "Grabbing Scratch Card"
    request = mechanize.Request("http://www.neopets.com/winter/kiosk.phtml")
    response = state.open(request)
    soup = BeautifulSoup(response.get_data())
    if response.get_data().find("You were in the middle of scratching your card and left!",0,len(response.get_data())):
    print "OH NO!"
    state.follow_link(url_regex="kiosk2.phtml")
    else:

    state.select_form(nr=1)
    soups = BeautifulSoup(state.submit().get_data())
    if state.geturl() == "http://www.neopets.com/winter/process_kiosk.phtml":
    print "Please wait longer before trying again"
    else:
    card = soups('p')[4].contents[1].split("b>")[1].split("</b>")[0]
    print card #soups.prettify()
    state.select_form(nr=2)
    state.set_value_by_label(["Race to Riches Scratchcard"], "card_id")

    #state["card_id"] = ["select a cheese""Race to Riches Scratchcard"]#card
    state.submit()
    if state.geturl() == "http://www.neopets.com/winter/kiosk2.phtml":
    request = mechanize.Request("http://www.neopets.com/winter/process_kiosk.phtml?type=scratch&loc=1")
    request.add_header("Referer", "http://www.neopets.com/winter/kiosk2.phtml")
    response = state.open(request)

    request = mechanize.Request("http://www.neopets.com/winter/process_kiosk.phtml?type=scratch&loc=9")
    request.add_header("Referer", "http://www.neopets.com/winter/kiosk2.phtml")
    response = state.open(request)

    request = mechanize.Request("http://www.neopets.com/winter/process_kiosk.phtml?type=scratch&loc=7")
    request.add_header("Referer", "http://www.neopets.com/winter/kiosk2.phtml")
    response = state.open(request)

    request = mechanize.Request("http://www.neopets.com/winter/process_kiosk.phtml?type=scratch&loc=3")
    request.add_header("Referer", "http://www.neopets.com/winter/kiosk2.phtml")
    response = state.open(request)

    request = mechanize.Request("http://www.neopets.com/winter/process_kiosk.phtml?type=scratch&loc=5")
    request.add_header("Referer", "http://www.neopets.com/winter/kiosk2.phtml")
    response = state.open(request)

    randomn = random.randint(1, 4) * 2
    request = mechanize.Request("http://www.neopets.com/winter/process_kiosk.phtml?type=scratch&loc="+str(randomn ))
    request.add_header("Referer", "http://www.neopets.com/winter/kiosk2.phtml")
    response = state.open(request)

    print response.read()

  2. #2

    Joined
    Jun 2012
    Posts
    1,699
    Thanks
    876
    Thanked
    2,881/1,142
    DL/UL
    44/1
    Mentioned
    562 times
    Time Online
    118d 6h 45m
    Avg. Time Online
    40m
    Yes thats a scratch buyer , basically you just need to visit

    kiosk2.phtml and have kiosk.phtml as the refferer. That code also scratches the first 5 tiles in order and then uses a random function on the final scratch.
    Last edited by DarkByte; 03-07-2013 at 10:25 PM.

  3. #3
    ritzwin's Avatar
    Joined
    Mar 2013
    Posts
    327
    Userbars
    2
    Thanks
    35
    Thanked
    57/30
    Mentioned
    23 times
    Time Online
    13d 10h 9m
    Avg. Time Online
    4m
    Good golly, people need to learn to refactor their code.

  4. #4
    Potatoes's Avatar
    Joined
    Dec 2011
    Posts
    210
    Userbars
    2
    Thanks
    17
    Thanked
    19/18
    DL/UL
    37/0
    Mentioned
    14 times
    Time Online
    1d 16h 22m
    Avg. Time Online
    N/A
    I understand this language lol! Is this python?

  5. #5

    Joined
    Jan 2013
    Posts
    24
    Thanks
    746
    Thanked
    1,257/693
    DL/UL
    86/0
    Mentioned
    464 times
    Time Online
    70d 14h 40m
    Avg. Time Online
    24m
    Quote Originally Posted by Potatoes View Post
    I understand this language lol! Is this python?
    Yeah, it's python.

    I guessed Javascript at first. But no, I believe it is python indeed.

Posting Permissions

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