-
-
Save nsdimitri/f0fb14372d503a519efdf3fcc7f53ca0 to your computer and use it in GitHub Desktop.
NSNationCreationAutoFill
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 NSNationCreationAutoFill | |
// @version 2.0 | |
// @description Autofill most fields except name, passwords and tick boxes | |
// @author nsdimitri, Assisted by sitethief on NS Cards Discord | |
// @noframes | |
// @copyright MIT https://mit-license.org/ | |
// @match https://www.nationstates.net/page=create_nation1 | |
// @grant none | |
// ==/UserScript== | |
(function () { | |
'use strict'; | |
const options = { | |
slogan: "", | |
currency: "", | |
animal: "", | |
email: "", | |
desc: "", // Must be a number between 100-138 inclusive | |
flag: "" // Must be a flag file name | |
}; | |
// End of customizable options | |
function setFieldValue(fieldName, fieldValue) { | |
const field = document.querySelector(`input[name="${fieldName}"]`); | |
if (field) { | |
field.value = fieldValue; | |
} | |
} | |
setFieldValue("currency", options.currency); | |
setFieldValue("slogan", options.slogan); | |
setFieldValue("animal", options.animal); | |
setFieldValue("email", options.email); | |
document.getElementById('type').value = options.desc; | |
document.getElementById('flag').value = options.flag; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment