mirror of
https://github.com/paradizelost/screeps.git
synced 2024-11-25 02:14:44 -06:00
fix store to storage
This commit is contained in:
parent
f5c34b6abb
commit
1d54eae2a6
@ -49,7 +49,7 @@ let Phase1 = {
|
|||||||
require('proc.spawning').spawnminer(room)
|
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")}}
|
} 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.store[RESOURCE_ENERGY] > 200000 )){
|
if((Game.rooms[room].terminal.storage[RESOURCE_ENERGY] > 200000 )){
|
||||||
require('proc.market').sellEnergy(room)
|
require('proc.market').sellEnergy(room)
|
||||||
}
|
}
|
||||||
//require('proc.market').sellEnergy(room)
|
//require('proc.market').sellEnergy(room)
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
let gomarket={
|
let gomarket={
|
||||||
sellEnergy: function(myroom) {
|
sellEnergy: function(myroom) {
|
||||||
try{
|
try{
|
||||||
let availtosell= Game.rooms[myroom].terminal.store[RESOURCE_ENERGY]
|
let availtosell= Game.rooms[myroom].terminal.storage[RESOURCE_ENERGY]
|
||||||
|
|
||||||
if(availtosell>200000){
|
if(availtosell>200000){
|
||||||
console.log(myroom + ":" + availtosell)
|
console.log(myroom + ":" + availtosell)
|
||||||
@ -18,7 +18,7 @@ let gomarket={
|
|||||||
let myorders = Game.market.getAllOrders(order=>order.resourceType == RESOURCE_ENERGY && order.type == ORDER_BUY)
|
let myorders = Game.market.getAllOrders(order=>order.resourceType == RESOURCE_ENERGY && order.type == ORDER_BUY)
|
||||||
//console.log(myorders.length)
|
//console.log(myorders.length)
|
||||||
for(let i=0; i<myorders.length; i++){
|
for(let i=0; i<myorders.length; i++){
|
||||||
let recheckavailtosell= Game.rooms[myroom].terminal.store[RESOURCE_ENERGY]
|
let recheckavailtosell= Game.rooms[myroom].terminal.storage[RESOURCE_ENERGY]
|
||||||
if(recheckavailtosell<1000){
|
if(recheckavailtosell<1000){
|
||||||
console.log("too little to mess with")
|
console.log("too little to mess with")
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user