I get bored & write random scripts. Nexus needs a lot more user-side scripts.
Monospaced display on Nexus can be aggravating at times. As far as I can see, there is no way to modify the monospaced output from Nexus itself.
Monospec is a script for until this option is built into Nexus.
BEFORE
AFTERDownload
here.
Usage:
- -monos to display available monospaced fonts
- -monos # to select a specific font
- -monos # # to specify a font-size with a specific font
- -mono to reset to LiberationMono at 11pt
- Set monospec.default & monospec.size within the onLoad script to set a default setting
If you're interested you could extend to use the client's serverside memory to remember your settings; I haven't for several reasons.
For those interested in learning Javascript, this miniscript has a few extra things including a neat way to remove&inject CSS rules without re-polluting the page, a simple example of Promises (deferred functions), and jQuery's AJAX method.
NB: I wouldn't swap the monospace font too frequently within one session as there is no way to clean up the pre-existing CSS rule without trawling through the page's HTML.
Comments
Download here.
Also happy to take requests if the required triggers are provided.
If you use Chrome & depending on your version of hardware + software, you can now talk to your ship to fly it.
Download here.
https://www.youtube.com/watch?v=zWCA8JNdUSI&t=206
You have the conn, Starmourn Commander.
-ssp to start voice recognition.
May you have better luck without an accent. I may tweak it to improve the user experience but for whatever reason window.webkitSpeechRecognition works reliably only on my Mac not my Windows. So probably not.
Yes, great request. Prescient thanks to you! It is fairly self explanatory but let me know if you can't get it to work.
Download here.
You can place whatever code in the 'tar' case but cleaner to place in your own function saved somewhere else.
If you need to know when
1. target is changed AND
2. the TAB key is being pressed at the time it is changed,
not just when target is changed, please let me know.
This function does quite a number of things we may not want to interfere with, so we pick the last line as our target: client.set_current_target( id, true ).
This looks fairly complicated. Can we find a suitable place to insert our code? I picked line 1287's client.set_variable( name, value ) because that appears to be where variable assignment happens. Looking past it, the rest of the code appears to be involved in UI changes only, so inserting our code before it should be fine.
Now we look at .set_variable. It is a fairly simple function with no variables that we might be scoped out of, so it is fairly safe to assume everything we overwrite will be correct.
Then we look at our code:
The bolded lines tell us how we remember things so that we can tell if things have changed.
var old = client.vars[name] saves Nexus' remembered variable into old for us to test later.
if (client.vars[name] != old) {...} checks to see if the new variable is different from old.
{ $(document).trigger(...) } is a neat jQuery way to fire off an event for something to listen for.
{ $(document).trigger( eventName, data ) } lets us call this prescient and assign [name, client.vars[name], old] as our data to pass on to our listeners.
Then,
$(document).on(...) is our listener.
$(document).on( "prescient", function(e) { ... } ) tells our listener to listen for prescient. When it does this, it runs the function.
$(document).on( "prescient", function(e) { .. switch(name) { case 'tar' } ... }) is our internal evaluation of what prescient events is telling us; in this case it is evaluating to see if name / arguments[2], is tar which is Nexus' holding name for Target (fully qualified, it is client.vars.tar). When it matches, we run our custom function.
I hope this helps, and if you already knew most of this, maybe it might help someone else. The main thing here is leveraging jQuery which Nexus uses to fire off an event for us to listen to - this lets you write discontinuous code & not worry to much about where your code ends up. The nice thing about Javascript & jQuery is that if you've thought about it, someone else has already probably solved it on Stackoverflow.
Key Commands:
dpstoggle (alias) - activates/ deactivates DPS Tracker
resetdps (alias) - resets the damage/ balance Tracking variables
This is crude, executed using only the simplified scripting options.
https://ufile.io/95q9m
Trigger
Code
Only downside is that Nexus doesn't allow tag insertion so you lose your exit clickability. There is a hack-around but it is a PITA.
But nice script anyway, it certainly sheds light on how to achieve certain things in nexus.
Think it's the second link.
This should do the trick. I was over-engineering again.
Here is a chimera of all the previous name/player databases I have seen/touched/coded, ndb.
Download here.
The main command chain is db & followed by .arg.
db.s gives you a little summary output:
-h <name> tries to force an honors interpretation:
db.u will update the database using the API.
db.save will send your client-side database to Starmourn servers for safekeeping.
db.colors will bring up sliders to control faction colors:
Before
After
Click the highlighted text in the preview panel to select the color tag you want to modify. Target highlighting is not yet implemented as I haven't figured out my preferred method to hook external targetting scripts.
ndb.nxs also allows you to set a specific color for a specific name:
db.<name> RED GREEN BLUE, e.g.
db.Iniar 145 255 23
So a couple of things:
not all the listed options are functional just yet, particularly sorting/filtering by faction/races/classes. the -all command should already sort by those things in any case, it simply doesn't filter currently.
I have uninstalled-reinstalled without issue & there should be no significant requirements/dependencies so if you have a problem with installation, the problem might be one of code conflict, i.e. what else have you installed. Install it, hit 'onLoad' like every other Nexus package for the first time and it is ready to go, && it should load automatically when you refresh Nexus next.
Nexus using API currently is reliant on a CORS-bypass, specifically this server: https://cors-anywhere.herokuapp.com/ so if you don't feel comfortable running the request through a third party, wait until the CORS header is fixed by the amazing Starmourn team.
Lots of little things to fix & do, but that will happen slowly. The bulk of code should either (a) be in general, sufficient, or (b) be a launching point for your own tweaks, etc.
I am interested in hearing about performance under high output.
added in qw parsing
added in Minei's XML headers for the CORS bypass
added in chaining so the API calls are sent in sequence
There is quite a bit of new code so let me know if/when/how it breaks. Now stretching to over 1,000 lines of code which in retrospect means I should've not designed it like a namespaced module. Live & relearn I guess.
Firstly, 'qw' no longer does a capture & update; this should've been a separate command from the start & is now 'qwf'.
Secondly, the module now polls for updates:
- every minute, it checks for when you last sent data to the Starmourn server
- if you have not passed a new command to Starmourn for 5 minutes, it will go into an IDLE mode
- every 3 minutes, if it is in IDLE mode, the module will grab 20 random entries from your DB that has not been updated for at least 90 minutes
- it will then request API data for these 20 entries
- you can 'db.ps' to stop the polling.
Thirdly, 'db.u' now only requests updated API data for DB entries that have not been updated for at least 90 minutes
Fourthly, 'db.fu' is now the syntax for forcing an API update of all entries in the DB.
Fifthly, I have added a whole bunch of calculations to db.s which are likely to have errors, so please let me know.
Sixthly, 'db.del <player>' is added.
On the coding side of things, there are plenty of new places for shit to break. Currently, there's no way to change the settings on the polling, i.e. the frequency of checking & size of requests per batch but will probably add that in in an update.
I did get a couple random errors when testing the db.u command
"(ndb): ndb requesting truncated update of 122 from 277 records.
For some reason, I cannot locate where ajax receives the 404 code, so the best I can get is a .state() returning "rejected". This code will replace current code inside of chainUpdate if you want to update it yourself, but I will include it at some stage in the formal .nxs file.
Type .sal for all your Nexus aliases, or .sal <search-term> to filter your aliases for a specific term.
Download here.
Junk Counter
(ndb): Error accessing name: Beardedwhispers, error is [object Object].
(ndb): Error accessing name: Eidi, error is [object Object].
(ndb): Error accessing name: Sigrun, error is [object Object].
(ndb): ndb completed retrieval of 294 records.