Navigation
PeerBet Bot
for peerbet winner
This is a bot that play peerbet for you
import cookielib, urllib2,urllib,random,time cj = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) params = urllib.urlencode({'username': '', 'password': ''}) r = opener.open("https://peerbet.org/api.php?method=login&%s" % params) print r.read() max_lose=10 ticketpricebase=0.0000023 ticketprice=ticketpricebase lose_count=0; while True: f = opener.open("https://peerbet.org/api.php?method=getuserinfo") userinfo=f.read() userinfo=eval(userinfo) print 'balance:' + str(userinfo['balance']); if ticketprice>userinfo['balance']: break else: params = urllib.urlencode({'tickets': '2', 'price': ticketprice,'expire':'1','instant':'1'}) raffle=opener.open('https://peerbet.org/api.php?method=createraffle&%s' % params) raf= raffle.read() raf=eval(raf) raffleid=raf['raffle_id'] params = urllib.urlencode({'raffle': raffleid, 'tickets': 1}) opener.open('https://peerbet.org/api.php?method=buytickets&%s' % params) print str(raffleid) + ':' + str(ticketprice) while True: params = urllib.urlencode({'raffle': raffleid}) f=opener.open('https://peerbet.org/api.php?method=getraffleinfo&%s' % params) raffle=f.read() raffle=eval(raffle) if raffle['status']=='win': ticketprice=ticketpricebase print 'win' lose_count=0 time.sleep(10) break elif raffle['status']=='lose': lose_count+=1 ticketprice*=random.uniform(2, 3) print 'lose' if lose_count>=max_lose: lose_count=0 time.sleep(random.uniform(60*60, 2*60*60)) break time.sleep(1)