getSource
getSource: (ScriptEvent) -> Widget?The widget the WIDGET_ID and WIDGET_INDEX sentinels name.
client:createScriptEventBuilder(…):build()| Method | Returns | Description |
|---|---|---|
getSource() | Widget? | The widget the WIDGET_ID and WIDGET_INDEX sentinels name. |
getTarget() | Widget? | The drag-complete target, nil when there is none. |
getArguments() | {number | string} | The arguments: index 1 is the script id, then the script's arguments as the event holds them (sentinels not replaced). A copy: a write to i… |
setArgument(number, any) | () | Sets argument index (1-based as the Luau array getArguments() hands out: 1 is the script id, 2 the script's first argument) to value.… |
getOp() | number | The menu op. |
getOpbase() | string | The op base (the menu target text). |
getMouseX() | number | The mouse x, relative to the source's parent. |
getMouseY() | number | The mouse y, relative to the source's parent. |
getTypedKeyCode() | number | The typed key's Jagex key code. |
getTypedKeyChar() | number | The typed character. |
run() | () | Runs the script the event names, on the client thread, now (not while a script runs: it is not reentrant). A listener token first runs that… |
| Field | Type | Description |
|---|---|---|
MOUSE_X | number | The MOUSE_X sentinel: an int argument replaced by the event's mouse x. |
MOUSE_Y | number | The MOUSE_Y sentinel. |
MENU_OP | number | The MENU_OP sentinel: replaced by the op. |
WIDGET_ID | number | The WIDGET_ID sentinel: replaced by the source's id. |
WIDGET_INDEX | number | The WIDGET_INDEX sentinel: replaced by the source's index. |
WIDGET_TARGET_ID | number | The WIDGET_TARGET_ID sentinel. |
WIDGET_TARGET_INDEX | number | The WIDGET_TARGET_INDEX sentinel. |
KEY_CODE | number | The KEY_CODE sentinel. |
KEY_CHAR | number | The KEY_CHAR sentinel. |
NAME | string | The NAME sentinel: a string argument replaced by the op base. |
| Method | Returns | Description |
|---|---|---|
ScriptEventBuilder.build | ScriptEvent | The event to run(). |
ScriptPreFired.getScriptEvent | ScriptEvent? | What started the root script (its arguments, source widget, op, ...): nil unless this is a root script a ScriptEvent started. Valid whi… |
getSourcegetSource: (ScriptEvent) -> Widget?The widget the WIDGET_ID and WIDGET_INDEX sentinels name.
getTargetgetTarget: (ScriptEvent) -> Widget?The drag-complete target, nil when there is none.
getArgumentsgetArguments: (ScriptEvent) -> {number | string}The arguments: index 1 is the script id, then the script's arguments as the event holds them (sentinels not replaced). A copy: a write to it changes nothing (see setArgument).
setArgumentsetArgument: (ScriptEvent, number, any) -> ()Sets argument index (1-based as the Luau array getArguments() hands out: 1 is the script id, 2 the script's first argument) to value. In a ScriptPreFired handler it reaches the script when the delivery ends; an int stays an int and a string a string.
getOpgetOp: (ScriptEvent) -> numberThe menu op.
getOpbasegetOpbase: (ScriptEvent) -> stringThe op base (the menu target text).
getMouseXgetMouseX: (ScriptEvent) -> numberThe mouse x, relative to the source's parent.
getMouseYgetMouseY: (ScriptEvent) -> numberThe mouse y, relative to the source's parent.
getTypedKeyCodegetTypedKeyCode: (ScriptEvent) -> numberThe typed key's Jagex key code.
getTypedKeyChargetTypedKeyChar: (ScriptEvent) -> numberThe typed character.
runrun: (ScriptEvent) -> ()Runs the script the event names, on the client thread, now (not while a script runs: it is not reentrant). A listener token first runs that callback.