User Script Extensions

If you meant me, then sure, go ahead. I see you already added me to your circles :)

##Script to gather Galaxy Screen data as csv.
There is a way to display the Galaxy Screen data in console. This little script will prompt a save dialog automatically, or open the data in new tab, which then allows you to CTRL+S save it.

javascript:Mousetrap.trigger("s");window.open("data:text/csv;base64,"+btoa(NeptunesPride.universe.rawExportStars))

For more information see this thread.

Script to use the ruler for more than two stars: ā€œChainRulerā€

See here!

1 Like

##API to access public galaxy data

returns JSON

More information here!

I also want to state for the record that, because the game is always evolving, there may be changes to how data is communicated. I may accidentally break your scripts from time to time without warning.

2 Likes

##Mouse selection tool to limit Bulk Upgrade

More information here!

#Mouse binding for capturing a fullsize screenshot

Pressing U will pop up a window to save a screenshot, add extension .jpg and confirm.

[size=11]Copy-paste it into adressbar and remove the leading + sign.[/size]

+javascript:Mousetrap.bind(["u","U"],function(){window.location.href=document.getElementsByTagName("canvas")[0].toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");});

[size=11]HINT: If you zoom out the browser window (Ctrl+-) and create screenshot using this function, it will actually make it with much bigger resolution due to decreased content size.[/size]

#How to create Bookmarlet?

#NP2 database
Iā€™ve been collecting NP2 data of games I was in since 25.5.
14 games with more than 3 M items in a size of 170 MB.

If you use spread sheets reguralry for your games, have any programming skills or knowledge of plotting data to graphs, or if you are just bored or curious, contact me :wink:

I am offering access to my (complete) API in exchange for some tools you will make publicly available for others.

for example: The most desired functionality which started all this is to draw the stored data to a graph and then to switch between the ticks to provide a historical view without the need of making screenshots.

the database

recorded games

EDIT
The data I record is

Once for every game

  1. games
  2. players
  3. stars

Every two hours

  1. stars_owners_rel
  2. players_data

Here are the columns:

I am storing pretty much everything except fleet moves.

@Qwerty , I am curious (and sometimes bored), but I was also interested in starting to work (fiddle) with the API, maybe coming up with somthing interestingā€¦ And if you think this is somthing useful, great, I can try making somthing up.
(Also, Iā€™m not sure if I understood exactly, ĀæIs this like a ā€œrecordingā€ of games? ĀæIn order to make like a ā€œReplay gameā€ feature? ĀæLike when you end a Sid Meier Civ?)

@Qwerty, these are awesome - many thanks. Just out of curiosity, how did you know how to interact with the existing codebase? Iā€™m interested in writing some scripts of my own, or contributing in some way, at least, but I havenā€™t been able to find any documentation.

Bear with me if this already exists and Iā€™ve simply missed it - Iā€™m pretty new here, still feeling my way around.

Sorry, I donā€™t have any documentation but if you open a games with ā€œgameuā€ in place of game you will get and uncompressed version of the scripts that are easier to read.

example. http://triton.ironhelmt.com/gameu/1234

1 Like

Thatā€™s a good start - thanks!

HEY ā€¦ I just hit the URL ā€¦ and for grins, checked W3C validation. You actually are pretty close - just need to add some Alt Tags, close a few divs, and check your noscripts.

Just wanted to ask about the status on this project.

Is there a possibility to gather the game data after it has finished, or does it have to be done on regular basis during the game?

A possibility to review the game progression afterwards would be a blast !

So using one of your scripts @Qwerty I created this http://notifier.host-ed.me/#5122136871010304

It is in super-sucky javascript (I am a total programming newb) BUT I needed it as we have a 11 player game in our office and anyone stalling the game is a criminal!

So what it does - It creates notifications for you about the amount of players who have pressed ready.
You can change the game id after the hashtag in the url to change it to check your game instead.

Cheers

1 Like

Wow, I like it, this is super cool! I am glad someone is using the api. Feels goood :smile:
I wish I had more time developing more toolsā€¦ I had so much news coming.

1 Like

Hey guys :slight_smile:

@Ginzae bump

1 Like

For those worried about security, installing official extensions has undergone some review by the Chrome Store or the Firefox add-ons review process.

If that isnā€™t enough, I recommend running the game in a dedicated profile or a dedicated browser where all you do is play NP. The attack surface then becomes much smaller.

User script pose a very high risk, because there is nothing to defend you except your ability to read and understand the script. Extensions also pose a risk, albeit a lesser one. Neptuneā€™s Pride Agent is open source and I welcome security patches or patches of any kind on github.

O

1 Like

5 years latter, I have to agree with Hazey and would not recommend installing an extension.

1 Like