Forked from pedrofracassi/quicksteamactivator.user.js
Last active
November 28, 2023 17:58
-
-
Save Haoose/c081fa5dd95c4d2139f3e3bb310598cb to your computer and use it in GitHub Desktop.
Steam Key Quick Activator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Steam Key Quick Activator | |
// @namespace http://pedrofracassi.me/ | |
// @version 1.2 | |
// @description Activates Steam Keys Quickly! | |
// @author Pedro Fracassi (http://pedrofracassi.me) | |
// @match https://store.steampowered.com/account/registerkey?key=* | |
// @grant none | |
// @run-at document-end | |
// ==/UserScript== | |
'use strict'; | |
var key = document.getElementById('product_key').value; | |
if (key != '') { | |
// Check for Key | |
var flag = true; | |
var array = key.split("-"); | |
if (array.length === 3 || array.length === 5){ | |
array.forEach(y => { | |
if (y.length !== 5) flag = false; | |
}); | |
} | |
else flag = false; | |
if (flag === true) { | |
document.getElementById('accept_ssa').click(); | |
document.getElementById('register_btn').click(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: | |
var selection = window.getSelection().toString(); | |
if (selection) { | |
location.href = 'https://store.steampowered.com/account/registerkey?key=' + selection; | |
} else { | |
result = prompt('Insert Steam Key'); | |
if(result != null){ | |
location.href = 'https://store.steampowered.com/account/registerkey?key=' + result; | |
} else { | |
location.href = 'https://store.steampowered.com/account/registerkey'; | |
} | |
} |
It took way too long, but I managed to work out the regex for the steam key formats:
key.match(/((((?![osuOSU])[a-zA-z1-9]){5}-){2}){1,2}((?![osuOSU])[a-zA-z1-9]){5}$|((?![osuOSU])[a-zA-z1-9]){15}$/g);
It matches to
AAAAA-BBBBB-CCCCC
AAAAA-BBBBB-CCCCC-DDDDD-EEEEE
237ABCDGHJLPRST
With case-insensitive alphabet and digits but without O
, S
, U
, and 0
, probably because they look too similar to other characters.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How do I install this?
Install tampermonkey, and then click this link
If you want to be even faster, add this code to your bookmarks and click it whenever you need to activate a key.
It will open steam's activation page with your selected text as a key. If you don't have anything selected, it will ask you for a key.
AAAAA-BBBBB-CCCCC