From 9137f805dafe9c676e0e97f7c8025b512af38e39 Mon Sep 17 00:00:00 2001 From: Dan Hamik Date: Wed, 27 Apr 2022 00:02:31 -0500 Subject: [PATCH] trying to fix terminal auto sell --- Room.Phase1.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Room.Phase1.js b/Room.Phase1.js index 8ad5e6c..fe29278 100644 --- a/Room.Phase1.js +++ b/Room.Phase1.js @@ -49,8 +49,10 @@ let Phase1 = { require('proc.spawning').spawnminer(room) } else { if(Game.flags.debug && Game.flags.debug.room == Game.rooms[room]){console.log("Not spawning miner in " + room + ", waiting for regen")}} } - if((Game.rooms[room].terminal.storage[RESOURCE_ENERGY] > 200000 )){ - require('proc.market').sellEnergy(room) + if(Game.rooms[room].find(FIND_MY_STRUCTURES, {filter: {structureType: STRUCTURE_TERMINAL}}).length > 0){ + if(Game.rooms[room].terminal.store[RESOURCE_ENERGY]>200000){ + require('proc.market').sellEnergy(room) + } } //require('proc.market').sellEnergy(room) }