Skip to main content

Track profit

Register the items or earnings your script wants to track. Hexis prices them, keeps the ledger and supplies profit readings. You can use the default footer or build your own presentation. A custom HUD can hide the generic footer with profit_footer = false to avoid displaying the same total twice.

Profit tracking is the current detailed guide, including independent Bazaar/NPC valuations and comparable history.

-- bundle.json: "requestedCapabilities": ["profit", ...]

hexis.profit.item({item = "SUMMONING_EYE"})
hexis.profit.item({item = "ENCHANTED_DIAMOND", count = -64})

local summary = hexis.profit.summary()
-- summary.value, summary.per_hour, summary.active_seconds, summary.items

Items are ids, not names

Every item is a SkyBlock id: SUMMONING_EYE, ENCHANTED_FIG_LOG, FIGSTONE. A display name is what a chat line carries, and two items can share one, so a ledger keyed by name is ambiguous the first time that happens. Map names to IDs in script-owned Lua data or an optional pack beside the chat lines they come from.

A negative count is a cost, and is valued at what buying costs rather than at what selling fetches.

Let Hexis do the matching

An entry records how it was made. When Hexis matched the chat line, counted the stack or read the purse, the entry is observed. When your script simply said so, it is asserted. Both appear on the player's own stats page; only observed entries from a reviewed bundle reach a number another player sees, so prefer the forms that hand the work over.

-- Observed: Hexis matches the line and awards the item.
hexis.profit.watch_chat({
pattern = "RARE DROP! (%d+)x Summoning Eye",
item = "SUMMONING_EYE",
count_group = 1,
})

-- Observed: positive stack deltas, counted each tick.
hexis.profit.track_inventory({items = {"FIG_LOG", "ENCHANTED_FIG_LOG"}})

-- Observed: purse increases, which is how NPC selling gets counted.
-- Off unless you ask, because it also counts coins the player earned
-- doing something else during the run.
hexis.profit.track_purse()

pattern is a regular expression over the plain text of a chat line. If you would rather match lines yourself, the known Hypixel formats already ship as a library:

local chat = require("hexis/skyblock/chat_patterns")
local hit = chat.match(event.text)
if hit and hit.kind == "rare_drop" then
-- hit.item, hit.count
end

Register your watches once, at startup. A ledger continues across a break without your script running again.

Coins your script worked out itself

Some values no price table carries: a pet at level 1 against the same pet at 100, an experience number, a reward you priced yourself. Pass those as coins, and say what they were in your HUD.

hexis.profit.coins({amount = 12500})

These stay labelled self-reported wherever they appear, and never join a verified total. Nothing can check them, which is the point of keeping them apart rather than the reason to avoid them.

What the summary gives you

local s = hexis.profit.summary()
FieldMeaning
valueCoins from item entries, each fixed at the price when it landed
coinsSelf-reported coins, kept separate
active_secondsSeconds this script has actually been running
per_hourAbsent until the ledger has 30 seconds of work in it
per_hour_recentThe same over the last 15 minutes of active time
price_age_secondsHow stale the prices behind these values are
itemsHighest value first, each with count, priced and source

Absent means absent. A rate that has not warmed up is a missing key, not a zero, because a rate over four seconds is a number that looks precise and means nothing. An item nobody quotes comes back with priced = false and no value: the count is real, only its worth is unknown.

The clock

active_seconds runs while your script runs. A scheduled break stops the run, and the clock stops with it; starting the same script again within two hours continues the same ledger rather than starting a new one, so a session that took a break still reads as one session.

Value is fixed when an item lands. The market moving afterwards does not rewrite what already happened.

Asking about a price

local price = hexis.price.of({item = "SUMMONING_EYE"})
-- price.best, price.source, price.age_seconds

best follows the player's own preference for what an item is worth, and falls through to whatever source has a real number. It is absent when nothing quotes the item, which is not the same as the item being worthless. This never makes a request; it reads a table Hexis keeps fresh for every script on the client.

Showing the numbers

Hexis draws the session total and the coins per hour itself, in a line under your panel. Do not draw them again: two totals rounded two different ways read as two different facts.

What is yours to show is per item. Use the shipped formatter rather than string.format, which ignores the precision on %f and will put six decimals on a coin total:

local fmt = require("hexis/format")

fmt.short(44717041) --> "45M"
fmt.short(1045136619) --> "1.0B"
fmt.short(nil) --> "-"
fmt.rate(820000) --> "820k/hr"

A decimal only appears while the mantissa is under ten, so a total reads at a glance instead of asking to be parsed.

Capability

Every member on this page costs profit. A script that only counts things does not need it; a script that wants the ledger declares it in its bundle and the player sees it on the consent screen.

{
"requestedCapabilities": ["profit", "events.chat.filtered"]
}