Plugin

Group
Plugin
Hooks
97
Properties
None

Hooks

HookReturnsDescription
startUp()()The plugin was enabled, or the client started with it enabled. No event reaches it before this returns; the object is registered on the eve…
shutDown()()The plugin was disabled. The object is unregistered from the event bus first, so no event reaches it after.
resetConfiguration()()The settings page's Reset put the plugin's config group back to its defaults.
provideConfig()anyReturn configManager:getConfig(SomeConfigGroup) to make that group the plugin's own. Called once, at load; without it the first group the…
recommendedSettings(){RecommendedSetting}The game settings this plugin recommends values for (any row of All Settings that holds one: a toggle, a dropdown, ...), as a list of `Reco…
onActorDeath(ActorDeath)()The ActorDeath event.
onAmbientSoundEffectCreated(AmbientSoundEffectCreated)()The AmbientSoundEffectCreated event.
onAnimationChanged(AnimationChanged)()The AnimationChanged event.
onAreaSoundEffectPlayed(AreaSoundEffectPlayed)()The AreaSoundEffectPlayed event.
onBeforeMenuRender(BeforeMenuRender)()The BeforeMenuRender event.
onBeforeRender(BeforeRender)()The BeforeRender event.
onChatMessage(ChatMessage)()The ChatMessage event.
onClanChannelChanged(ClanChannelChanged)()The ClanChannelChanged event.
onClanMemberJoined(ClanMemberJoined)()The ClanMemberJoined event.
onClanMemberLeft(ClanMemberLeft)()The ClanMemberLeft event.
onClientTick(ClientTick)()Once per client cycle while logged in. It does not run on the login screen; onPostClientTick does.
onCommandExecuted(CommandExecuted)()The CommandExecuted event.
onDecorativeObjectDespawned(DecorativeObjectDespawned)()The DecorativeObjectDespawned event.
onDecorativeObjectSpawned(DecorativeObjectSpawned)()The DecorativeObjectSpawned event.
onFakeXpDrop(FakeXpDrop)()The FakeXpDrop event.
onFocusChanged(FocusChanged)()The FocusChanged event.
onFriendsChatChanged(FriendsChatChanged)()The FriendsChatChanged event.
onFriendsChatMemberJoined(FriendsChatMemberJoined)()The FriendsChatMemberJoined event.
onFriendsChatMemberLeft(FriendsChatMemberLeft)()The FriendsChatMemberLeft event.
onFriendsChatSync(FriendsChatSync)()The FriendsChatSync event.
onGameObjectDespawned(GameObjectDespawned)()The GameObjectDespawned event.
onGameObjectSpawned(GameObjectSpawned)()The GameObjectSpawned event.
onGameStateChanged(GameStateChanged)()The GameStateChanged event.
onGameTick(GameTick)()The GameTick event.
onGrandExchangeOfferChanged(GrandExchangeOfferChanged)()The GrandExchangeOfferChanged event.
onGrandExchangeSearched(GrandExchangeSearched)()The GrandExchangeSearched event.
onGraphicChanged(GraphicChanged)()The GraphicChanged event.
onGraphicsObjectCreated(GraphicsObjectCreated)()The GraphicsObjectCreated event.
onGroundObjectDespawned(GroundObjectDespawned)()The GroundObjectDespawned event.
onGroundObjectSpawned(GroundObjectSpawned)()The GroundObjectSpawned event.
onHitsplatApplied(HitsplatApplied)()The HitsplatApplied event.
onInteractingChanged(InteractingChanged)()The InteractingChanged event.
onItemContainerChanged(ItemContainerChanged)()The ItemContainerChanged event.
onItemDespawned(ItemDespawned)()The ItemDespawned event.
onItemQuantityChanged(ItemQuantityChanged)()The ItemQuantityChanged event.
onItemSpawned(ItemSpawned)()The ItemSpawned event.
onMenuEntryAdded(MenuEntryAdded)()The MenuEntryAdded event.
onMenuOpened(MenuOpened)()The MenuOpened event.
onMenuOptionClicked(MenuOptionClicked)()The MenuOptionClicked event.
onMenuShouldLeftClick(MenuShouldLeftClick)()The MenuShouldLeftClick event.
onNameableNameChanged(NameableNameChanged)()The NameableNameChanged event.
onNpcChanged(NpcChanged)()The NpcChanged event.
onNpcDespawned(NpcDespawned)()The NpcDespawned event.
onNpcSpawned(NpcSpawned)()The NpcSpawned event.
onOverheadTextChanged(OverheadTextChanged)()The OverheadTextChanged event.
onPlayerChanged(PlayerChanged)()The PlayerChanged event.
onPlayerDespawned(PlayerDespawned)()The PlayerDespawned event.
onPlayerSpawned(PlayerSpawned)()The PlayerSpawned event.
onPostClientTick(PostClientTick)()Once per client cycle in every game state, the login screen included.
onPostHealthBarConfig(PostHealthBarConfig)()The PostHealthBarConfig event.
onPostMenuSort(PostMenuSort)()The PostMenuSort event.
onPreMapLoad(PreMapLoad)()The PreMapLoad event.
onProjectileMoved(ProjectileMoved)()The ProjectileMoved event.
onRemovedFriend(RemovedFriend)()The RemovedFriend event.
onResizeableChanged(ResizeableChanged)()The ResizeableChanged event.
onScriptCallbackEvent(ScriptCallbackEvent)()The ScriptCallbackEvent event.
onScriptPostFired(ScriptPostFired)()The ScriptPostFired event. A subscription takes every script the client runs, thousands a second. To hear only some, name them: `eventFil…
onScriptPreFired(ScriptPreFired)()The ScriptPreFired event. A subscription takes every script the client runs, thousands a second. To hear only some, name them: `eventFilt…
onSoundEffectPlayed(SoundEffectPlayed)()The SoundEffectPlayed event.
onStatChanged(StatChanged)()The StatChanged event.
onVarClientIntChanged(VarClientIntChanged)()The VarClientIntChanged event.
onVarClientStrChanged(VarClientStrChanged)()The VarClientStrChanged event.
onVarbitChanged(VarbitChanged)()The VarbitChanged event.
onWallObjectDespawned(WallObjectDespawned)()The WallObjectDespawned event.
onWallObjectSpawned(WallObjectSpawned)()The WallObjectSpawned event.
onWidgetClosed(WidgetClosed)()The WidgetClosed event.
onWidgetDrag(WidgetDrag)()The WidgetDrag event.
onWidgetLoaded(WidgetLoaded)()The WidgetLoaded event.
onWorldChanged(WorldChanged)()The WorldChanged event.
onWorldListLoad(WorldListLoad)()The WorldListLoad event.
onWorldViewLoaded(WorldViewLoaded)()The WorldViewLoaded event.
onWorldViewUnloaded(WorldViewUnloaded)()The WorldViewUnloaded event.
onAccountHashChanged(AccountHashChanged)()The AccountHashChanged event.
onCanvasSizeChanged(CanvasSizeChanged)()The CanvasSizeChanged event.
onUsernameChanged(UsernameChanged)()The UsernameChanged event.
onWorldEntityDespawned(WorldEntityDespawned)()The WorldEntityDespawned event.
onWorldEntitySpawned(WorldEntitySpawned)()The WorldEntitySpawned event.
onConfigChanged(ConfigChanged)()The ConfigChanged event.
onExternalPluginsChanged(ExternalPluginsChanged)()The ExternalPluginsChanged event.
onOverlayMenuClicked(OverlayMenuClicked)()The OverlayMenuClicked event.
onPlayerLootReceived(PlayerLootReceived)()The PlayerLootReceived event.
onPluginChanged(PluginChanged)()The PluginChanged event.
onProfileChanged(ProfileChanged)()The ProfileChanged event.
onRuneScapeProfileChanged(RuneScapeProfileChanged)()The RuneScapeProfileChanged event.
onServerNpcLoot(ServerNpcLoot)()The ServerNpcLoot event.
onWorldsFetch(WorldsFetch)()The WorldsFetch event.
sidePanel(Panel)()Draw the plugin's side panel. Declaring this is what gives the plugin a panel at all. Immediate mode: called every frame.
renderWindows(Window)()Open and drive separate viewport windows. The window handle is valid only for this pass.
renderOverlay(Draw, DrawLayer)()Draw over the game. Called once per layer every frame, three calls in all, so a hook that ignores layer draws three times. The draw surfa…
getName()string?The descriptor's name.
getId()string?The plugin's id (its package folder's name).
new(descriptor: PluginDescriptorFields?)PluginObjectBuilds the plugin object. Its optional table is the plugin's descriptor (see PluginDescriptor). Field initialisers and one-time setup bel…

Hook details

startUp

startUp: (Plugin) -> ()

The plugin was enabled, or the client started with it enabled. No event reaches it before this returns; the object is registered on the event bus after.

shutDown

shutDown: (Plugin) -> ()

The plugin was disabled. The object is unregistered from the event bus first, so no event reaches it after.

resetConfiguration

resetConfiguration: (Plugin) -> ()

The settings page's Reset put the plugin's config group back to its defaults.

provideConfig

provideConfig: (Plugin) -> any

Return configManager:getConfig(SomeConfigGroup) to make that group the plugin's own. Called once, at load; without it the first group the chunk asked configManager:getConfig for is.

recommendedSettings

recommendedSettings: (Plugin) -> {RecommendedSetting}

The game settings this plugin recommends values for (any row of All Settings that holds one: a toggle, a dropdown, ...), as a list of RecommendedSetting. Asked after a login, after a plugin starts and when the Settings tab opens, only while this plugin runs. The client tells the player and highlights what differs in the Settings panel. A bad entry is dropped with a warning.

onClientTick

onClientTick: (Plugin, ClientTick) -> ()

Once per client cycle while logged in. It does not run on the login screen; onPostClientTick does.

onScriptPostFired

onScriptPostFired: (Plugin, ScriptPostFired) -> ()

The ScriptPostFired event. A subscription takes every script the client runs, thousands a second. To hear only some, name them: eventFilters.onScriptPostFired = { scriptId = { ... } }, or eventBus:subscribe's fourth argument.

onScriptPreFired

onScriptPreFired: (Plugin, ScriptPreFired) -> ()

The ScriptPreFired event. A subscription takes every script the client runs, thousands a second. To hear only some, name them: eventFilters.onScriptPreFired = { scriptId = { ... } }, or eventBus:subscribe's fourth argument.

sidePanel

sidePanel: (Plugin, Panel) -> ()

Draw the plugin's side panel. Declaring this is what gives the plugin a panel at all. Immediate mode: called every frame.

renderWindows

renderWindows: (Plugin, Window) -> ()

Open and drive separate viewport windows. The window handle is valid only for this pass.

renderOverlay

renderOverlay: (Plugin, Draw, DrawLayer) -> ()

Draw over the game. Called once per layer every frame, three calls in all, so a hook that ignores layer draws three times. The draw surface is valid only for this pass.

This hook only draws: it cannot act. An action called from it answers false, or raises if it is a capitalised static or an item's interact.

function plugin:renderOverlay(draw, layer)
    if layer == DrawLayer.ABOVE_SCENE then
        draw:tilePoly(tile, Color.RED, Color.new(255, 0, 0, 40))
    end
end

getId

getId: (Plugin) -> string?

The plugin's id (its package folder's name).

new

new: (descriptor: PluginDescriptorFields?) -> PluginObject

Builds the plugin object. Its optional table is the plugin's descriptor (see PluginDescriptor). Field initialisers and one-time setup belong in the chunk, which runs once at load.