Hello All,
I’m trying to make a group rank bot which I control from in game by firing an HTTP request to my Replit code and I am using noblox on Replit to achieve this.
However, whenever I copy the cookie of the Bot account and put it into the Replit code, noblox says the code is invalid. I believe this is happening because of Roblox changing the cookie automatically as Replit is trying to log onto the account through a different IP then what I copied from.
Any help for ways to solve or overcome this is much appreciated.
Thanks!
Replit Code:
/*INSERT GROUP ID AND COOKIE BELOW*/
var groupId = 12345 // << Replace 12345 with your Group Id
var cookie = ""
/*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);
});
You could request credentials every time the replit is started, as replits aren’t guaranteed to have your replit IP location in the same place every time.
You could also use Open-Cloud once it gains support for group api
I had this exact same issue. EXACT. No worries, a stranger on the internet told me a solution, and now you’ll have one tell you too.
So, once you log into/create the account, you’d copy the cookie, and then delete the cookie. Refresh. This will log you out without invalidating the cookie.
That can take around a minute, but it can be way faster if you used an extension.
I use EditThisCookie, which is a safe and verified extension.
You open the extension, and get greeted with this page:
You’re done. Refresh, and you should be logged out. This means the cookies cleared successfully. The cookie you have should not expire when this happens.
However, I’m not sure about the expire dates. I was told it was two years, ten years, just one year, or even a day, but I can tell you that they don’t expire quickly. It’ll take a good while, if it ever, did, expire. Which it might.
I’m still experiencing the same issue after replicating the steps exactly how you said. Maybe I’m doing something wrong that I’m not sure of. Would you be able to help any further?
/*INSERT GROUP ID AND COOKIE BELOW*/
var groupId = 17006497 // << Replace 12345 with your Group Id
var cookie = "" //Cookie would paste here
/*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);
});
Maybe there’s some weird whitespace. I had that issue before. Maybe try adding cookie = cookie.trim()
… underneath the cookie variable to trim whitespace.