Package net.runelite.api
Interface ScriptEvent
-
public interface ScriptEvent
-
-
Field Summary
Fields Modifier and Type Field Description static int
KEY_CHAR
static int
KEY_CODE
static int
MENU_OP
static int
MOUSE_X
static int
MOUSE_Y
static String
NAME
static int
WIDGET_ID
static int
WIDGET_INDEX
static int
WIDGET_TARGET_ID
static int
WIDGET_TARGET_INDEX
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object[]
getArguments()
Arguments passed to the script.int
getMouseX()
Parent relative x coordinate for mouse related eventsint
getMouseY()
Parent relative y coordinate for mouse related eventsint
getOp()
Gets the menu op of the eventString
getOpbase()
Gets the target of the menu optionWidget
getSource()
Gets the widget theWIDGET_ID
andWIDGET_INDEX
args are substituted withWidget
getTarget()
Gets theWidget
target.int
getTypedKeyChar()
Get the typed character, ascii.int
getTypedKeyCode()
Jagex typed keycodevoid
run()
Executes a cs2 script specified by this event This method must be ran on the client thread and is not reentrantScriptEvent
setOp(int op)
Set the menu op of the eventScriptEvent
setSource(Widget widget)
Sets the widget theWIDGET_ID
andWIDGET_INDEX
args are substituted with.ScriptEvent
setTarget(Widget target)
Sets theWidget
target.
-
-
-
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_ID
andWIDGET_INDEX
args are substituted with
-
setSource
ScriptEvent setSource(Widget widget)
Sets the widget theWIDGET_ID
andWIDGET_INDEX
args are substituted with. This is useful for running widget listeners- See Also:
Widget.getOnLoadListener()
-
getTarget
@Nullable Widget getTarget()
Gets theWidget
target. This is only used for the drag complete listener- Returns:
- See Also:
Widget.setOnDragCompleteListener(Object...)
-
setTarget
ScriptEvent setTarget(Widget target)
Sets theWidget
target. 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
-
-