sentanos / roblox-bots

This project is no longer maintained, please consider this instead: https://github.com/sentanos/roblox-js-server
17 stars 28 forks source link

Invalid promoting permissions. #16

Closed ghost closed 8 years ago

ghost commented 8 years ago

There seems to be a problem with 'changeRank.php'.

Whenever I try to promote a player it gives me the error 'Invalid promoting permissions'. Yet when I try 'shout.php' it works. I'm not exactly sure what causes the problem since I'm pretty sure I did and followed the instructions correctly.

Also I noticed that when I manually tried (not sure if this is the correct way to do it) http://www.roblox.com/groups/api/change-member-rank?groupId=1068188&newRoleSetId=6&targetUserId=62387413 it ended up with the error 404? Could it be that ROBLOX changed their APIs or is there something wrong on my end?

0ca6a8e22fb6888cd21d9403668462e2

sentanos commented 8 years ago

I have tested the function and confirmed that it is still working, this is most likely a problem on your end. First of all, when you say "shout worked", do you mean when you send the request to the server it comes back saying it worked or you actually see the shout in the group? Unlike updateRank, shout does not check if the shout was actually successful: if the page loaded it returns a success message.

If the shout is not actually showing up, please refer to #issuecomment-188284257 to fix login issues. Otherwise, these are what you should check:

ghost commented 8 years ago

Yeah, when I tested the shout it worked perfectly and I could see the shout in the group as well. I tried manually promoting few players with the bot account and it worked that means that bot has the necessary permissions. I'm pretty sure my parameters are correct:

{ "Validate":"1234", -- PostKey "Action":"setRank", -- Action "Parameter1":"76314425", -- User ID "Parameter2":"6" -- Rank I want to promote him to }

Here are the ranks/roles of the group. The bot is 'Club Manager'. f6d9e63697274b1536db45509146dfe8

I'll keep on trying, thanks for the answer!

Gskartwii commented 8 years ago

The issue here is that you're passing a rank ID instead of a roleset ID. There is some API to get the roleset ID, but I can't remember where.

sentanos commented 8 years ago

@Gskartwii Assuming @Zcython is using the function correctly on his server (or using the recommended receiver.php), the matching rolesetID should be retrieved automatically.

The script calling updateRanks should retrieve an array of rolesets and an array of ranks from the getRoleSets function before passing it to updateRank, which will then match the rank up to the roleset.

list($ranks,$roles) =   getRoleSets($group);

Absolutely horrible setup, I know, but at the moment I can't be bothered to rewrite the entire project .

ghost commented 8 years ago

Fixed it. The problem was with the group rank names. I had to remove the symbols from them and then it worked perfectly, thanks for the help @FroastJ , @Gskartwii !

sentanos commented 8 years ago

Great thing that you got it fixed but in that case it's still a problem that the script won't work if the rank names have symbols. Unfortunately I have not been able to replicate the problem myself with similar symbols. If you could provide the exact rank names I'll replicate it exactly and try to fix the error.

ghost commented 8 years ago

Sure thing, here you go: ╡╞ Ranks that I had previously: ╡Bartender╞, ╡DJ╞, ╡Attender╞ etc. Hopefully, you can fix the error! :+1:

sentanos commented 8 years ago

@Zcython Do you have the separator rank names?

ghost commented 8 years ago

Yeah, for them I use the symbol: ▬▬▬▬▬▬ I usually don't promote people to that rank.