/* * Module code goes here. Use 'module.exports' to export things: * module.exports.thing = 'a thing'; * * You can import it from another modules like this: * var mod = require('proc.market'); * mod.thing == 'a thing'; // true */ let gomarket={ sellEnergy: function(myroom) { try{ let availtosell= Game.rooms[myroom].terminal.store[RESOURCE_ENERGY] if(availtosell>5000){ console.log(myroom + ":" + availtosell) //console.log(JSON.stringify(Game.market.orders)) // if(Game.market.orders.length > 9){ let myorders = Game.market.getAllOrders(order=>order.resourceType == RESOURCE_ENERGY && order.type == ORDER_BUY) //console.log(myorders.length) for(let i=0; i