
Untitled
By:
heidi666 on
Aug 8th, 2013 | syntax:
Python | size: 1.58 KB | hits: 59 | expires: Never
import mechanize
import sys
import time
br = mechanize.Browser()
def sendAid(formid, dest, amount)
for i in range(amount):
dest = br.open('http://bloc.name/stats.php?id=%(1)d' % {'1':dest})
br.form = list(br.forms())[formid]
br.submit()
print "Done."
print "\nWhat is your username?"
username = str(raw_input("> "))
print "\nWhat is your password?"
password = str(raw_input("> "))
print "\nLogging in..."
loginresponse = br.open('http://bloc.name')
#loginhtml = loginresponse.read()
#loginsoup = BS(loginhtml)
#for form in br.forms():
# print form
br.form = list(br.forms())[0]
br["username"] = username
br["password"] = password
br.submit()
print "Done."
while True:
print "\nWho would you like to send to?"
print "Enter numbers only of the destination country ID."
recipient = int(raw_input("> "))
print "\nWhat would you like to send?"
print "Enter o for oil or m for money."
aidchoice = str(raw_input("> "))
print "\nHow much would you like to send?"
print "Enter the amount of times you would have clicked."
amount = int(raw_input("> "))
if aidchoice == "o":
sendAid(5, recipient, amount)
print "Done."
if aidchoice == "m":
sendAid(3, recipient, amount)
print "Done."
print "\nWould you like to send more aid? y/n."
choice = raw_input("> ")
if choice == 'n':
print "\nHope this helped! Bye."
time.sleep(2)
sys.exit(0)
if choice == 'y':
pass