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