Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $login_user = 'username=&password=';
- $file_path_rs = 'rs.txt';
- $file_path_token = 'token.txt';
- $current_rs = file_get_contents($file_path_rs);
- $current_token = file_get_contents($file_path_token);
- $url = "https://www.roblox.com/Trade/inventoryhandler.ashx?filter=0&userid=21208890&page=1&itemsPerPage=14&_=1460486692151";
- $data_json = array(
- 'AgentOfferList' => array([
- 'AgentID' => 21208890,
- 'OfferList' => array([
- 'UserAssetID' => '143079617',
- ]),
- 'OfferRobux' => 0,
- ],array(
- 'AgentID' => 100300822,
- 'OfferList' => array([
- 'UserAssetID' => '2849678739',
- ]),
- 'OfferRobux' => 0,
- )),
- 'IsActive' => false,
- 'TradeStatus' => 'Open',
- );
- $data = json_encode($data_json);
- // [Function] Get ROBLOSECRUITY
- function getRS()
- {
- global $login_user, $file_path_rs;
- $get_cookies = curl_init('https://www.roblox.com/newlogin');
- curl_setopt_array($get_cookies,
- array(
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_HEADER => true,
- CURLOPT_POST => true,
- CURLOPT_POSTFIELDS => $login_user
- //CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.6 (KHTML, like Gecko) Chrome/16.0.897.0 Safari/535.6",
- //CURLOPT_FOLLOWLOCATION => true,
- //CURLOPT_REFERER => "http://www.roblox.com"
- )
- );
- $rs = (preg_match('/(\.ROBLOSECURITY=.*?);/', curl_exec($get_cookies), $matches) ? $matches[1] : '');
- file_put_contents($file_path_rs, $rs, true);
- curl_close($get_cookies);
- return $rs;
- }
- // [Function] Change User's Group Rank
- function SendTrade($rs, $token)
- {
- global $file_path_token;
- global $data;
- echo $data;
- $promote_user = curl_init("ttps://www.roblox.com/Trade/inventoryhandler.ashx?filter=0&userid=21208890&page=1&itemsPerPage=14&_=1460486692151");
- curl_setopt_array($promote_user,
- array(
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_POST => true,
- CURLOPT_HEADER => true,
- CURLOPT_HTTPHEADER => array("Cookie: $rs", "X-CSRF-TOKEN: $token", "Content-Type: application/x-www-form-urlencoded; charset=UTF-8"),
- CURLOPT_POSTFIELDS => $data,
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_POST => true,
- CURLOPT_HEADER => true,
- CURLOPT_HTTPHEADER => array("Cookie: $rs", "X-CSRF-TOKEN: $token"),
- CURLOPT_REFERER => "https://www.roblox.com/Trade/inventoryhandler.ashx?filter=0&userid=21208890&page=1&itemsPerPage=14&_=1460486692151"
- )
- );
- $resp = curl_exec($promote_user);
- $resp_header_size = curl_getinfo($promote_user, CURLINFO_HEADER_SIZE);
- $resp_header = substr($resp, 0, $resp_header_size);
- $resp_body = substr($resp, $resp_header_size);
- if (/*preg_match('/GuestData/', $resp_header)*/false) {//this area is an issue, just call getRS() to keep it up to date
- // RS invalid
- echo("RS invalid");
- // break;
- // $resp_body = SendTrade(getRS(), $token);
- } else if (preg_match('/Token Validation Failed/', $resp_header)) {
- // Token invalid
- $new_token = (preg_match('/X-CSRF-TOKEN: (\S+)/', $resp_header, $matches) ? $matches[1] : '');
- file_put_contents($file_path_token, $new_token, true);
- echo("Token invalid");
- $resp_body = SendTrade($rs, $new_token);
- // break;
- }
- curl_close($promote_user);
- return $resp_body;
- }
- // Change user's group rank and echo results
- echo SendTrade(getRS(), $current_token);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement