Another miniscript. I'm on a laptop without a numpad so piloting is a pain in the arse. This package provides SHIP functionality your Nexus compass. It will automatically convert the compass when you SHIP BOARD/SHIP DISEMBARK.
Hey @tysandr - Wondering if you could throw together a defup command by chance for Nanoseer. This is really my first time messing with Nexus, and the last time I had a defup command was about a year ago in Lusternia...lol
Think you sorted this out on Discord, care to share your script for others?
Yeah, I did...lol. I've been hooked into World of Tanks this past week or so...I need to hop back on and make sure it's all smooth. I know there's still some hiccupery going on that I'll need to iron out.
Hey @tysandr - Wondering if you could throw together a defup command by chance for Nanoseer. This is really my first time messing with Nexus, and the last time I had a defup command was about a year ago in Lusternia...lol
Think you sorted this out on Discord, care to share your script for others?
Yeah, I did...lol. I've been hooked into World of Tanks this past week or so...I need to hop back on and make sure it's all smooth. I know there's still some hiccupery going on that I'll need to iron out.
So if you are an old head like me, height expressed in centimetres doesn't mean very much. If you want to see it in feet and inches when you look at someone-
Trigger regex:
^Height:\s+(\d+) cm$
//Replace height script
imperial=toFeet(args[1])
replace_current_line("18", "6", ""+imperial, "#b3b3b3", "black");
function toFeet(n) {
var realFeet = ((n*0.393700) / 12);
var feet = Math.floor(realFeet);
var inches = Math.round((realFeet - feet) * 12);
return feet + "′ " + inches + '″';
}
[Cassandra]: Poet will be unsurprised to learn that she has unread news.
Pretty excited about this so wanna share it early, please write back with errors & things... v0.01 of simple HTML to Nexus' chunk writing:
vparser = function(str) {
var out = [];
var str = str || "<span id='e' class='xc-blue'>v</span><span class='xc-violet'>thing<span id='d' class='xc-red'>asdf</span>c</span>"; // sample line
var RE = /(<span|<\/span>)/g;
var matches;
while (matches = RE.exec(str)) { out.push(matches.index) };
// console.log(out);
var cap = str.length
var g = []
for (var i = out.length - 1; i > -1; i--) {
var n = out[i]
g.unshift(str.substring(n, cap))
cap = n
}
// console.log(str); console.log(g)
var cm = []
var chunks = []
for (var i = 0; i < g.length; i++) {
var el = g[i]
if (el.match(/\<\/span\>$/)) {
cm.pop()
var c = cm[cm.length - 1] || 'reset'
chunks.push( client.linechunk_color(c) )
} else if (el.match('</span>')) {
cm.pop()
var c = cm[cm.length - 1] || 'reset'
chunks.push( client.linechunk_color(c) )
var e = el.replace('</span>','')
chunks.push( client.linechunk_text(e) )
} else if (el.match('<span ')) {
// console.log('new span ' + el)
var c = el.match(/\xc-(\w+)/)
if (c) {
cm.push(c[1])
chunks.push( client.linechunk_color(c[1]) ) }
var e = el.replace(/\<span.*?\>/,'')
chunks.push( client.linechunk_text(e) )
}
}
// console.log(chunks)
return chunks
}
Used in a trigger:
if (client.current_block) {
var idx = client.current_block.indexOf(client.current_line) - 1
if (idx < 0) { idx = 0 }
// Step backwards until we find an ungagged line
for (var i = idx; i > -1; i--) {
if (typeof client.current_block[i] != 'undefined' && client.current_block[i].gag != true) {
var m = vparser("<span class='xc-grey'>-<span class='xc-red'>" + value + "</span></span>")
client.current_block[i].parsed_line.chunks = client.current_block[i].parsed_line.chunks.concat(m)
break;
}
}
}
Get those prompts to show up on your logs. Let's make a few tweaks to generate_text_block. Put this in onLoad:
client.generate_text_block =function(lines) {
var count =0;
var timestamp;
if (client.show_timestamp_milliseconds ===true)
timestamp = client.getTimeMS();
else
timestamp = client.getTimeNoMS();
var cl ="timestamp mono no_out";
timestamp ="<span class=\""+ cl +"\">"+ timestamp +" </span>";
var res ='';
var counter =0;
for (var i =0; i < lines.length; ++i) {
var txt = lines[i].parsed_line;
var font = lines[i].monospace ?'mono':'';
var line ="<div class=\""+ font +"\">"+ timestamp + (txt ? txt.formatted() :'') +"</div>";
// we want gagged lines to be logged, tooif (logging && txt) append_to_log(line);
if (lines[i].gag) continue;
counter++;
if (txt) {
count++;
res += line;
}
var pr = lines[i].parsed_prompt;
if (pr && (count >0)) { // no prompt if we gagged everythingvar my_prompt ="<div class=\""+ font +"\">"+ timestamp + pr.formatted() +"</div>";
res += my_prompt
if (logging) append_to_log(my_prompt);
}
// empty line - include it if it's neither the first nor the last one// using "counter" instead of "i" fixes problems where the empty line is included after channel markers and suchif ((!pr) && (!txt) && (counter >1) && (i < lines.length -1)) {
res +='<div line>'+ timestamp +' '+'</div>';
}
}
if (client.extra_break && res.length) res +="<br />";
return res;
}
@RocketCat is there any way to make it so that only emotes and say commands show up in logs?
"They are elect to whom beautiful things mean only Beauty." — Oscar Wilde
"I'll take care of it, Luke said. And because he said it instead of her, I knew he meant kill. That is what you have to do before you kill, I thought. You have to create an it, where none was before." — Margaret Atwood
Would you like to insert notices with multicolors, by using a simple "span" structure? Introducing OrangeJuice.nxs, a method that allows you to introduce spans with simple HTML.
The main function is oj.express(str, vpos, hpos). Use xc-color to express a color within the class attribute. Place all other custom classes before using xc-color as your last class.
vpos, defaults to 0 -2: prints to the top of the block -1: prints to the first displayable line (ignores gagged lines) 0: prints to the triggered line 1: prints to the next displayable line (ignores gagged lines) 2: prints to the prompt
hpos, defaults to 1 -2: prints to newline at front of positioned line -1: prints in front of positioned line (prepending) 0: prints newline 1: prints to end of positioned line (append) 2: prints to end of positioned line & newline
Really no material difference between hpos,0 & hpos,2 currently. Also, I would avoid using newline (hpos,-2; hpos,2) with prompt positioning (vpos,2) as I seem to have a fixed height for the prompt & it overlaps text once the scrollback moves.
Just a little update re: NDB, thanks to Squeakum & others, I had a look at the code & it was quite inefficient at highlighting names.
I rewrote a method that is significantly quicker although it may still not be the optimal method:
ndb.alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
ndb.highlight = function(msg, names, colors) {
var alphabet = ndb.alphabet
for (var name in names) {
var arr = names[name]
var c = colors[name] || {}
var color = 'rgba(' + c.r + ',' + c.g + ',' + c.b + ',' + c.a + ')'
for (var i = 0; i < arr.length; i++) {
var idx = arr[i]
// if the next char in the string is not a letter
if (msg[(idx + 1)] && alphabet.indexOf(msg[(idx + name.length)]) == -1) {
// replace at the index for the length of the name with the color
replace_current_line(idx, name.length, name, color)
}
}
}
}
ndb.sub = function(msg) {
if (!ndb.options.doHighlight) { return }
if (typeof client.current_line.parsed_line == 'undefined') { return }
if (typeof current_text != 'function') { return }
var coptions = ndb.coptions || {}
// var now = new Date().getTime()
var m = {}
var c = {}
for (var k in _db) {
var i = 0
while (i < msg.length) {
if (msg.indexOf(k, i) != -1) {
if (typeof m[k] == 'undefined') { m[k] = [] }
if (typeof c[k] == 'undefined') {
if (_db[k].useColor == true) {
c[k] = _db[k].color
} else if (coptions[_db[k].faction] != 'undefined') {
c[k] = coptions[_db[k].faction]
}
}
m[k].push(msg.indexOf(k, i))
i = msg.indexOf(k, i) + 1
} else { break }
}
}
ndb.highlight(msg,m,c)
// var n = new Date().getTime()
// console.log(n - now)
}<br>
If you replace the initial ndb.sub within ndb.uiFunctions with this, you should shave about 10-20ms depending on the size of your ndb.
Abaware: A simple package to ask: "Do I have this ability?"
Usage: Just call abw.haveSkill(group, skill) and it will return true if you have the skill or false if you don't. use toLowerCase() before calling because I forgot to do that in the method itself and I'm lazy now.
Here's another miniscript. Nexus Equipment Manager:
EQM: Parse your weapons and armor into EQM. This may take a bit. EQSUMMARY: View a summary of details about your equipment. MAKESET <alias> <IMPACT|EM|THERMAL|CELLULAR|MENTAL|DRAINING|ELECTRIC>: Will make a set of armor with the specified alias from your inventory, maximizing the specified resistance. MAKESET EQUIPPED <alias>: Creates a new armor set out of the currently equipped armor. ARMORSETS: View your defined armor sets. ARMORSET DELETE <alias>: delete the specified armor set. ARMORSET EQUIP <alias>: equips the specified armor set. Use it multiple times until everything is equipped.
And for those who trust in the system (I shall not be held accountable for you scrapping your 9600 power thing):
SCRAPALL ARMOR: Will scrap all armor pieces which are not part of a defined set or worn/equipped. SCRAPALL WEAPONS <power>: Will scrap all weapons below the specified power.
ARMORSETS should save between sessions, but experience suggests Nexus variables cannot be trusted. So you might need to rebuild ARMORSETS, or manually fix the contents of the nexus variable "eqm.sets"
The package really has only been tested for Nanoseer, so things might not work entirely as expected for other classes yet, but I'm happy to address these and other issues.
For those that lament the loss of the Nexus map in caches, here's a tab that will capture the map. CONFIG MAPSHOW ON for maximum utility. For as long as this is enabled, you won't see the map in the main window. I did not fancy it up, or put in an on/off toggle. It basically just grabs the map from the main window, and puts it in a tab. The only thing I added was a green highlight on your current location. mapTab is the command to start it up. If you like it and want to run it all the time, put the following in your onLoad function.
send_command("mapTab"); //activates the local map tab
I set it to load at the bottom left, cause that's where I keep my map. It will load behind the other tabs, without an icon. It will also be completely blank until you type MAP, or move with mapshow on.
If you want it to load somewhere else, open the mapTab function and look for:
client.register_custom_tab( t, 'container_2' )
There is a comment below that details which container is which, just change the number. Next time you restart the client and run the function it will load wherever. You can also drag the tab around once it's open, just like the default ones.
[Cassandra]: Poet will be unsurprised to learn that she has unread news.
I put this up on Discord as well (and screwed it up the first time). If you want to turn your Talents Progress Bar into a percentage, set up the following as a regex trigger:
^Progress to next talent point\: \[ (=*)(-*) \]$
Set the dropdown to "execute script" and put the following in the box:
Here's a little miniscript: Autofactories Extended. It's a little manufacturing companion that can calculate on the fly how much raw materials are needed to make <amount> of <commodity>. Just use FACTORY HELP to see the list of commands.
Autofactories Extended v2.0! This update added some great stuff to the package, including(and limited to): - A tree to display all commodities needed to build your target, as opposed to only a list of the raw materials that you need. - The package now walks you through a step by step process to build your target.
--Important-- The package now requires another package called display notice patch to be installed as well. It can be found here.
Once again, just use FACTORY HELP for the list of commands
Autofactories Extended v2.1! This update is a very small(but necessary) update: - Added the new Electronics Comms to the package - Fixed a typo in FACTORY HELP
--Important-- The package still(and always will) requires another package called display notice patch to be installed as well. It can be found here.
Comments
https://raw.githubusercontent.com/RocketCatIRE/Nexus/master/vit.nxs
Yeah, I did...lol. I've been hooked into World of Tanks this past week or so...I need to hop back on and make sure it's all smooth. I know there's still some hiccupery going on that I'll need to iron out.
Trigger regex:
Used in a trigger:
Use with <span class='xc-color'>message</span>.
"They are elect to whom beautiful things mean only Beauty."
— Oscar Wilde
"I'll take care of it, Luke said. And because he said it instead of her, I knew he meant kill. That is what you have to do before you kill, I thought. You have to create an it, where none was before."
— Margaret Atwood
Would you like to insert notices with multicolors, by using a simple "span" structure? Introducing OrangeJuice.nxs, a method that allows you to introduce spans with simple HTML.
Download here.
The main function is oj.express(str, vpos, hpos). Use xc-color to express a color within the class attribute. Place all other custom classes before using xc-color as your last class.
vpos, defaults to 0
-2: prints to the top of the block
-1: prints to the first displayable line (ignores gagged lines)
0: prints to the triggered line
1: prints to the next displayable line (ignores gagged lines)
2: prints to the prompt
hpos, defaults to 1
-2: prints to newline at front of positioned line
-1: prints in front of positioned line (prepending)
0: prints newline
1: prints to end of positioned line (append)
2: prints to end of positioned line & newline
Really no material difference between hpos,0 & hpos,2 currently. Also, I would avoid using newline (hpos,-2; hpos,2) with prompt positioning (vpos,2) as I seem to have a fixed height for the prompt & it overlaps text once the scrollback moves.
Hope it works well for you
I rewrote a method that is significantly quicker although it may still not be the optimal method:
If you replace the initial ndb.sub within ndb.uiFunctions with this, you should shave about 10-20ms depending on the size of your ndb.
EQSUMMARY: View a summary of details about your equipment.
MAKESET <alias> <IMPACT|EM|THERMAL|CELLULAR|MENTAL|DRAINING|ELECTRIC>: Will make a set of armor with the specified alias from your inventory, maximizing the specified resistance.
MAKESET EQUIPPED <alias>: Creates a new armor set out of the currently equipped armor.
ARMORSETS: View your defined armor sets.
ARMORSET DELETE <alias>: delete the specified armor set.
ARMORSET EQUIP <alias>: equips the specified armor set. Use it multiple times until everything is equipped.
SCRAPALL WEAPONS <power>: Will scrap all weapons below the specified power.
You can download the package here: https://drive.google.com/file/d/1P3ajesqqUsmZwM9B7jm_6pIJ-wbRNIGx/view?usp=sharing
I set it to load at the bottom left, cause that's where I keep my map. It will load behind the other tabs, without an icon. It will also be completely blank until you type MAP, or move with mapshow on.
If you want it to load somewhere else, open the mapTab function and look for:
There is a comment below that details which container is which, just change the number. Next time you restart the client and run the function it will load wherever. You can also drag the tab around once it's open, just like the default ones.
Set the dropdown to "execute script" and put the following in the box:
display_notice("Current talent progress percentage: "+talentpercent+"%");
@Nykara came up with the regex. I just implemented the Javascript.
- A tree to display all commodities needed to build your target, as opposed to only a list of the raw materials that you need.
- The package now walks you through a step by step process to build your target.
--Important--
The package now requires another package called display notice patch to be installed as well. It can be found here.
Once again, just use FACTORY HELP for the list of commands
- Added the new Electronics Comms to the package
- Fixed a typo in FACTORY HELP
--Important--
The package still(and always will) requires another package called display notice patch to be installed as well. It can be found here.
FACTORY HELP for commands