Roblox bulk log-in helper

Makes logging in with a combolist easier

  1. // ==UserScript==
  2. // @name Roblox bulk log-in helper
  3. // @version 1.01
  4. // @description Makes logging in with a combolist easier
  5. // @match https://www.roblox.com/*/login*
  6. // @match https://www.roblox.com/*/Login*
  7. // @match https://www.roblox.com/login*
  8. // @match https://www.roblox.com/Login*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=roblox.com
  10. // @namespace https://greatest.deepsurf.us/users/1419654
  11. // ==/UserScript==
  12.  
  13. (async function() {
  14. 'use strict';
  15. const url = window.document.location.href;
  16.  
  17. if (!url.includes('securityNotification')) {
  18. // Log-in
  19. const usernameElem = await document.querySelector('#login-username');
  20. const passwordElem = await document.querySelector('#login-password');
  21. const loginElem = await document.querySelector('#login-button');
  22.  
  23. if (usernameElem && passwordElem) {
  24.  
  25. const redefineValue = (elem, newValue) => {
  26. Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')
  27. .set.call(elem, newValue);
  28. elem.dispatchEvent(new Event('input', { bubbles: true }));
  29. };
  30.  
  31.  
  32. while (true) {
  33. if (usernameElem.value.includes(':')) {
  34. const [ username, password ] = usernameElem.value.split(':');
  35.  
  36. await redefineValue(usernameElem, username);
  37. await redefineValue(passwordElem, password);
  38.  
  39. loginElem.click();
  40. break;
  41. }
  42.  
  43. await new Promise(resolve => setTimeout(resolve, 100));
  44. }
  45. }
  46.  
  47. // Fail check
  48. const polite = document.querySelector("#login-form .login-form > .password-form-group > div");
  49. if (!polite) return console.error("Element not found. Exiting.");
  50.  
  51. while (true) {
  52. try {
  53. const message = polite.querySelector("p");
  54. if (message && message.textContent === 'Incorrect username or password.') {
  55. window.document.location.href = 'https://www.roblox.com/login';
  56. break;
  57. }
  58. } catch (e) {}
  59.  
  60. await new Promise(resolve => setTimeout(resolve, 100));
  61. }
  62. } else window.document.location.href = 'https://www.roblox.com/login';
  63. })();