Last active 1 month ago

Configures your Roblox account automatically. To use this, execute the script via the browser console on the Roblox settings page while logged into your account.

snipcola revised this gist 8 months ago. Go to revision

1 file changed, 148 insertions, 180 deletions

Roblox Account Configurator.js

@@ -1,42 +1,148 @@
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",
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 + },
28 30 },
29 - };
30 -
31 - const csrfToken = localStorage.getItem("x-csrf-token");
32 -
33 - const steps = {
34 - successes: 0,
35 - fails: 0,
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 + }
36 142 };
37 143
38 144 function log(success, step) {
39 - steps[success ? "successes" : "fails"] += 1;
145 + config.count[success ? "successes" : "fails"] += 1;
40 146 console.log(`${success ? "✅" : "⚠️"} ${step}`);
41 147 }
42 148
@@ -50,156 +156,18 @@ await (async function () {
50 156 });
51 157 }
52 158
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 - };
159 + console.log("⚙️ Configuring account");
181 160
161 + await Promise.all(config.steps.map(async function ({ execute, name }) {
182 162 try {
183 - const response = await request(config);
184 - log(response.status === 200, step);
163 + log((await execute()) || false, name);
185 164 } catch (_) {
186 - log(false, step);
165 + log(false, name);
187 166 }
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 - ]);
167 + }));
200 168
201 - console.log(`📋 ${steps.successes} successes, ${steps.fails} fails`);
169 + console.log(`📋 ${config.count.successes} successes, ${config.count.fails} fails`);
202 170 console.log(
203 - steps.fails > 0 ? "⚠️ There were some failures" : "✅ Everything succeeded",
171 + config.count.fails > 0 ? "⚠️ There were some failures" : "✅ Everything succeeded",
204 172 );
205 173 })();

snipcola revised this gist 9 months ago. Go to revision

No changes

snipcola revised this gist 9 months ago. Go to revision

1 file changed, 205 insertions

Roblox Account Configurator.js (file created)

@@ -0,0 +1,205 @@
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 + })();
Newer Older