Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'simple_html_dom.php';
- include 'group.php';
- function GetMyID(){
- $second_response = Send("http://www.roblox.com/Game/GetCurrentUser.ashx");
- return $second_response;
- }
- function GetMyUsername(){
- $id = GetMyID();
- $fourth_response = Send("http://api.roblox.com/Users/$id");
- $user = json_decode($fourth_response);
- $actualuser = $user->{"Username"};
- return $actualuser;
- }
- function getUsername($id){
- $user_response = Send("http://api.roblox.com/Users/$id");
- $user = json_decode($user_response);
- return $user->{"Username"}? $user->{"Username"} : "yea um.. that id dosent exist";
- }
- function getID($user){
- $id_response = Send("http://api.roblox.com/users/get-by-username?username=$user");
- $actual_id = json_decode($id_response);
- return $actual_id->{"Id"}? $actual_id->{"Id"} : "yea um.. that username dosent exist";
- }
- function getRecUser($user){
- return Send("http://www.roblox.com/UserCheck/GetRecommendedUsername?usernameToTry=$user");
- }
- class docScanner extends simple_html_dom {
- function isOnline($id){
- $player_response = Send("http://www.roblox.com/User.aspx?ID=$id");
- $htmlDom = $this->load($player_response);
- $onlineStatus = $htmlDom->getElementById('profile-about-content-text');
- if(strpos($player_response,"UserOnlineMessage") != False or strpos($player_response, "ctl00_cphRoblox_rbxUserPane_UserOnlineStatusHyperLink") != False){
- return "Online";
- } else {
- return "Offline";
- }
- }
- }
- switch($_REQUEST["action"])
- {
- case "getIdFromUser":
- echo ($_REQUEST["userValue"] != null)? getId($_REQUEST["userValue"]) : "Error! No UserId Provided!";
- break;
- case "getUserFromId":
- echo getUsername($_REQUEST["plrId"]);
- break;
- case "getRecommendedUserName":
- echo getRecUser($_REQUEST["suggesteduser"]);
- break;
- case "getMyUser":
- echo GetMyUsername();
- break;
- case "getMyId":
- echo GetMyID();
- break;
- case "checkOnline":
- $scann = new docScanner();
- echo $scann->isOnline($_REQUEST["plrId"]);
- break;
- case "setRank":
- if(!isset($_REQUEST["userId"]))
- die("Error: No user id!");
- $userId = $_REQUEST["userId"];
- if(!isset($_REQUEST["groupId"]))
- die("Error: No group id!");
- $groupId = $_REQUEST["groupId"];
- if(isset($_REQUEST["rankId"]))
- {
- $rankId = $_REQUEST["rankId"];
- $rankValue = GetRankValueFromRankId($groupId,$_REQUEST["rankId"]);
- }
- elseif(isset($_REQUEST["rankValue"]))
- {
- $rankId = GetRankIdFromRankValue($groupId,$_REQUEST["rankValue"]);
- $rankValue = $_REQUEST["rankValue"];
- }
- elseif(isset($_REQUEST["rankTitle"]))
- {
- $rankId = GetRankIdFromRankValue($groupId,$_REQUEST["rankTitle"]);
- $rankValue = GetRankValueFromRankTitle($_REQUEST["rankTitle"]);
- }
- else
- die("Error: No rank specified!");
- if( $rankId == null || $rankValue == null )
- die("Error: No such rank!");
- $currentUserRank = GetUserRankInGroup($groupId,$userId);
- if( $currentUserRank == 0 )
- die("Error: Not in group!");
- if( $rankValue == $currentUserRank )
- die("Error: Already that rank!");
- elseif( $rankValue < $currentUserRank )
- if( isset($_REQUEST["force"]) && $_REQUEST["force"] == "true" )
- if ( ChangeRank($groupId,$rankId,$userId) )
- die("Ok: Demoted");
- else
- die("Error: Unknow (login maybe)");
- else
- die("Error: Demotes needs to be forced!");
- else
- if ( ChangeRank($groupId,$rankId,$userId) )
- die("Ok: Promoted");
- else
- die("Error: Unknow (login maybe)");
- break;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment