Closed LukeTechnoUserOfficial closed 8 years ago
Misc.php:
<?php // These are just a few miscellaneous ROBLOX APIs in php function form that you might want to use. function UsernameFromID($userId) { return json_decode(file_get_contents("http://api.roblox.com/users/$userId"),true)['Username']; } function IDFromUsername($username) { return json_decode(file_get_contents("http://api.roblox.com/users/get-by-username?username=$username"),true)['Id']; } function getRankInGroup($userId,$groupId) { return (int)simplexml_load_file("http://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRank&playerid=$userId&groupid=$groupId"); } function fetchShout($cookie,$group) { // Log in for correct permissions $curl = curl_init("http://www.roblox.com/My/Groups.aspx?gid=$group"); curl_setopt_array($curl,array( CURLOPT_RETURNTRANSFER => true, CURLOPT_COOKIEFILE => $cookie, CURLOPT_COOKIEJAR => $cookie )); $response = curl_exec($curl); curl_close($curl); $doc = new DOMDocument(); $doc->loadHTML($response); return $doc->getElementById('ctl00_cphRoblox_GroupStatusPane_StatusTextField')->textContent; } ?>
getRoles.php:
<?php /*
ROBLOX actually has an API for getting group roles including their IDs...
BUT IT'S BROKEN (found out the hard way).
From all the groups I've seen this API will often miss one of the ranks; however, in case
it's ever fixed here's a function that uses it:
function getRoleSets($group) {
$ranks = array();
$roles = json_decode(file_get_contents("http://www.roblox.com/api/groups/$group/RoleSets/"),true);
foreach($roles as $role => $array) {
$ranks[$array['Rank']] = $array['ID'];
}
return $ranks;
}
This is much faster than the following one, if ROBLOX does fix their API you should use it.
It returns both the regular rank array and another array that has the rank matched with its role.
To get this do:
list($ranks,$roles) = getRoleSets($group);
If you want the best performance put in the ranks manually.
*/
function getRoleSets($group) {
$roles = json_decode(file_get_contents("http://api.roblox.com/groups/$group"),true)['Roles'];
$ids = array();
$ranks = array();
$url = "http://www.roblox.com/Groups/group.aspx?gid=$group";
$doc = new DOMDocument();
$doc->loadHTMLFile($url);
$find = new DomXPath($doc);
$nodes = $find->query('//select[contains(@id,\'ctl00_cphRoblox_rbxGroupRoleSetMembersPane_dlRolesetList\')]//option[@value]');
foreach ($nodes as $node) {
$ids[$node->textContent] = $node->getAttribute('value');
}
foreach ($ids as $name => $id) {
foreach ($roles as $array) {
if ($name == $array['Name']) {
$ranks[$array['Rank']] = $id;
}
}
}
return array($ranks,array_flip($ids));
}
function getRoleSet($ranks,$rank) {
foreach($ranks as $num => $roleset) {
if ($rank == $num) {
return $roleset;
}
}
}
?>
Is your receiver.php
file outside the roblox-bots-master
folder?
This isn't an issue with the code, the issue lies within your setup.
Okay I'll try looking again at my setup
My file setup seems to be correct. I don't feel I have missed anything. And yeah the receiver is outside the whole folder with the roblox-bots-master. The promotion bot only works once a day for some reason because only one person gets promoted e.e
The problem seems to be with your host (a part of your setup).
What does this mean?
[12-May-2016 08:48:12 UTC] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0 [12-May-2016 08:48:13 UTC] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0 [12-May-2016 08:48:13 UTC] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
That is a deprecation warning, it is not serious and does not affect script functionality whatsoever.
Well everything I try doesn't work
Can you just add me on Skype and help me 1-to-1 and solve my problem? Skype - luketechnocorps
Is your host Hostinger?
Yeah, it doesn't seem to work
From my experience, I can say that Hostinger is really bad and I also had the same problem with Hostinger. Try something else.
Do you have any suggestions? like what do you normally use?
Totally off topic, but if you host with any of those companies you're a fool.
Please give me a good one please
This issue has become unrelated to the scripts themselves. Close #19, do not make another issue related to your own setup only.
PHP Build 7.0
[11-May-2016 22:37:55 UTC] PHP Warning: DOMDocument::loadHTMLFile(http://www.roblox.com/Groups/group.aspx?gid=2820985): failed to open stream: Connection timed out in /home/u827506591/public_html/roblox-bots-master/Includes/getRoles.php on line 32 [11-May-2016 22:37:56 UTC] PHP Warning: simplexml_load_file(http://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRank&playerid=27453460&groupid=2820985): failed to open stream: Operation now in progress in /home/u827506591/public_html/roblox-bots-master/Includes/misc.php on line 10 [11-May-2016 22:37:56 UTC] PHP Warning: DOMDocument::loadHTMLFile(http://www.roblox.com/Groups/group.aspx?gid=2820985): failed to open stream: Connection timed out in /home/u827506591/public_html/roblox-bots-master/Includes/getRoles.php on line 32 [11-May-2016 22:37:56 UTC] PHP Warning: DOMDocument::loadHTMLFile(http://www.roblox.com/Groups/group.aspx?gid=2820985): failed to open stream: Connection timed out in /home/u827506591/public_html/roblox-bots-master/Includes/getRoles.php on line 32 [11-May-2016 22:38:00 UTC] PHP Warning: simplexml_load_file(http://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRank&playerid=27453460&groupid=2820985): failed to open stream: Operation now in progress in /home/u827506591/public_html/roblox-bots-master/Includes/misc.php on line 10 [11-May-2016 22:38:00 UTC] PHP Warning: simplexml_load_file(http://www.roblox.com/Game/LuaWebService/HandleSocialRequest.ashx?method=GetGroupRank&playerid=27453460&groupid=2820985): failed to open stream: Operation now in progress in /home/u827506591/public_html/roblox-bots-master/Includes/misc.php on line 10