moriakaice / bitburner

Collection of scripts for https://danielyxie.github.io/bitburner/
ISC License
117 stars 143 forks source link

playerServers.ns deleting and buying same RAM servers? #12

Open BasTijs opened 2 years ago

BasTijs commented 2 years ago

I'm having an issue where the playerServers.ns script deletes a server during the upgrade cycle, but that doesnt seem to work, so it only deletes the server and then goes into buying the same RAM server that was just deleted back until my money is finished....Anyone else experiencing this?

I have a couple of high RAM servers but not yet 25 total servers due to me trying to debug it but that deleted some more :)

....here is an example of starting it with 12b: playerServers.ns: [7:02:53 PM] Starting playerServers.ns playerServers.ns: [7:02:53 PM] Upgraded: pserv-X into server: pserv-8192-eb78ea97-7d21-42f2-a33c-01b24776d67c (8192 GB) playerServers.ns: [7:02:53 PM] Upgraded: pserv-256-dcee75d5-3deb-4d6b-8794-209309827c7f into server: pserv-8192-e2788f02-f06e-4260-8b08-ef0401bd6d55 (8192 GB) playerServers.ns: [7:02:53 PM] Upgraded: pserv-256-1cd6d0e6-f321-45a1-ad84-4277b3e6fde8 into server: pserv-8192-d4104c81-4214-48f4-bc3b-e4219f65efae (8192 GB) playerServers.ns: [7:02:53 PM] Upgraded: pserv-256-492d026d-fbeb-46f6-bd7a-4f0c1af76b9d into server: pserv-8192-cfc055c7-d45a-4c3d-9d6f-1c12528bb099 (8192 GB) playerServers.ns: [7:02:53 PM] Upgraded: pserv-256-0d9ea3af-d53a-4928-aca9-bd398df9ddef into server: pserv-8192-c7fb7acc-13bd-451a-8d4d-e6c019e78e4f (8192 GB) playerServers.ns: [7:02:53 PM] Upgraded: pserv-256-34da31c9-a3e8-42a3-953e-8ab096ede204 into server: pserv-8192-af48d665-5db0-4f7b-9c80-7ee2b072a557 (8192 GB) playerServers.ns: [7:02:53 PM] Upgraded: pserv-256-c1ea6be9-6fa6-4491-ac22-7dc7d22d359f into server: pserv-8192-dc4cc104-fcd9-4769-9ac7-3da5e919623a (8192 GB) playerServers.ns: [7:02:58 PM] Bought new server: pserv-256-2c304051-ec2b-4236-bf35-832777f248e7 (256 GB) playerServers.ns: [7:03:03 PM] Bought new server: pserv-256-625dd1aa-b116-4bf9-9a1c-494f7051434e (256 GB) playerServers.ns: [7:03:08 PM] Bought new server: pserv-256-6dc552a9-ddd3-47a7-8705-c1ba72589f9f (256 GB) playerServers.ns: [7:03:13 PM] Bought new server: pserv-256-f2a8e18c-6899-45a5-88df-48c3766a6c97 (256 GB) playerServers.ns: [7:03:19 PM] Bought new server: pserv-256-9b5e51f7-5fab-4fcb-ad66-9ba8e1ca1a32 (256 GB) playerServers.ns: [7:03:24 PM] Bought new server: pserv-256-035033e1-bd1a-4925-a2f0-b221d5c24e40 (256 GB) playerServers.ns: [7:03:29 PM] Bought new server: pserv-256-b387769b-107b-4e4b-91d0-d7d8ab8b8e78 (256 GB) playerServers.ns: [7:03:34 PM] Bought new server: pserv-256-45cdf0c0-632c-493f-bce8-3b5fed5334e9 (256 GB) playerServers.ns: [7:03:39 PM] Bought new server: pserv-256-eef7cb1c-217d-4b0f-aa79-d0ea46710b73 (256 GB) playerServers.ns: [7:03:44 PM] Bought new server: pserv-256-137a1961-9fdb-497a-a729-293ec573e8a7 (256 GB) playerServers.ns: [7:03:50 PM] Bought new server: pserv-256-a3a8701c-7881-4300-a6cf-d0b11a5ab8a3 (256 GB) playerServers.ns: [7:03:55 PM] Bought new server: pserv-256-e21122ae-3bd8-4fa9-92d6-34352d8af7b0 (256 GB) playerServers.ns: [7:04:00 PM] Bought new server: pserv-256-9e31c5c7-de51-4d5e-a315-9c32515edfdb (256 GB) playerServers.ns: [7:04:05 PM] Bought new server: pserv-256-638c8286-17cd-4507-a7a2-d93fe571cc6f (256 GB) playerServers.ns: [7:04:10 PM] Bought new server: pserv-256-3bf0c279-7619-4df9-8bef-54c9ef04ec18 (256 GB) playerServers.ns: [7:04:15 PM] Bought new server: pserv-256-acde50b3-a462-40d9-b400-9d47169fe042 (256 GB) playerServers.ns: [7:04:20 PM] Bought new server: pserv-256-109e15f9-f410-45d3-9b7d-f70d4603a686 (256 GB) playerServers.ns: [7:04:26 PM] Bought new server: pserv-256-b58f5f05-87be-446a-a115-6ffd865bd355 (256 GB) playerServers.ns: [7:04:31 PM] Bought new server: pserv-256-8700c1d9-6207-4d53-982f-ed8cecb74bfb (256 GB) playerServers.ns: [7:04:36 PM] Bought new server: pserv-256-a12cbe30-5faa-4ac7-bd09-5dc4654bd14a (256 GB) playerServers.ns: [7:04:41 PM] Bought new server: pserv-256-1690ad08-68f7-4ab0-a774-61f59bc062a7 (256 GB) playerServers.ns: [7:04:46 PM] Bought new server: pserv-256-74df6936-26bf-4b51-825e-835b603b9c73 (256 GB) playerServers.ns: [7:04:51 PM] Bought new server: pserv-256-1bdf0934-ca89-426c-83a6-ed30751cd109 (256 GB) playerServers.ns: [7:04:56 PM] Bought new server: pserv-256-528671a9-c6a6-47b0-82dc-742e61325530 (256 GB) playerServers.ns: [7:05:02 PM] Bought new server: pserv-256-11868b40-5914-4bb6-a9e6-8e7584db780a (256 GB) playerServers.ns: [7:05:07 PM] Bought new server: pserv-256-a87da046-2a5e-4afb-907e-8ad74c097b74 (256 GB) playerServers.ns: [7:05:12 PM] Bought new server: pserv-256-4be05f49-8862-4672-a307-7d1ef4262727 (256 GB) playerServers.ns: [7:05:17 PM] Bought new server: pserv-256-f04b03bf-a40d-4b13-b5e4-2abadf40873d (256 GB) playerServers.ns: [7:05:22 PM] Bought new server: pserv-256-46fcc67d-a955-4be9-8241-c144cc1cde24 (256 GB) playerServers.ns: [7:05:27 PM] Bought new server: pserv-256-b39b4b1c-3bfa-4310-b42c-9e31de7108fa (256 GB) playerServers.ns: [7:05:33 PM] Bought new server: pserv-256-b988bc59-9a2b-4c2c-ab60-bdff74c3fa0f (256 GB) playerServers.ns: [7:05:38 PM] Bought new server: pserv-256-a24b18bd-2036-4eb5-bb31-b70ef4374661 (256 GB) playerServers.ns: [7:05:43 PM] Bought new server: pserv-256-3f07e20c-22e0-4c3d-ac28-9719ace2d6c8 (256 GB) playerServers.ns: [7:05:48 PM] Bought new server: pserv-256-571a265a-5d53-48d3-9635-9dc687b52f20 (256 GB) playerServers.ns: [7:05:53 PM] Bought new server: pserv-256-9dfdd2c4-780d-4976-aec9-09218cc9a6fa (256 GB) playerServers.ns: [7:05:58 PM] Bought new server: pserv-256-bb77f815-cfa2-40f2-9dc9-04b16d8a6219 (256 GB) playerServers.ns: [7:06:03 PM] Bought new server: pserv-256-07031d33-c159-4463-8c80-c92fd9793a02 (256 GB) playerServers.ns: [7:06:09 PM] Bought new server: pserv-256-dca769b8-7f18-4666-b5f6-bec25513c18b (256 GB) playerServers.ns: [7:06:14 PM] Bought new server: pserv-256-47e1ca8c-878d-4628-89be-e366884bec99 (256 GB)

BasTijs commented 2 years ago

I have the feeling this is because I just moved from BN1 to 5, everything is more expensive so the if-statements wont check against the right costs? I did a manual purchase of a server and it was 4x more expensive as what I thought...

BasTijs commented 2 years ago

gbRamCost should not be hardcoded it seems, we can use getPurchasedServerCost() instead. I havent tried updating the playerServers.ns yet, but this returns the real costs including BN multiplier.

christhegoalie commented 2 years ago

Similar problem here, except mine wasn't buying any servers on BN5. (Probably because tweaks to prioritize single high memory servers)

Since the cost doesn't appear to scale linearly on BN5, To fix this, I ended up replacing the calls:

targetRam * settings.gbRamCost with ns.getPurchasedServerCost(targetRam)

Mystery86HH commented 2 years ago

Same problem here :(

wchevalier commented 2 years ago

mine just started failing today, did the updates and noticed another constant that you might want to replace with a function maxGbRam: ns.getPurchasedServerMaxRam() instead of the integer constant on in the settings at the top.