Roblox Account Configurator.js
· 4.9 KiB · JavaScript
Raw
await(async function () {
const config = {
settings: {
avatarType: "R15",
scales: {
height: 0.9,
width: 0.7,
head: 0.95,
proportion: 0,
bodyType: 0,
},
gender: 2, // Male
language: "en_us", // English
theme: "Dark",
userSettings: {
whoCanSeeMySocialNetworks: "NoOne",
whoCanChatWithMeInExperiences: "AllUsers",
whoCanWhisperChatWithMeInExperiences: "AllUsers",
whoCanOneOnOnePartyWithMe: "Friends",
whoCanGroupPartyWithMe: "Friends",
whoCanSeeMyOnlineStatus: "Friends",
whoCanJoinMeInExperiences: "Friends",
updateFriendsAboutMyActivity: "No",
privateServerPrivacy: "Friends",
whoCanSeeMyInventory: "NoOne",
allowPersonalizedAdvertising: "Disabled",
allowSellShareData: "Disabled",
allowMarketingEmailNotifications: "Disabled",
},
},
token: localStorage.getItem("x-csrf-token"),
steps: [
{
name: "Set Avatar Type",
execute: async function () {
const response = await request({
URL: "https://avatar.roblox.com/v1/avatar/set-player-avatar-type",
Method: "POST",
Headers: {
"Content-Type": "application/json",
"x-csrf-token": config.token,
},
Data: {
playerAvatarType: config.settings.avatarType,
},
});
return response.status === 200 && (await response.json()).success;
}
},
{
name: "Set Scales",
execute: async function () {
const response = await request({
URL: "https://avatar.roblox.com/v1/avatar/set-scales",
Method: "POST",
Headers: {
"Content-Type": "application/json",
"x-csrf-token": config.token,
},
Data: config.settings.scales,
});
return response.status === 200 && (await response.json()).success;
}
},
{
name: "Set Gender",
execute: async function () {
const response = await request({
URL: "https://users.roblox.com/v1/gender",
Method: "POST",
Headers: {
"Content-Type": "application/json",
"x-csrf-token": config.token,
},
Data: {
gender: config.settings.gender,
},
});
return response.status === 200;
}
},
{
name: "Set Language",
execute: async function () {
const response = await request({
URL: "https://locale.roblox.com/v1/locales/set-user-supported-locale",
Method: "POST",
Headers: {
"Content-Type": "application/json",
"x-csrf-token": config.token,
},
Data: {
supportedLocaleCode: config.settings.language,
},
});
return response.status === 200 && (await response.json()).success;
}
},
{
name: "Set Theme",
execute: async function () {
const response = await request({
URL: "https://accountsettings.roblox.com/v1/themes/user",
Method: "PATCH",
Headers: {
"Content-Type": "application/json",
"x-csrf-token": config.token,
},
Data: {
themeType: config.settings.theme,
},
});
return response.status === 200;
}
},
{
name: "Set User Settings",
execute: async function () {
const response = await request({
URL: "https://apis.roblox.com/user-settings-api/v1/user-settings",
Method: "POST",
Headers: {
"Content-Type": "application/json",
"x-csrf-token": config.token,
},
Data: config.settings.userSettings,
});
return response.status === 200;
}
}
],
count: {
successes: 0,
fails: 0,
}
};
function log(success, step) {
config.count[success ? "successes" : "fails"] += 1;
console.log(`${success ? "✅" : "⚠️"} ${step}`);
}
async function request(config) {
return await fetch(config.URL, {
method: config.Method,
headers: config.Headers,
body: config.Data ? JSON.stringify(config.Data) : undefined,
credentials: "include",
referrer: "https://www.roblox.com",
});
}
console.log("⚙️ Configuring account");
await Promise.all(config.steps.map(async function ({ execute, name }) {
try {
log((await execute()) || false, name);
} catch (_) {
log(false, name);
}
}));
console.log(`📋 ${config.count.successes} successes, ${config.count.fails} fails`);
console.log(
config.count.fails > 0 ? "⚠️ There were some failures" : "✅ Everything succeeded",
);
})();
| 1 | await(async function () { |
| 2 | const config = { |
| 3 | settings: { |
| 4 | avatarType: "R15", |
| 5 | scales: { |
| 6 | height: 0.9, |
| 7 | width: 0.7, |
| 8 | head: 0.95, |
| 9 | proportion: 0, |
| 10 | bodyType: 0, |
| 11 | }, |
| 12 | gender: 2, // Male |
| 13 | language: "en_us", // English |
| 14 | theme: "Dark", |
| 15 | userSettings: { |
| 16 | whoCanSeeMySocialNetworks: "NoOne", |
| 17 | whoCanChatWithMeInExperiences: "AllUsers", |
| 18 | whoCanWhisperChatWithMeInExperiences: "AllUsers", |
| 19 | whoCanOneOnOnePartyWithMe: "Friends", |
| 20 | whoCanGroupPartyWithMe: "Friends", |
| 21 | whoCanSeeMyOnlineStatus: "Friends", |
| 22 | whoCanJoinMeInExperiences: "Friends", |
| 23 | updateFriendsAboutMyActivity: "No", |
| 24 | privateServerPrivacy: "Friends", |
| 25 | whoCanSeeMyInventory: "NoOne", |
| 26 | allowPersonalizedAdvertising: "Disabled", |
| 27 | allowSellShareData: "Disabled", |
| 28 | allowMarketingEmailNotifications: "Disabled", |
| 29 | }, |
| 30 | }, |
| 31 | token: localStorage.getItem("x-csrf-token"), |
| 32 | steps: [ |
| 33 | { |
| 34 | name: "Set Avatar Type", |
| 35 | execute: async function () { |
| 36 | const response = await request({ |
| 37 | URL: "https://avatar.roblox.com/v1/avatar/set-player-avatar-type", |
| 38 | Method: "POST", |
| 39 | Headers: { |
| 40 | "Content-Type": "application/json", |
| 41 | "x-csrf-token": config.token, |
| 42 | }, |
| 43 | Data: { |
| 44 | playerAvatarType: config.settings.avatarType, |
| 45 | }, |
| 46 | }); |
| 47 | |
| 48 | return response.status === 200 && (await response.json()).success; |
| 49 | } |
| 50 | }, |
| 51 | { |
| 52 | name: "Set Scales", |
| 53 | execute: async function () { |
| 54 | const response = await request({ |
| 55 | URL: "https://avatar.roblox.com/v1/avatar/set-scales", |
| 56 | Method: "POST", |
| 57 | Headers: { |
| 58 | "Content-Type": "application/json", |
| 59 | "x-csrf-token": config.token, |
| 60 | }, |
| 61 | Data: config.settings.scales, |
| 62 | }); |
| 63 | |
| 64 | return response.status === 200 && (await response.json()).success; |
| 65 | } |
| 66 | }, |
| 67 | { |
| 68 | name: "Set Gender", |
| 69 | execute: async function () { |
| 70 | const response = await request({ |
| 71 | URL: "https://users.roblox.com/v1/gender", |
| 72 | Method: "POST", |
| 73 | Headers: { |
| 74 | "Content-Type": "application/json", |
| 75 | "x-csrf-token": config.token, |
| 76 | }, |
| 77 | Data: { |
| 78 | gender: config.settings.gender, |
| 79 | }, |
| 80 | }); |
| 81 | |
| 82 | return response.status === 200; |
| 83 | } |
| 84 | }, |
| 85 | { |
| 86 | name: "Set Language", |
| 87 | execute: async function () { |
| 88 | const response = await request({ |
| 89 | URL: "https://locale.roblox.com/v1/locales/set-user-supported-locale", |
| 90 | Method: "POST", |
| 91 | Headers: { |
| 92 | "Content-Type": "application/json", |
| 93 | "x-csrf-token": config.token, |
| 94 | }, |
| 95 | Data: { |
| 96 | supportedLocaleCode: config.settings.language, |
| 97 | }, |
| 98 | }); |
| 99 | |
| 100 | return response.status === 200 && (await response.json()).success; |
| 101 | } |
| 102 | }, |
| 103 | { |
| 104 | name: "Set Theme", |
| 105 | execute: async function () { |
| 106 | const response = await request({ |
| 107 | URL: "https://accountsettings.roblox.com/v1/themes/user", |
| 108 | Method: "PATCH", |
| 109 | Headers: { |
| 110 | "Content-Type": "application/json", |
| 111 | "x-csrf-token": config.token, |
| 112 | }, |
| 113 | Data: { |
| 114 | themeType: config.settings.theme, |
| 115 | }, |
| 116 | }); |
| 117 | |
| 118 | return response.status === 200; |
| 119 | } |
| 120 | }, |
| 121 | { |
| 122 | name: "Set User Settings", |
| 123 | execute: async function () { |
| 124 | const response = await request({ |
| 125 | URL: "https://apis.roblox.com/user-settings-api/v1/user-settings", |
| 126 | Method: "POST", |
| 127 | Headers: { |
| 128 | "Content-Type": "application/json", |
| 129 | "x-csrf-token": config.token, |
| 130 | }, |
| 131 | Data: config.settings.userSettings, |
| 132 | }); |
| 133 | |
| 134 | return response.status === 200; |
| 135 | } |
| 136 | } |
| 137 | ], |
| 138 | count: { |
| 139 | successes: 0, |
| 140 | fails: 0, |
| 141 | } |
| 142 | }; |
| 143 | |
| 144 | function log(success, step) { |
| 145 | config.count[success ? "successes" : "fails"] += 1; |
| 146 | console.log(`${success ? "✅" : "⚠️"} ${step}`); |
| 147 | } |
| 148 | |
| 149 | async function request(config) { |
| 150 | return await fetch(config.URL, { |
| 151 | method: config.Method, |
| 152 | headers: config.Headers, |
| 153 | body: config.Data ? JSON.stringify(config.Data) : undefined, |
| 154 | credentials: "include", |
| 155 | referrer: "https://www.roblox.com", |
| 156 | }); |
| 157 | } |
| 158 | |
| 159 | console.log("⚙️ Configuring account"); |
| 160 | |
| 161 | await Promise.all(config.steps.map(async function ({ execute, name }) { |
| 162 | try { |
| 163 | log((await execute()) || false, name); |
| 164 | } catch (_) { |
| 165 | log(false, name); |
| 166 | } |
| 167 | })); |
| 168 | |
| 169 | console.log(`📋 ${config.count.successes} successes, ${config.count.fails} fails`); |
| 170 | console.log( |
| 171 | config.count.fails > 0 ? "⚠️ There were some failures" : "✅ Everything succeeded", |
| 172 | ); |
| 173 | })(); |