Advertisement
Guest User

VOID BOT NEED PYTHON 2.7, PUT IN NOTE PAD AND SAVE AS .PY

a guest
Apr 2nd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.36 KB | None | 0 0
  1. import urllib
  2. import urllib2
  3. import time
  4. import json
  5. import random
  6.  
  7. # COORDINATES TO ATTACK
  8. center = [901,546] #red lattice
  9. radius = 20
  10.  
  11. # COLOR TO PLACE - 3 IS BLACK MOTHERFUCKERS
  12. void_color = 3
  13.  
  14. # ------------------------------------------------------------------------
  15.  
  16. print "Build the Void"
  17.  
  18. print "For each account you want to use, enter it in like username:password"
  19. print "When you're done, type 'done'"
  20.  
  21. accounts = []
  22. user_input = ""
  23. while (user_input != "done"):
  24. user_input = raw_input("Account-> ")
  25. if user_input.lower() != "done":
  26. accounts.append(user_input)
  27.  
  28. # ------------------------------------------------------------------------
  29.  
  30. def main( accounts ):
  31.  
  32. print "Getting user agent list for anonymity (please wait)"
  33. user_agent_list=list(set([ua for ua in urllib.urlopen("https://raw.githubusercontent.com/sqlmapproject/sqlmap/master/txt/user-agents.txt").read().splitlines() if not ua.startswith("#")]))
  34.  
  35. sessions = {}
  36.  
  37. opener = urllib2.build_opener()
  38. opener.addheaders = [('User-Agent', random.choice(user_agent_list))]
  39. for account in accounts:
  40. username = account.split(":")[0]
  41. password = account.split(":")[1]
  42. data = urllib.urlencode({'op': 'login-main', 'user': username, 'passwd': password, 'api_type': 'json'})
  43. resp = opener.open('https://www.reddit.com/api/login/'+urllib.quote(username), data).read()
  44. sessions[username] = json.loads(resp)["json"]["data"]["cookie"]
  45.  
  46. print "Running Build the Void"
  47.  
  48. while True:
  49. # Fill the void
  50. for session in sessions.keys():
  51. cookie = sessions[session]
  52. color = 3
  53. while color == void_color:
  54. # Find a non-black square
  55. xtest = center[0]+random.randint(-radius,radius)
  56. ytest = center[1]+random.randint(-radius,radius)
  57. resp = opener.open("https://www.reddit.com/api/place/pixel.json?x="+str(xtest)+"&y="+str(ytest)).read()
  58. try:
  59. color = int(json.loads(resp)["color"])
  60. except Exception, e:
  61. color = 3
  62. print "Found a non-void color at", xtest, ytest
  63. data = urllib.urlencode({'x': xtest, 'y': ytest, 'color': void_color})
  64. newopener = urllib2.build_opener()
  65. newopener.addheaders = [('User-Agent', random.choice(user_agent_list))]
  66. newopener.addheaders.append(('Cookie', 'reddit_session='+cookie))
  67. modhash = json.loads(newopener.open("https://reddit.com/api/me.json").read())["data"]["modhash"]
  68. newopener.addheaders.append(('x-modhash', modhash))
  69. next=newopener.open("https://www.reddit.com/api/place/draw.json", data).read()
  70. print next
  71. finalresp = newopener.open("https://www.reddit.com/api/place/pixel.json?x="+str(xtest)+"&y="+str(ytest)).read()
  72. if session in finalresp:
  73. print "Added successfully"
  74. else:
  75. print finalresp
  76. time.sleep(305)
  77.  
  78.  
  79. # ------------------------------------------------------------------------
  80.  
  81. # If any problem occurs, keep retrying forever. All hail the void.
  82. while True:
  83. try:
  84. main( accounts )
  85. except Exception as e:
  86. print e
  87. time.sleep(300)
  88. print 'retrying ... '
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement