Every release ships complete modules in scripts/modules/examples, using real codes from that version's own content. The server never loads that folder. To run one, copy it up into scripts/modules and type %mod reload. Each file's opening comment says how to use it.
Each version's files are written separately, so a file with the same name can differ, and its codes never carry from one version to another.
The Modules
| file | shows | on |
|---|---|---|
global_notice.lua | rotating announcements, every and daily timers, multi-word staff commands | every version |
staff_presence.lua | a login and logout notice for staff, and a .staff player command | every version |
level_bonus.lua | a one-time mailed reward at chosen levels, with a m:char bag as the paid-once guard | every version |
pit_boss_alert.lua | spawn and kill announcements for a set of bosses, a player or staff command, what is already standing at start | every version |
new_player_informer.lua | a first-login welcome, a starter kit by mail | every version |
autoloot.lua | a player command with per-character choices | every version |
auction_max_price.lua | a fail-closed auction gate, with a table cached in memory for the gate | every version |
pvp_penalty.lua | a griefing record, a damage gate | every version |
cash_regen.lua | cash on a timer, milestone rewards, batching work with m:after | every version |
enhance_notify.lua | announcing high upgrades from the upgrade event | every version |
chipwar_reward.lua | paying the Chip War's winners in batches | every version |
item_history.lua | a custom property on individual items, with an enhancement record | every version |
item_property.lua | a custom property on individual items, with a player command | every version |
boss_hud.lua | two new messages, out and in, for GoMMO Client | Dragonborn, Age of Patron |
new_message.lua | a new outbound and inbound message | Golden Age, 1.5 |
Recipes
Announce a boss. Listen to monster_spawned, compare ev.monster.code with a set setting declared of = "monster", and throttle with a top-level table. pit_boss_alert.lua is the whole pattern.
Pay something once. Keep a flag in a character bag and check it before paying. level_bonus.lua does this:
local bag = m:char(ev.player)
if not bag:get("paid_" .. ev.to) then
bag:set("paid_" .. ev.to, true)
rf.mail(ev.player.id, { title = "Level reward", items = { { code = code, count = 1 } } })
end
Cap auction prices. Declare a fail-closed auction_list gate that reads a limit you keep in a top-level table, because a gate cannot touch custom tables. auction_max_price.lua is this.
Do a lot of work. A handler has a budget, so do a batch and schedule the rest:
local function pay(m, ids, from)
for i = from, math.min(from + 19, #ids) do
pcall(rf.give_currency, ids[i], "dalant", 1000, "reward")
end
if from + 20 <= #ids then
m:after(0.5, function(m) pay(m, ids, from + 20) end)
end
end
chipwar_reward.lua and cash_regen.lua both work this way.