NATION

PASSWORD

Quick Issues [UserScript]

Bug reports, general help, ideas for improvements, and questions about how things are meant to work.
User avatar
Aibohphobia
Spokesperson
 
Posts: 200
Founded: Mar 15, 2012
Ex-Nation

Quick Issues [UserScript]

Postby Aibohphobia » Thu Mar 03, 2016 3:57 am

Hi everyone.

I've been logging in and making decisions on issues for almost 4 years by now. It used to be 2 issues per day, now it's 4, and I remember most of the first 300 by heart. I've finally got sick of it, so here is a script that makes things easier.
I'm posting this in the hope someone else will find it useful.

So what's the deal?
My script saves the decisions you make, so next time you encounter the same issue the option you've picked last time is going to be highlighted.
This is particularly useful for when you can't be bothered with overtaxing your own memory. It's also useful for those of us who want to check out a different option each time.
The script doesn't automate anything - it merely highlights the options you've picked for issues you've encountered before.



General information

What's a userscript? A userscript is a tiny piece of code that runs inside your browser. Why is it better than a full-blown extension or a standalone application? Because the CPU imprint is negligible, and the code runs automatically where it's needed (when properly written). The code is also cross-browser (when properly written), unlike browser-specific extensions.

To install a userscript, you'll need:
  • the GreaseMonkey addon if you're running Firefox
  • the TamperMonkey addon if you're running Google Chrome
  • the ViolentMonkey addon if you're running one of the later versions of Opera
Opera 12 (and earlier) users will need to create a folder on their file system to store the scripts and "point" the browser to it. I'm sure you know how it's done if you're still using it.
Note: Firefox is changing its addon policies, so GreaseMonkey might become unavailable. Use TamperMonkey/ViolentMonkey for Firefox instead if that's the case.

This is the script file itself: it's always going to be there.

It pretty much does everything by itself. However, I must warn you that clearing your browser's history is going to remove the information stored by it, so please ensure yourself against losing your data by backing it up. There's a gear button down the bottom of each issue -
Image
- which, once clicked, opens up a text field with all your currently stored information. When cleaning up your browser, simply copy the string from the text field, then clean up your browser, open up the gear menu, and then paste the aforementioned string into the same text field (replacing whatever the script put in there because it had nothing interesting to show) and click "Save". Don't modify the string itself, unless you know what you're doing.



Somewhat more technical details

Tested...
  • ... themes: Rift, Dark, Century, Century Dark, Century Wide RMB
  • ... browsers: Firefox (>=4, should work on <4, but Google Ad Services make it impossible to log onto the site anyway), Google Chrome, Opera (>12 and <=12);
    should work on Internet Explorer >8 as well, but Internet Explorer has no addons for installing and running userscripts at the moment

Insane puppeteers should be happy as well, because decisions are stored separately for each nation.

Information's stored in localStorage, the format is JSON.
I tried to make the code as readable as possible, so feel free to update it to your needs if you want to. As long as you don't sell it, for some reason, I won't complain.



Additional notes

Please report all your bugs in this thread and don't send me telegrams (unless you want to thank me, you weirdo). I'd rather have all the information stored in one place, where I'll read it without forgetting about it, because what you say matters and is not to be forgotten.

Please don't ask me for any additional functionality. I like the script the way it is. I'd probably like it even more if it stored information on how certain values had changed because of a decision taken. However, browser storage is limited, and this kind of functionality would become problematic when dealing with huge numbers of nations under the same browser.
Last edited by Aibohphobia on Sun Oct 01, 2017 6:46 pm, edited 1 time in total.

User avatar
Zocra
Diplomat
 
Posts: 874
Founded: Feb 21, 2013
Inoffensive Centrist Democracy

Postby Zocra » Thu Mar 03, 2016 10:37 am

Neato, I'll try it out! I love the community-driven projects here on NS!
Last edited by Google Bot today, edited 1 time in total. | I exist for your benefit.

Founder: United Alliances
Timezone: US Eastern

User avatar
Mournivalia
Lobbyist
 
Posts: 23
Founded: May 23, 2012
Father Knows Best State

Postby Mournivalia » Mon Mar 07, 2016 4:54 am

A great idea! dL'd and running, cheers mate :)
The Dominioneer of Mournivalia
Glass Gallows Sigillite


Return to Technical

Who is online

Users browsing this forum: -Abrahamia-, Danternoust, Einaro, Geopolity, Grandocantorica, Mue, New Yi Empire, Second Scratch Empire, Shirahime, Tape, The Plough Islands, Three Galaxies, Unionization of European Countries

Advertisement

Remove ads