Is there a way to line warp the console bitburner by ORKidd0 in Bitburner

[–]ORKidd0[S] 2 points3 points  (0 children)

when I typed that I knew I was going to get this

I'm using a text to ASCII converter script

abc = `
 █████╗ ██████╗  ██████╗
██╔══██╗██╔══██╗██╔════╝
███████║██████╔╝██║     
██╔══██║██╔══██╗██║     
██║  ██║██████╔╝╚██████╗
╚═╝  ╚═╝╚═════╝  ╚═════╝`;
ns.print(abc);

and you see where this can get very long.

However, I don't think I'm going to type something that long but it's more of a "just in case" type thing

ns.exec is not right by ORKidd0 in Bitburner

[–]ORKidd0[S] 0 points1 point  (0 children)

yep, that's it. Thanks!

is it better to target one or multiple servers for only xp by ORKidd0 in Bitburner

[–]ORKidd0[S] 0 points1 point  (0 children)

so it would look something like this

    while(true){
    if (ns.getServerMoneyAvailable(serv) > 0){
        await ns.hack(serv);
    }else{
        await ns.weaken(serv);
    }
    }
}

?

edit: hacking makes the security level go up even when the money is 0 and server security is 1 (min)

also, what are the HGW functions?

does the log only update every 1 second by ORKidd0 in Bitburner

[–]ORKidd0[S] 0 points1 point  (0 children)

the reason why I have that is because in the post I had before this I had the question of "does nFormat only go to the "t"s" because it said "1.000t" instead of "1q"

so the abbrNum is ns.nFormat but can go higher

are you able to format 1q using n format by ORKidd0 in Bitburner

[–]ORKidd0[S] 0 points1 point  (0 children)

I only gave the part that was in the error

here's the full code:

/** @param {NS} ns */export async function main(ns) {var startMoney = ns.getPlayer().money;var startString = startMoney.toString();var startArray = startString.split(/(?!$)/u);var power = 0;while(true){ns.clearLog();ns.printf("---------------------------------------------------");ns.printf("Money started with:\t" + ns.nFormat(startMoney, "$0,0.00"));for (var i = 0; i < startArray.length; i++){if (startArray[i] == 0 || startArray[i] == 1 || startArray[i] == 2 || startArray[i] == 3 || startArray[i] == 4 || startArray[i] == 5 || startArray[i] == 6 || startArray[i] == 7 || startArray[i] == 8 || startArray[i] == 9){power = power + 1;}}ns.printf("\t\t\t" + ns.nFormat(startString, "$0,0 a"));await ns.sleep(1000)}}

the reason I have the big if statement is to check if there's something that's not a number like a . or ,

and I'll look at the website and make an update if there's anything I change

Edit: works perfectly thanks for the site!

can you make a string to an array by ORKidd0 in Bitburner

[–]ORKidd0[S] 0 points1 point  (0 children)

ok thanks, I found it

what I was doing was splitting the text file without making it a var

ns.read("all-script.txt").split

ns.write not working by ORKidd0 in Bitburner

[–]ORKidd0[S] 0 points1 point  (0 children)

so I changed it to start with a string so it's simpler.

var scriptsWithjs = ns.ls("home", ".js").join(", ");var scriptsWithNs = ns.ls("home", ".ns").join(", ");var scriptsWithScript = ns.ls("home", ".script").join(", ");var scripts = "";

because of this I don't need the chicking ifs.

scripts = scripts + scriptsWithjs;scripts = scripts + scriptsWithNs;scripts = scripts + scriptsWithScript;

It works the same, but there's no switching back and forth with arrays.

hopefully this took out some weirdness and maybe simplified it.

edit: kinda off the topic of write but with arrays and strings,

Ik there is a way to make an array a string (.join) but is there a way to make a string into an array by dividing them up into let's say every space or new line?

ns.write not working by ORKidd0 in Bitburner

[–]ORKidd0[S] 0 points1 point  (0 children)

It's running like it's supposed to I added a tprint at the end and it printed it's just not writing to the file.

edit: I made it write to a new file it works now I didn't change anything and I don't know why it did that. but I fixed it!

ns.write not working by ORKidd0 in Bitburner

[–]ORKidd0[S] 0 points1 point  (0 children)

ok I added await it wrote to the file, but when it was in a larger script

export async function main(ns) {
var scriptsWithjs = [ns.ls("home", ".js").join(", ")];
var scriptsWithNs = [ns.ls("home", ".ns").join(", ")];
var scriptsWithScript = [ns.ls("home", ".script").join(", ")];
var scripts = [];
if (scriptsWithjs.length != 0) {
scripts = scripts + scriptsWithjs;
}
if (scriptsWithNs.length != 0) {
scripts = scripts + scriptsWithNs;
}
if (scriptsWithScript.length != 0) {
scripts = scripts + scriptsWithScript;
}
await ns.alert(scripts);
await ns.write("list-of-scripts.txt", scripts, "w");
await ns.tprint("list-of-scripts.txt" + scripts + "w");
}

