Skip to content

Market Module

The market module provides functions to interact with the game’s global economy. All things buying seeds, checking stock, and selling crops are performed here.


Use these functions to spend your Scrap on new resources.

FunctionInputDescription
market.buySeed(seed)Enum.SeedPurchases one seed of the specified type.
market.buyGear(gear)Enum.GearPurchases a specific tool or piece of equipment.
lau-compiler.exe
varol seedType = Enum.Seed.Wheat
varol price = market.getSeedPrice(seedType)
print("Checking price for Wheat...")
if player.scrap() >= price then
market.buySeed(seedType)
print("Price is " + price + ". Buying 1 unit.")
end
OUTPUT:
Checking price for Wheat... Price is 20. Buying 1 unit.

Automate your profits by selling harvested crops directly from your scripts.

FunctionInputDescription
market.sellItem(slot)numberSells the item in the specific inventory slot.
market.sellAllItem()voidSells every sellable item in your inventory at once.
market.whatValue(slot)numberReturns the sale value of the item in that slot.
market.calculateValue()numberReturns the total potential value of your entire inventory.

Prices and stock levels in the market are dynamic. Use these functions to find the best time to buy.

FunctionReturnsDescription
market.getSeedPrice(seed)numberReturns the current buy price for a specific seed.
market.getSeedStock()listReturns a list of all currently available seeds.
market.getSeedStockTime()numberReturns seconds remaining until the next seed restock.
FunctionReturnsDescription
market.getGearPrice(gear)numberReturns the current price for a specific tool.
market.getGearStock()listReturns a list of currently available tools.
market.getGearStockTime()numberReturns seconds remaining until gear restock.

Listen for global market changes to update your drone’s strategy immediately.

Triggered when the seed shop restocks or prices shift.

market.changedSeedStock:connect(func()
player.sent("The Seed Market has restocked!")
end)

Triggered when the tool shop restocks.

market.changedGearStock:connect(func()
player.sent("New Gear is available in the market.")
end)

💡 Advanced Economy Script: “Smart Buyer”

Section titled “💡 Advanced Economy Script: “Smart Buyer””

This script waits for a restock and buys 10 Wheat seeds only if the price is below 20 Scrap.

market.changedSeedStock:connect(func()
varol currentPrice = market.getSeedPrice(Enum.Seed.Wheat) * 10
if currentPrice < player.scrap() then
for i = 1, 10 do
market.buySeed(Enum.Seed.Wheat)
end
player.sent("Bought 10 Wheat seeds!")
end
end)