Advertisement
Guest User

Untitled

a guest
Mar 31st, 2016
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.97 KB | None | 0 0
  1. <?php
  2. $login_user = 'username=BOTNAME&password=BOTPASSWORD';
  3. $file_path_rs = 'rs.txt';
  4. $file_path_token = 'token.txt';
  5. $current_rs = file_get_contents($file_path_rs);
  6. $current_token = file_get_contents($file_path_token);
  7.  
  8.  
  9. // [Function] Get ROBLOSECRUITY
  10. function getRS()
  11. {
  12. global $login_user, $file_path_rs;
  13. $get_cookies = curl_init('https://www.roblox.com/newlogin');
  14. curl_setopt_array($get_cookies,
  15. array(
  16. CURLOPT_RETURNTRANSFER => true,
  17. CURLOPT_HEADER => true,
  18. CURLOPT_POST => true,
  19. CURLOPT_POSTFIELDS => $login_user
  20. //CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.6 (KHTML, like Gecko) Chrome/16.0.897.0 Safari/535.6",
  21. //CURLOPT_FOLLOWLOCATION => true,
  22. //CURLOPT_REFERER => "http://www.roblox.com"
  23. )
  24. );
  25. $rs = (preg_match('/(\.ROBLOSECURITY=.*?);/', curl_exec($get_cookies), $matches) ? $matches[1] : '');
  26. file_put_contents($file_path_rs, $rs, true);
  27. curl_close($get_cookies);
  28. return $rs;
  29. }
  30.  
  31.  
  32.  
  33.  
  34.  
  35. // [Function] Change User's Group Rank
  36. function changeRank($rs, $token)
  37. {
  38. global $file_path_token;
  39.  
  40. $promote_user = curl_init("http://www.roblox.com/groups/api/change-member-rank?groupId=2769318&newRoleSetId=18662283&targetUserId=109239258");
  41. curl_setopt_array($promote_user,
  42. array(
  43. CURLOPT_RETURNTRANSFER => true,
  44. CURLOPT_POST => true,
  45. CURLOPT_HEADER => true,
  46. CURLOPT_HTTPHEADER => array("Cookie: $rs", "X-CSRF-TOKEN: $token", "Content-Type: application/x-www-form-urlencoded"),
  47. CURLOPT_POSTFIELDS => "groupId=GROUPID&newRoleSetId=18662283&targetUserId=USERID",
  48. CURLOPT_RETURNTRANSFER => true,
  49. CURLOPT_POST => true,
  50. CURLOPT_HEADER => true,
  51. CURLOPT_HTTPHEADER => array("Cookie: $rs", "X-CSRF-TOKEN: $token")
  52. )
  53. );
  54. $resp = curl_exec($promote_user);
  55. $resp_header_size = curl_getinfo($promote_user, CURLINFO_HEADER_SIZE);
  56. $resp_header = substr($resp, 0, $resp_header_size);
  57. $resp_body = substr($resp, $resp_header_size);
  58. if (/*preg_match('/GuestData/', $resp_header)*/false) {//this area is an issue, just call getRS() to keep it up to date
  59. // RS invalid
  60. echo("RS invalid");
  61. break;
  62. $resp_body = changeRank( getRS(), $token );
  63. } else if (preg_match('/Token Validation Failed/', $resp_header)) {
  64. // Token invalid
  65. $new_token = (preg_match('/X-CSRF-TOKEN: (\S+)/', $resp_header, $matches) ? $matches[1] : '');
  66. file_put_contents($file_path_token, $new_token, true);
  67. echo("Token invalid");
  68. break;
  69. $resp_body = changeRank( $rs, $new_token );
  70. }
  71. curl_close($promote_user);
  72. return $resp_body;
  73. }
  74. // Change user's group rank and echo results
  75. echo changeRank(getRS(), $current_token);
  76. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement