Module screeps::game::market

source ·
Expand description

Access the in-game market to buy or sell resources.

Screeps documentation

Structs

Functions

  • Get the amount of energy required to send a given amount of any resource from one room to another. See TERMINAL_SEND_COST_SCALE for information about the calculation.
  • Cancel one of your existing orders on the market, without refunding associated fees.
  • Change the price of an existing order. If new_price is greater than old price, you will be charged (newPrice-oldPrice)remainingAmountMARKET_FEE credits.
  • Create a new order on the market.
  • Your current credit balance.
  • Execute a trade on an order on the market. Name of a room with a terminal from which to send or receive resources is required unless the order is for an account resource.
  • Adds more capacity to one of your existing orders, offering or requesting more of the resource and incurring additional fees.
  • Get all Orders on the market, with an optional filter. Note that a resourceType filter has special handling in the engine to be more efficient (source).
  • Get information about the price history on the market for the last 14 days for a given resource as an Array of OrderHistoryRecords, or for all resources if None. Warning: returns an empty Object instead of an array if there is no history for the resource, verifying the type is recommended before use if the market might be empty.
  • Get an object with information about a specific order, in the same format as returned by get_all_orders
  • An Array of the last 100 Transactions sent to your terminals.
  • An Object with your current buy and sell orders on the market, with order ID JsString keys and MyOrder values.
  • An Array of the last 100 Transactions sent from your terminals.