Issue with my group rank bot

Apparently I get this error when I try to rank players in my group with the application (with a bot account):
Noblox - The use of cookieLogin is deprecated: Please make use of the new methods setCookie & refreshCookie.

Everything seems fine, however it seems like cookieLogin is deprecated, and I see no information on setCookie & refreshCookie online.

Script (java):

/*INSERT GROUP ID AND COOKIE BELOW*/

var groupId = 6299931 // << Replace 12345 with your Group Id
var cookie = "not showing" // << Put your account cookie 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.cookieLogin(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);
});

Module:

local BotManager = {}

local HttpService = game:GetService('HttpService')
local GlitchURL = 'not showing'

function BotManager:SetRank(UserId, Rank)
	--game:GetService("HttpService"):GetAsync(GlitchURL .. "ranker?userid=%d" .. UserId .. "&rank=%d" .. Rank)
	local Ok, Result = pcall(function()
		HttpService:GetAsync('%s%d%d'):format(GlitchURL, UserId, Rank)
	end)
end

return BotManager

If anyone is experienced in this field, I’d like an explanation of why it is deprecated and how it could be fixed, if possible.

Source: https://noblox.js.org/#introduction
Guide used: https://www.youtube.com/watch?v=_2TEyJLOl7Y&ab_channel=RoScripter

There appears to be some on the front page of the noblox.js documentation you listed.

const noblox = require('noblox.js');

async function run() {
  await noblox.setCookie('_ROBLOSECURITYKEYFORCOOLBOY57');
}

run();

Interesting, I didn’t notice it.

I’ll try to paste it at the bottom line and see what happens. Thank you.

Just change await rbx.cookieLogin(cookie); to await noblox.setCookie(cookie);

Actuall no, this would be the right way I assume:

/*INSERT GROUP ID AND COOKIE BELOW*/

var groupId = 6299931 // << Replace 12345 with your Group Id
var cookie = "not showing" // << Put your account cookie inside of the quotes


/*INSERT GROUP ID AND COOKIE ABOVE*/

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

async function run() {
  await noblox.setCookie(cookie);
}

run();

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

async function startApp() {
  await rbx.cookieLogin(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);
});

Wouldn’t it be await rbx.setCookie(cookie);? Because what you provided gives an error on the “noblox” word.

yes, sorry. That is right. I glanced too fast

setCookie appears to be working for me, so I assume you will have no issue. I created an account and used it’s new cookie and it sent me a friend request.

const noblox = require("noblox.js")

const cookie = "my super long and cool cookie"

async function start() {
    await noblox.setCookie(cookie)

    const delivered = await noblox.sendFriendRequest(39939779)
    console.log(delivered)
}

start()

Yes, it works - however the bot refuses to rank the user.
Can I be logged in while this happens? (I am currently on the bot account trying to rank a group member in-game).

I see no errors, but the user’s rank won’t change.

Should be no issue if you’re logged in.

Try passing an object like the example does.

rbx.setRank({group: groupId, target: parseInt(User), rank: parseInt(Rank)})

Also it says it returns a promise? Try seeing what the promise resolves.
rbx.setRank({group: groupId, target: parseInt(User), rank: parseInt(Rank)}).then((response) => console.log(response))

I’m not too familiar with express or noblox though.

I recommend you use Version 2 of the Ranking System

Everything is here

1 Like

I’ll just paste some useless stuff because roblox moderation is at its worst.
My question is: What is the difference?

Doesn’t log anything, everything seems broken and refuse to run.
I can’t really tell what the issue is either because this is my first time messing with it.

Do not always use code from the web. Make your own for the experience/knowledge as well as to prevent bugs. If I was you, I would look at the documentation found here:

GitHub documentation found in description
All functions and recipes on the official page

const rbx = require('noblox.js');
async function StartApp() {
    await rbx.SetCookie("");
    let user = await rbx.getCurrentUser()
}
StartApp();

That is a basic part of code found in the GitHub page. Build on there using express.js (a way to communicate between programs).

I am not looking for the experience, I have that part in lua already.

This is only a test.

(Regardless, doesn’t work so I’m done here.)

I mean you should not give up.

I’m not, the only issue I currently have doesn’t even make sense.

Look at my post before. That code works, though do insert your cookie WITH the warning part at the start

Try getting a new cookie. By the way, do not log out, only close your browser.