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.
| Hook | Returns | Description |
|---|---|---|
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() | any | Return 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?) | PluginObject | Builds the plugin object. Its optional table is the plugin's descriptor (see PluginDescriptor). Field initialisers and one-time setup bel… |
startUpstartUp: (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.
shutDownshutDown: (Plugin) -> ()The plugin was disabled. The object is unregistered from the event bus first, so no event reaches it after.
resetConfigurationresetConfiguration: (Plugin) -> ()The settings page's Reset put the plugin's config group back to its defaults.
provideConfigprovideConfig: (Plugin) -> anyReturn 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.
recommendedSettingsrecommendedSettings: (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.
onActorDeathonActorDeath: (Plugin, ActorDeath) -> ()The ActorDeath event.
onAmbientSoundEffectCreatedonAmbientSoundEffectCreated: (Plugin, AmbientSoundEffectCreated) -> ()The AmbientSoundEffectCreated event.
onAnimationChangedonAnimationChanged: (Plugin, AnimationChanged) -> ()The AnimationChanged event.
onAreaSoundEffectPlayedonAreaSoundEffectPlayed: (Plugin, AreaSoundEffectPlayed) -> ()The AreaSoundEffectPlayed event.
onBeforeMenuRenderonBeforeMenuRender: (Plugin, BeforeMenuRender) -> ()The BeforeMenuRender event.
onBeforeRenderonBeforeRender: (Plugin, BeforeRender) -> ()The BeforeRender event.
onChatMessageonChatMessage: (Plugin, ChatMessage) -> ()The ChatMessage event.
onClanChannelChangedonClanChannelChanged: (Plugin, ClanChannelChanged) -> ()The ClanChannelChanged event.
onClanMemberJoinedonClanMemberJoined: (Plugin, ClanMemberJoined) -> ()The ClanMemberJoined event.
onClanMemberLeftonClanMemberLeft: (Plugin, ClanMemberLeft) -> ()The ClanMemberLeft event.
onClientTickonClientTick: (Plugin, ClientTick) -> ()Once per client cycle while logged in. It does not run on the login screen; onPostClientTick does.
onCommandExecutedonCommandExecuted: (Plugin, CommandExecuted) -> ()The CommandExecuted event.
onDecorativeObjectDespawnedonDecorativeObjectDespawned: (Plugin, DecorativeObjectDespawned) -> ()The DecorativeObjectDespawned event.
onDecorativeObjectSpawnedonDecorativeObjectSpawned: (Plugin, DecorativeObjectSpawned) -> ()The DecorativeObjectSpawned event.
onFakeXpDroponFakeXpDrop: (Plugin, FakeXpDrop) -> ()The FakeXpDrop event.
onFocusChangedonFocusChanged: (Plugin, FocusChanged) -> ()The FocusChanged event.
onFriendsChatChangedonFriendsChatChanged: (Plugin, FriendsChatChanged) -> ()The FriendsChatChanged event.
onFriendsChatMemberJoinedonFriendsChatMemberJoined: (Plugin, FriendsChatMemberJoined) -> ()The FriendsChatMemberJoined event.
onFriendsChatMemberLeftonFriendsChatMemberLeft: (Plugin, FriendsChatMemberLeft) -> ()The FriendsChatMemberLeft event.
onFriendsChatSynconFriendsChatSync: (Plugin, FriendsChatSync) -> ()The FriendsChatSync event.
onGameObjectDespawnedonGameObjectDespawned: (Plugin, GameObjectDespawned) -> ()The GameObjectDespawned event.
onGameObjectSpawnedonGameObjectSpawned: (Plugin, GameObjectSpawned) -> ()The GameObjectSpawned event.
onGameStateChangedonGameStateChanged: (Plugin, GameStateChanged) -> ()The GameStateChanged event.
onGameTickonGameTick: (Plugin, GameTick) -> ()The GameTick event.
onGrandExchangeOfferChangedonGrandExchangeOfferChanged: (Plugin, GrandExchangeOfferChanged) -> ()The GrandExchangeOfferChanged event.
onGrandExchangeSearchedonGrandExchangeSearched: (Plugin, GrandExchangeSearched) -> ()The GrandExchangeSearched event.
onGraphicChangedonGraphicChanged: (Plugin, GraphicChanged) -> ()The GraphicChanged event.
onGraphicsObjectCreatedonGraphicsObjectCreated: (Plugin, GraphicsObjectCreated) -> ()The GraphicsObjectCreated event.
onGroundObjectDespawnedonGroundObjectDespawned: (Plugin, GroundObjectDespawned) -> ()The GroundObjectDespawned event.
onGroundObjectSpawnedonGroundObjectSpawned: (Plugin, GroundObjectSpawned) -> ()The GroundObjectSpawned event.
onHitsplatAppliedonHitsplatApplied: (Plugin, HitsplatApplied) -> ()The HitsplatApplied event.
onInteractingChangedonInteractingChanged: (Plugin, InteractingChanged) -> ()The InteractingChanged event.
onItemContainerChangedonItemContainerChanged: (Plugin, ItemContainerChanged) -> ()The ItemContainerChanged event.
onItemDespawnedonItemDespawned: (Plugin, ItemDespawned) -> ()The ItemDespawned event.
onItemQuantityChangedonItemQuantityChanged: (Plugin, ItemQuantityChanged) -> ()The ItemQuantityChanged event.
onItemSpawnedonItemSpawned: (Plugin, ItemSpawned) -> ()The ItemSpawned event.
onMenuEntryAddedonMenuEntryAdded: (Plugin, MenuEntryAdded) -> ()The MenuEntryAdded event.
onMenuOpenedonMenuOpened: (Plugin, MenuOpened) -> ()The MenuOpened event.
onMenuOptionClickedonMenuOptionClicked: (Plugin, MenuOptionClicked) -> ()The MenuOptionClicked event.
onMenuShouldLeftClickonMenuShouldLeftClick: (Plugin, MenuShouldLeftClick) -> ()The MenuShouldLeftClick event.
onNameableNameChangedonNameableNameChanged: (Plugin, NameableNameChanged) -> ()The NameableNameChanged event.
onNpcChangedonNpcChanged: (Plugin, NpcChanged) -> ()The NpcChanged event.
onNpcDespawnedonNpcDespawned: (Plugin, NpcDespawned) -> ()The NpcDespawned event.
onNpcSpawnedonNpcSpawned: (Plugin, NpcSpawned) -> ()The NpcSpawned event.
onOverheadTextChangedonOverheadTextChanged: (Plugin, OverheadTextChanged) -> ()The OverheadTextChanged event.
onPlayerChangedonPlayerChanged: (Plugin, PlayerChanged) -> ()The PlayerChanged event.
onPlayerDespawnedonPlayerDespawned: (Plugin, PlayerDespawned) -> ()The PlayerDespawned event.
onPlayerSpawnedonPlayerSpawned: (Plugin, PlayerSpawned) -> ()The PlayerSpawned event.
onPostClientTickonPostClientTick: (Plugin, PostClientTick) -> ()Once per client cycle in every game state, the login screen included.
onPostHealthBarConfigonPostHealthBarConfig: (Plugin, PostHealthBarConfig) -> ()The PostHealthBarConfig event.
onPostMenuSortonPostMenuSort: (Plugin, PostMenuSort) -> ()The PostMenuSort event.
onPreMapLoadonPreMapLoad: (Plugin, PreMapLoad) -> ()The PreMapLoad event.
onProjectileMovedonProjectileMoved: (Plugin, ProjectileMoved) -> ()The ProjectileMoved event.
onRemovedFriendonRemovedFriend: (Plugin, RemovedFriend) -> ()The RemovedFriend event.
onResizeableChangedonResizeableChanged: (Plugin, ResizeableChanged) -> ()The ResizeableChanged event.
onScriptCallbackEventonScriptCallbackEvent: (Plugin, ScriptCallbackEvent) -> ()The ScriptCallbackEvent event.
onScriptPostFiredonScriptPostFired: (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.
onScriptPreFiredonScriptPreFired: (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.
onSoundEffectPlayedonSoundEffectPlayed: (Plugin, SoundEffectPlayed) -> ()The SoundEffectPlayed event.
onStatChangedonStatChanged: (Plugin, StatChanged) -> ()The StatChanged event.
onVarClientIntChangedonVarClientIntChanged: (Plugin, VarClientIntChanged) -> ()The VarClientIntChanged event.
onVarClientStrChangedonVarClientStrChanged: (Plugin, VarClientStrChanged) -> ()The VarClientStrChanged event.
onVarbitChangedonVarbitChanged: (Plugin, VarbitChanged) -> ()The VarbitChanged event.
onWallObjectDespawnedonWallObjectDespawned: (Plugin, WallObjectDespawned) -> ()The WallObjectDespawned event.
onWallObjectSpawnedonWallObjectSpawned: (Plugin, WallObjectSpawned) -> ()The WallObjectSpawned event.
onWidgetClosedonWidgetClosed: (Plugin, WidgetClosed) -> ()The WidgetClosed event.
onWidgetDragonWidgetDrag: (Plugin, WidgetDrag) -> ()The WidgetDrag event.
onWidgetLoadedonWidgetLoaded: (Plugin, WidgetLoaded) -> ()The WidgetLoaded event.
onWorldChangedonWorldChanged: (Plugin, WorldChanged) -> ()The WorldChanged event.
onWorldListLoadonWorldListLoad: (Plugin, WorldListLoad) -> ()The WorldListLoad event.
onWorldViewLoadedonWorldViewLoaded: (Plugin, WorldViewLoaded) -> ()The WorldViewLoaded event.
onWorldViewUnloadedonWorldViewUnloaded: (Plugin, WorldViewUnloaded) -> ()The WorldViewUnloaded event.
onAccountHashChangedonAccountHashChanged: (Plugin, AccountHashChanged) -> ()The AccountHashChanged event.
onCanvasSizeChangedonCanvasSizeChanged: (Plugin, CanvasSizeChanged) -> ()The CanvasSizeChanged event.
onUsernameChangedonUsernameChanged: (Plugin, UsernameChanged) -> ()The UsernameChanged event.
onWorldEntityDespawnedonWorldEntityDespawned: (Plugin, WorldEntityDespawned) -> ()The WorldEntityDespawned event.
onWorldEntitySpawnedonWorldEntitySpawned: (Plugin, WorldEntitySpawned) -> ()The WorldEntitySpawned event.
onConfigChangedonConfigChanged: (Plugin, ConfigChanged) -> ()The ConfigChanged event.
onExternalPluginsChangedonExternalPluginsChanged: (Plugin, ExternalPluginsChanged) -> ()The ExternalPluginsChanged event.
onOverlayMenuClickedonOverlayMenuClicked: (Plugin, OverlayMenuClicked) -> ()The OverlayMenuClicked event.
onPlayerLootReceivedonPlayerLootReceived: (Plugin, PlayerLootReceived) -> ()The PlayerLootReceived event.
onPluginChangedonPluginChanged: (Plugin, PluginChanged) -> ()The PluginChanged event.
onProfileChangedonProfileChanged: (Plugin, ProfileChanged) -> ()The ProfileChanged event.
onRuneScapeProfileChangedonRuneScapeProfileChanged: (Plugin, RuneScapeProfileChanged) -> ()The RuneScapeProfileChanged event.
onServerNpcLootonServerNpcLoot: (Plugin, ServerNpcLoot) -> ()The ServerNpcLoot event.
onWorldsFetchonWorldsFetch: (Plugin, WorldsFetch) -> ()The WorldsFetch event.
sidePanelsidePanel: (Plugin, Panel) -> ()Draw the plugin's side panel. Declaring this is what gives the plugin a panel at all. Immediate mode: called every frame.
renderWindowsrenderWindows: (Plugin, Window) -> ()Open and drive separate viewport windows. The window handle is valid only for this pass.
renderOverlayrenderOverlay: (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
endgetNamegetName: (Plugin) -> string?The descriptor's name.
getIdgetId: (Plugin) -> string?The plugin's id (its package folder's name).
newnew: (descriptor: PluginDescriptorFields?) -> PluginObjectBuilds 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.