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.
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()
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.
Good golly, people need to learn to refactor their code.
I understand this language lol! Is this python?