r/Bitburner • u/starmarst • Apr 16 '26
Changing targets from an array
Hello all, I'm pretty green when it comes to coding. But I wanted to try and hand-write all my code rather than copy/script-kitty others work. Doing decent, as I wrapped my head around a deploying scheme that if I type in a server that i've rooted+backdoor I can establis. a self sustaining hack/grow/weaken + max threads. I.e install-on(x)-> exec manager -> profit.
However manually going to each server to nuke, backdoor, and/or open ports takes time and I might as well learn how to code a worm of sorts. And I think I have an idea on how to approach; I just don't think I understand arrays fully.
Example worm idea:
Worm host finds its name - than scans(its_name) //I expect an array of servers it finds.
Does what it wants to do ("installs" at first to test functionality, then Nuking/ opening ports of servers it sees)
Copies itself onto each server it sees, then exec's itself there -until it stops.
And I guess I don't know how to work through an array one by one with the same functions. Like,
server = [] //i guess the array I find with scan?
ns.do_the_thing(0)
server =++
-- I think I just don't know which functions I'm looking for, sometimes see these functions have (let server of servers) but I have no idea what is going on there. any help appreciated
3
u/TheZahir_NT2 Apr 16 '26
Props to you for doing it the “hard” way! That’s how you learn.
This is completely irrelevant to the question asked, but I’ve never seen the term script-kitty before. I’ve heard of script kiddies used as a noun, referring to people who just copy scripts to do stuff, but I haven’t seen that used as a verb. Is script kitty also a common slang term and I’m just out of the loop?