Skip to main content

Script Lifecycle

hexis.script(metadata)

Defines script metadata. Must be called before hexis.main().

FieldTypeRequiredDescription
namestringYesDisplay name in Hexis menu
descriptionstringYesScript description
authorstringNoScript author
versionstringNoVersion string (e.g., "1.0.0")
categorystringNoCategory folder (e.g., "farming", "combat")
iconstringNoIcon URL for mod menu
input_blockingtableNoInput blocking configuration
staff_detectionbooleanNoEnable staff detection auto-disable

Icon URL

The icon field allows you to specify a custom icon for your script in the mod menu. The recommended format is to use the Coflnet Skyblock icon API:

icon = "https://sky.coflnet.com/static/icon/ITEM_ID"

Common item IDs:

  • Combat: SUMMONING_EYE, ASPECT_OF_THE_DRAGONS, REVENANT_VISCERA
  • Farming: THEORETICAL_HOE_WHEAT_3, ENCHANTED_SUGAR_CANE, ENCHANTED_GOLDEN_CARROT
  • Mining: DIVAN_DRILL, MITHRIL_ORE, PERFECT_RUBY_GEM
  • Foraging: TREECAPITATOR_AXE
  • Fishing: ROD_OF_THE_SEA

Input Blocking Options

input_blocking = {
block_camera = true, -- Prevent player camera movement
block_movement = true, -- Prevent WASD movement
block_item_change = true, -- Prevent hotbar slot changes
block_inventory = false -- Prevent opening inventory
}

hexis.config(options)

Defines GUI configuration options. Creates sliders, toggles, and dropdowns in Hexis menu.

hexis.config({
{
id = "hunt_radius",
label = "Hunt Radius",
type = "slider",
default = 30,
min = 10,
max = 50,
step = 1 -- Optional
},
{
id = "auto_sell",
label = "Auto Sell",
type = "toggle",
default = true
},
{
id = "weapon",
label = "Weapon",
type = "dropdown",
default = "Juju Shortbow",
options = {"Juju Shortbow", "Terminator", "Hyperion"}
}
})

Config Types

TypeDescriptionExtra Fields
sliderNumeric slidermin, max, step (optional)
toggleOn/off toggleNone
dropdownSelection listoptions (array of strings)

Accessing Config Values

local range = hexis.config.get("hunt_radius")
local auto_sell = hexis.config.get("auto_sell")

Script Stop Behavior

When a script stops (error or hexis.script.stop()):

  1. Combat loop stops
  2. Movement stops
  3. Camera control released
  4. Input blocking disabled
  5. Staff detection disabled
  6. HUD hidden

All cleanup is automatic - you don't need to manually stop anything.