Initializes a new NSScript instance with script metadata and current user information.
The name of the script
The version of the script
The author of the script
The current user of the script
Attempts to abort an embassy that is currently being opened.
The name of the region to abort the embassy opening with.
A Promise that resolves to true if the embassy opening is aborted, false otherwise.
Adds a tag to the current region.
The tag to add.
A Promise that resolves to true if the tag is added, false otherwise.
Attempts to apply to or reapply to the World Assembly.
Optional
reapply: booleanWhether to reapply to the World Assembly if you've already recently applied
A Promise that resolves to true if the application is successful, false otherwise.
Attempts to ban and eject a nation from the current region.
The name of the nation to ban and eject.
A Promise that resolves to true if the ban and eject is successful, false otherwise.
Attempts to close an embassy with the specified region.
The name of the region to close the embassy with.
A Promise that resolves to true if the embassy is closed, false otherwise.
Attempts to cancel an embassy closure.
The name of the region to cancel the embassy closure with.
A Promise that resolves to true if the embassy closure is canceled, false otherwise.
Attempts to change the World Factbook Entry for the current region.
The new World Factbook Entry.
A Promise that resolves to true if the change is successful, false otherwise.
Attempts to create a new region with the specified parameters.
The name of the region to create.
The World Factbook Entry for the region.
Optional password for the region.
Whether the region is a frontier region. Defaults to false.
Whether the region has an executive delegate. Defaults to false.
A Promise that resolves to true if the creation is successful, false otherwise.
Attempts to eject a nation from the current region.
The name of the nation to ban and eject.
A Promise that resolves to true if the ban and eject is successful, false otherwise.
Attempts to endorse a nation in the World Assembly.
The name of the nation to endorse.
A Promise that resolves to true if the endorsement is successful, false otherwise.
Retrieves a value from the IndexedDB key-value store by its key.
The key of the value to retrieve
A Promise that resolves to the stored value, or undefined if the key is not found
Fetches and processes an HTML page from the NationStates site. Handles security checks and captcha detection.
The path to the page on NationStates.
Optional
payload: Record<string, string | number | boolean>Optional payload to send with the request.
A Promise that resolves to the HTML content of the page as a string.
Attempts to join the World Assembly as a member.
The name of the nation to join as.
The application ID for the nation.
A Promise that resolves to true if the join is successful, false otherwise.
Attempts to log in to a NationStates nation.
The name of the nation to log in to.
The password for the nation.
A Promise that resolves to true if login is successful, false otherwise.
Makes a request to a page on the NationStates HTML site.
The path to the page on NationStates (e.g., "index.html", "page=create_nation"). This path is relative to "https://www.nationstates.net/".
Optional
payload: Record<string, string | number | boolean>An object containing key-value pairs to be sent as the request payload.
A Promise that resolves to the Fetch API's Response object.
Attempts to move the current nation to a different region.
The name of the region to move to.
Optional
password: stringOptional password for the region.
A Promise that resolves to true if the move is successful, false otherwise.
Re-authenticates the current session by fetching the region page for RWBY, getting the CHK and localid values from the response.
Removes a tag from the current region.
The tag to remove.
A Promise that resolves to true if the tag is removed, false otherwise.
Requests an embassy from the current region to the specified region.
The name of the region to request an embassy from.
A Promise that resolves to true if the request is successful, false otherwise.
Attempts to resign from the World Assembly.
A Promise that resolves to true if the resignation is successful, false otherwise.
Attempts to create a new nation in the specified region.
The name of the nation to create.
Optional password for the nation.
A Promise that resolves to true if the creation is successful, false otherwise.
Stores a key-value pair in the IndexedDB key-value store.
The key under which the value will be stored
The value to be stored, which can be of any type
A Promise that resolves when the value is successfully stored
Attempts to unendorse a nation in the World Assembly.
The name of the nation to unendorse.
A Promise that resolves to true if the unendorsement is successful, false otherwise.
Attempts to vote in the World Assembly.
The council to vote in ("ga" for General Assembly, "sc" for Security Council).
The vote type ("for" or "against").
A Promise that resolves to true if the vote is successful, false otherwise.
Represents a script for interacting with NationStates, providing methods for authentication, nation management, storage, and web requests.
Description
Manages NationStates-specific operations like logging in, moving regions, applying to the World Assembly, and making authenticated HTML requests.