Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.7.0 (fbe1546fd) Loads frozen, Unresposive. (6h save file) #1889

Open
ScriptCitty opened this issue Jan 2, 2025 · 5 comments
Open

v2.7.0 (fbe1546fd) Loads frozen, Unresposive. (6h save file) #1889

ScriptCitty opened this issue Jan 2, 2025 · 5 comments

Comments

@ScriptCitty
Copy link

ScriptCitty commented Jan 2, 2025

Running Ubuntu 24.04.1 LTS
Up to date, Upgraded, Playing through steam. Have tried all 3 launch options.

basically, I have a script to generate a basic infinite weaken loop for each server I have root access to.
_` for (let server of ns.scan())

if root access; list.push(server)

generate_code = [
async function main(ns) {
const list = [" + list + "yada yada",
while true {
for server in list {
if (security > min) weaken(server)
etc etc etc. `_
this generated code is copied and run on all the hacked servers I have access to, so they all are weakening themselves and eachother.
Ran great for about an hour.

Then I got a job at S Corp is it? I started as the topmost job from the list, switched to the second to compare stats, switched to the free university, then the most expensive programing course, then again back to S corp.

Switched in and out of focus comparing the numbers, Switched into focus again and realized the time had frozen. Said I had been working for 8 seconds, stopped counting up. Then I get an unresponsive error asking if I forgot to let the scripts sleep, and asking if I wanted to kill all running scripts. And I did. Both. I forgot sleeps and I asked it to kill all the scripts.
Game will load from steam... will be frozen. Game will load from folder... Frozen. Game will not load from github (firefox)
each time I close and reopen the game I am greeted with an updated timer, but still frozen.

@ScriptCitty
Copy link
Author

Most of the 6 hours was spent either afk, or learning the js component. I may try to recreate the issue tomorrow in a new save as I have no backups for this one

@catloversg
Copy link
Contributor

Your script has an infinite loop. This is your miner.js:

export async function main(ns) {
  const server_list = ["n00dles", "foodnstuff", "sigma-cosmetics", "joesguns", "hong-fang-tea", "harakiri-sushi"];
  while (true) {
    for (let server of server_list) {
      const min_security = ns.getServerMinSecurityLevel(server);
      while (ns.getServerSecurityLevel(server) > min_security + 0.05) await ns.weaken(server);
    }
  }
}

The while-loop is wrong. If you need more help with writing scripts, you should join our Discord server and ask us on #help-scripts or #early-game.

@ScriptCitty
Copy link
Author

ScriptCitty commented Jan 2, 2025

@catloversg My while loop isnt "wrong". You're not helpful

"I went through the effort of grabbing the script from your save file so I could tell you..... 'something' is wrong"
gee thanks... I learned a lot.

If you were looking for a financial audit and come to me and I tell you "yeah man I had a look at everything... you're spending too much money" 100% confirmation, -0% help

you come to me because your car is broken.. "My car wont start" and I say "Yeah man I looked into it and diagnosed that in fact there is a sound coming from the front left wheel. There's something wrong with it. You should join our forum and buy a new car"

@catloversg
Copy link
Contributor

catloversg commented Jan 2, 2025

When the security level is reduced to min_security + 0.05 or lower, ns.getServerSecurityLevel(server) > min_security + 0.05 is always false, and await ns.weaken(server) is not called. If this happens with all provided servers, the loop becomes an infinite loop.

Troubleshooting scripts via non-realtime tools (e.g., GitHub issue) is hard due to long feedback time. That's why I suggested chatting in Discord. It's up to you to decide which tool is best for your case. I don't mind helping you here or on Discord.

@d0sboots
Copy link
Collaborator

d0sboots commented Jan 2, 2025

If/when you get into this state, launching without scripts is how you fix it. Steam usually gives you an option for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants