/* * 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,mat) { try{ let availtosell= Game.rooms[myroom].terminal.store.getUsedCapacity(mat) if(availtosell>0){ console.log(myroom + ":" + mat +":" + availtosell) //console.log(JSON.stringify(Game.market.orders)) // if(Game.market.orders.length > 9){ let myorders = Game.market.getAllOrders(order=>order.resourceType == mat && order.type == ORDER_BUY) //console.log("Open orders: " + myorders.length) //console.log(myorders.length) for(let i=0; i