Guest User

Untitled

a guest
Sep 2nd, 2016
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. import requests
  2. import re
  3. import time
  4. import sys
  5. from random import randint
  6. sys.setrecursionlimit(100000);
  7. requests.packages.urllib3.disable_warnings();
  8.  
  9. #####
  10. Account = [raw_input('Username: '), raw_input('Password: ')];
  11. ID = raw_input('ThreadID: ');
  12. Wait = 32;
  13. #####
  14. def getval(name, string):
  15. return re.search('id=\"' + name + '\" value=\"(.+)\"', string).group(1);
  16. def login(username, password, session):
  17. return session.post('https://m.roblox.com/login', data={'UserName':username,'Password':password});
  18. def getRandomThread(subforum, session):
  19. req1 = session.get('https://forum.roblox.com/Forum/ShowForum.aspx?ForumID=' + str(subforum)).content;
  20. number = randint(3, 10);
  21. postid = re.findall('PostID=(\d+)', req1)[1+number];
  22. return postid
  23. def getTitle(postid, session):
  24. req1 = session.get('https://forum.roblox.com/Forum/ShowPost.aspx?PostID=' + postid).content;
  25. title = re.search('20px\">(.+)<', req1).group(1);
  26. return title
  27. def reply(postid, body, session):
  28. req1 = session.get('https://forum.roblox.com/Forum/AddPost.aspx?PostID=' + str(postid)).content;
  29. reqdata = {
  30. '__EVENTTARGET': ' ', #getval('__EVENTTARGET', req1),
  31. '__EVENTARGUMENT': ' ', #getval('__EVENTARGUMENT', req1),
  32. '__VIEWSTATE': getval('__VIEWSTATE', req1),
  33. '__VIEWSTATEGENERATOR': getval('__VIEWSTATEGENERATOR', req1),
  34. '__EVENTVALIDATION': getval('__EVENTVALIDATION', req1),
  35. 'ctl00$cphRoblox$Createeditpost1$PostForm$PostBody': body,
  36. 'ctl00$cphRoblox$Createeditpost1$PostForm$PostButton': ' Post '
  37. }
  38. return session.post('https://forum.roblox.com/Forum/AddPost.aspx?PostID=' + str(postid), data=reqdata);
  39. #####
  40. ses = requests.Session();
  41. login(Account[0], Account[1], ses);
  42. print '-- CLEVERBOT FOR FORUM --'
  43. print '-- Made by DominusTrex --'
  44. print ' 1 day of use: ' + str(60 * 60 / 32 * 24) + ' posts'
  45. print ''
  46. def main():
  47. def main2():
  48. try:
  49. Siggy = 'There are only ' + str(randint(100, 1000)) + ' ducks left in the world.';
  50. threadid = ID
  51. #title = getTitle(threadid, ses);
  52. answer = Siggy;
  53. reply(threadid, answer, ses);
  54. print(threadid);
  55. except:
  56. main2();
  57. main2();
  58. time.sleep(Wait);
  59. main();
  60. main();
Add Comment
Please, Sign In to add comment