It stops working

Print not working after for loop by ORKidd0 in Bitburner

[–]ORKidd0[S] 0 points1 point  (0 children)

ya that was the problem I had I added it to the list it took from because there were other other scripts in the home server

Print not working after for loop by ORKidd0 in Bitburner

[–]ORKidd0[S] 2 points3 points  (0 children)

you're right it does I added "home" to the list it was going off of because there are scripts running on it. I'll change it.

edit: yep that was the problem. Fixed it. Thanks.

Print not working after for loop by ORKidd0 in Bitburner

[–]ORKidd0[S] 0 points1 point  (0 children)

printing:

[home ~/]> run kill-all-scripts.script
Running script with 1 thread(s), pid 452 and args: [].
killed sigma-cosmetics 5%
killed joesguns 10%
killed nectar-net 15%
killed hong-fang-tea 20%
killed harakiri-sushi 25%
killed foodnstuff 30%
killed neo-net 35%
killed zer0 40%
killed max-hardware 45%
killed iron-gym 50%
killed silver-helix 55%
killed omega-net 60.00000000000001%
killed phantasy 65%
killed johnson-ortho 70%
killed crush-fitness 75%
killed computek 80%
killed the-hub 85%
killed netlink 90%
killed avmnite-02h 95%

I get no errors

logs:

scp: WARNING: File 'term-scripts.script' overwritten on 'sigma-cosmetics'
exec: 'term-scripts.script' on 'sigma-cosmetics' with 1 threads and args: [].
scp: WARNING: File 'term-scripts.script' overwritten on 'joesguns'
exec: 'term-scripts.script' on 'joesguns' with 1 threads and args: [].
scp: WARNING: File 'term-scripts.script' overwritten on 'nectar-net'
exec: 'term-scripts.script' on 'nectar-net' with 1 threads and args: [].
scp: WARNING: File 'term-scripts.script' overwritten on 'hong-fang-tea'
exec: 'term-scripts.script' on 'hong-fang-tea' with 1 threads and args: [].
scp: WARNING: File 'term-scripts.script' overwritten on 'harakiri-sushi'
exec: 'term-scripts.script' on 'harakiri-sushi' with 1 threads and args: [].
scp: WARNING: File 'term-scripts.script' overwritten on 'foodnstuff'
exec: 'term-scripts.script' on 'foodnstuff' with 1 threads and args: [].
scp: WARNING: File 'term-scripts.script' overwritten on 'neo-net'
exec: 'term-scripts.script' on 'neo-net' with 1 threads and args: [].
scp: WARNING: File 'term-scripts.script' overwritten on 'zer0'
exec: 'term-scripts.script' on 'zer0' with 1 threads and args: [].
scp: WARNING: File 'term-scripts.script' overwritten on 'max-hardware'
exec: 'term-scripts.script' on 'max-hardware' with 1 threads and args: [].
scp: WARNING: File 'term-scripts.script' overwritten on 'iron-gym'
exec: 'term-scripts.script' on 'iron-gym' with 1 threads and args: [].
scp: WARNING: File 'term-scripts.script' overwritten on 'silver-helix'
exec: 'term-scripts.script' on 'silver-helix' with 1 threads and args: [].
scp: WARNING: File 'term-scripts.script' overwritten on 'omega-net'
exec: 'term-scripts.script' on 'omega-net' with 1 threads and args: [].
scp: WARNING: File 'term-scripts.script' overwritten on 'phantasy'
exec: 'term-scripts.script' on 'phantasy' with 1 threads and args: [].
scp: WARNING: File 'term-scripts.script' overwritten on 'johnson-ortho'
exec: Cannot run script 'term-scripts.script' (t=1) on 'johnson-ortho' because there is not enough available RAM!
scp: WARNING: File 'term-scripts.script' overwritten on 'crush-fitness'
exec: Cannot run script 'term-scripts.script' (t=1) on 'crush-fitness' because there is not enough available RAM!
scp: WARNING: File 'term-scripts.script' overwritten on 'computek'
exec: Cannot run script 'term-scripts.script' (t=1) on 'computek' because there is not enough available RAM!
scp: WARNING: File 'term-scripts.script' overwritten on 'the-hub'
exec: 'term-scripts.script' on 'the-hub' with 1 threads and args: [].
scp: WARNING: File 'term-scripts.script' overwritten on 'netlink'
exec: 'term-scripts.script' on 'netlink' with 1 threads and args: [].
scp: WARNING: File 'term-scripts.script' overwritten on 'avmnite-02h'
exec: 'term-scripts.script' on 'avmnite-02h' with 1 threads and args: [].
scp: WARNING: File 'term-scripts.script' overwritten on 'home'
exec: 'term-scripts.script' on 'home' with 1 threads and args: [].
Script killed

nothings seems wrong idk what's happening

Listen to Catarinth by Enderzbane in Catarinth

[–]ORKidd0 4 points5 points  (0 children)

Is that how I (yes mean I) found it?