How to Script a Group Ranking Bot

Hey! Today I will be showing you how you can make your own personal group ranking bot!


Step 1:

Make the account you want to use as your bot. Add that bot to the group you want to rank people in. Give the bot account permissions so they can rank people.


Step 2:

Go to glitch.com. This is a free website where we will do some of the coding and hosting. It should look something like this:

Log in however you want. (GitHub, Google, etc.) Then at the top right press new project.

In the server.js file:

delete everything and paste in this code

/*INSERT GROUP ID AND COOKIE BELOW*/

var groupId = 12345 // << Replace 12345 with your Group Id
var cookie = "" // << Put your account cookie/.ROBLOSECURITY key inside of the quotes

/*INSERT GROUP ID AND COOKIE ABOVE*/


const express = require("express");
const rbx = require("noblox.js");
const app = express();

app.use(express.static("public"));

async function startApp() {
  await rbx.setCookie(cookie);
  let currentUser = await rbx.getCurrentUser();
  console.log(currentUser.UserName);
}
startApp();

app.get("/ranker", (req, res) => {
    var User = req.param("userid");
    var Rank = req.param("rank");
  
    rbx.setRank(groupId, parseInt(User), parseInt(Rank));
    res.json("Ranked!");
});

const listener = app.listen(process.env.PORT, () => {
  console.log("Your app is listening on port " + listener.address().port);
});

Next, go to the package.json file right above the server.js file

Click add package and type in “noblox.js”, and click on the first one.

Make sure you delete the src file and all it’s contents.
Now, click preview, then preview in a new window

image

It should open a pretty much blank webpage with an error code. Just ignore this. The only thing we need is to copy the url at the top.


Step 3:

Now, load up Roblox Studio. Make sure your game has HTTP Requests enabled. Make a script in ServerScriptStorage with the following code:

local GlitchURL = "" --Place the glitch project URL we copied inside of the quotes

function rankUser(UserId, RoleId)
	game:GetService("HttpService"):GetAsync(GlitchURL .. "ranker?userid=" .. UserId .. "&rank=" .. RoleId)
end

local UserId = 12345 --Replace 12345 with the users userid
local RoleId = 255 --Replace 255 with the role id that you would like the user to be set to

rankUser(UserId, RoleId)

Now all you have to do is test like you normally would in Studio and it should work
Note: The rank bot must be a higher rank than the rank you want to set the user to.
Thanks for reading and I hope this helped!

22 Likes

Something like this already exists that explains everything a lot further.

6 Likes

I feel a bit scared using a .ROBLOSECURITY cookie (unless that’s just me being dum as I skimmed the post)

2 Likes

Do not ever put sensitive information such as cookies or tokens in your code when using Glitch as anyone with the link will be able to see it. Use .env file instead as Glitch will not show the stored values within it. If you are unsure on how to use it, refer to the official article.

I would also highly recommend to use alt account for a bot as if it get’s hacked, you will not lose your valuable main account.

5 Likes

Of course its a good system, but is it safe to put in your account’s cookies?

Yes, it’s safe. The token regenerates when you log out.

The whole point is to make a new account as the ranking bot.

Oops for @LandnBlu
He spent a good time making it ;-;
Read deeper next time!

2 Likes

How can this solve the invalidation issue?

1 Like

What do you mean by that?

3 Likes

Have you tried this after March 2022? Once you login with the ranking bot, does it rank or does it give you a error?

1 Like

Yes, but once the group becomes popular if someone has that link they grab the cookie and they can rank anyone to any position, am I correct?

If you had the money I’m fairly sure Replit would work fine, but I’m not a Node developer, so not sure.

2 Likes

No one will get the link. And I’m a node developer too.

1 Like

True, but if this group lets say trusts their admins and someone pays an admin to reveal the code to auto-rank all their alts then that is dangerous, and is possible, since if your a dev team your other dev’s could leak the code for money, I assume?

1 Like

How are you so sure that nobody will get the link? And it doesn’t really matter if they can or not, it’s still a lot safer to store sensitive information in appropriate place which is the .env file unless you plan to host it on your own machine.

1 Like

It says Error: Cannot find module ‘express’

You have to install it

(using the command npm i express)

I don’t think you can host this bot on VPS anymore, since roblox’s new login system messed it up.
Cookie resets whenever you logout from your account and when you use VPS to login with cookie then it logs you out from your browser because your IP is changed, and when you put the cookie in your vps its gonna return as invalid cookie.

And I dont think you are allowed to create accounts through roblox’s API.

Is there any solution? (Paid)

But you can bypass it on few paid hosts, if you are ready to pay then take a look at this github issue.

Is there another solution? (Free)

Well yes, just host the bot on your device where your account is logged in.

Actually, you can still host the bot on VPS because I am doing it through DigitalOcean and it has a Static IP that always stays the same so your bot will never log out. You can also detach from the bot to keep it online 24/7.

ye i said it, you can bypass it on some hosts but they are paid.