Package net.runelite.api
Interface ScriptEvent
-
public interface ScriptEvent
-
-
Field Summary
Fields Modifier and Type Field Description static intKEY_CHARstatic intKEY_CODEstatic intMENU_OPstatic intMOUSE_Xstatic intMOUSE_Ystatic StringNAMEstatic intWIDGET_IDstatic intWIDGET_INDEXstatic intWIDGET_TARGET_IDstatic intWIDGET_TARGET_INDEX
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object[]getArguments()Arguments passed to the script.intgetMouseX()Parent relative x coordinate for mouse related eventsintgetMouseY()Parent relative y coordinate for mouse related eventsintgetOp()Gets the menu op of the eventStringgetOpbase()Gets the target of the menu optionWidgetgetSource()Gets the widget theWIDGET_IDandWIDGET_INDEXargs are substituted withWidgetgetTarget()Gets theWidgettarget.intgetTypedKeyChar()Get the typed character, ascii.intgetTypedKeyCode()Jagex typed keycodevoidrun()Executes a cs2 script specified by this event This method must be ran on the client thread and is not reentrantScriptEventsetOp(int op)Set the menu op of the eventScriptEventsetSource(Widget widget)Sets the widget theWIDGET_IDandWIDGET_INDEXargs are substituted with.ScriptEventsetTarget(Widget target)Sets theWidgettarget.
-
-
-
Field Detail
-
MOUSE_X
static final int MOUSE_X
- See Also:
- Constant Field Values
-
MOUSE_Y
static final int MOUSE_Y
- See Also:
- Constant Field Values
-
MENU_OP
static final int MENU_OP
- See Also:
- Constant Field Values
-
WIDGET_ID
static final int WIDGET_ID
- See Also:
- Constant Field Values
-
WIDGET_INDEX
static final int WIDGET_INDEX
- See Also:
- Constant Field Values
-
WIDGET_TARGET_ID
static final int WIDGET_TARGET_ID
- See Also:
- Constant Field Values
-
WIDGET_TARGET_INDEX
static final int WIDGET_TARGET_INDEX
- See Also:
- Constant Field Values
-
KEY_CODE
static final int KEY_CODE
- See Also:
- Constant Field Values
-
KEY_CHAR
static final int KEY_CHAR
- See Also:
- Constant Field Values
-
NAME
static final String NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSource
Widget getSource()
Gets the widget theWIDGET_IDandWIDGET_INDEXargs are substituted with
-
setSource
ScriptEvent setSource(Widget widget)
Sets the widget theWIDGET_IDandWIDGET_INDEXargs are substituted with. This is useful for running widget listeners- See Also:
Widget.getOnLoadListener()
-
getTarget
@Nullable Widget getTarget()
Gets theWidgettarget. This is only used for the drag complete listener- Returns:
- See Also:
Widget.setOnDragCompleteListener(Object...)
-
setTarget
ScriptEvent setTarget(Widget target)
Sets theWidgettarget. This is only used for the drag complete listener.- Parameters:
target-- Returns:
- See Also:
Widget.setOnDragCompleteListener(Object...)
-
getArguments
Object[] getArguments()
Arguments passed to the script. Index 0 is the script being run and is not an argument.- Returns:
-
getOp
int getOp()
Gets the menu op of the event- Returns:
- the menu op
-
setOp
ScriptEvent setOp(int op)
Set the menu op of the event- Parameters:
op-
-
getOpbase
String getOpbase()
Gets the target of the menu option- Returns:
- the target
- See Also:
MenuOptionClicked
-
getMouseX
int getMouseX()
Parent relative x coordinate for mouse related events
-
getMouseY
int getMouseY()
Parent relative y coordinate for mouse related events
-
getTypedKeyCode
int getTypedKeyCode()
Jagex typed keycode- Returns:
-
getTypedKeyChar
int getTypedKeyChar()
Get the typed character, ascii.- Returns:
-
run
void run()
Executes a cs2 script specified by this event This method must be ran on the client thread and is not reentrant
-
-