skrypton-api / com.waicool20.skrypton.sikulix.input / SKryptonRobot

SKryptonRobot

class SKryptonRobot : IRobot

A class representing a org.sikuli.script.IRobot that can be used to control a SKryptonScreen, not recommended for normal use as this is not thread safe, any actions generated will be unpredictable behaviour. It is recommended to use SKryptonKeyboard and SKryptonMouse as a thread safe wrapper to control this robot.

Constructors

<init>

SKryptonRobot(screen: SKryptonScreen)

Main constructor

Properties

screen

val screen: SKryptonScreen

SKryptonScreen that is bound to this robot.

Functions

captureScreen

fun captureScreen(screenRect: Rectangle): ScreenImage

Takes a screenshot of the screen bound to this robot

cleanup

fun cleanup(): Unit

Does nothing, ignore.

clickEnds

fun clickEnds(): Unit

Does nothing, ignore.

clickStarts

fun clickStarts(): Unit

Does nothing, ignore.

delay

fun delay(ms: Int): Unit

Sleeps the current thread for a duration

getColorAt

fun getColorAt(x: Int, y: Int): Color

Gets the color of the pixel at coordinates.

getScreen

fun getScreen(): IScreen

Gets the bound screen instance.

isRemote

fun isRemote(): Boolean

Returns whether or not the robot is controlling a remote screen. Always true.

keyDown

fun keyDown(code: Int): Unit

Presses key with the given code.

fun keyDown(keys: String): Unit

Presses keys specified in a string.

keyUp

fun keyUp(): Unit

Releases all keys.

fun keyUp(code: Int): Unit

Releases key with the given code.

fun keyUp(keys: String): Unit

Releases keys specified in a string

mouseDown

fun mouseDown(buttons: Int): Unit

Presses mouse buttons.

mouseMove

fun mouseMove(x: Int, y: Int): Unit

Moves the mouse to the coordinates instantly.

mouseReset

fun mouseReset(): Unit

Resets the mouse state. Mouse is moved to (0, 0) and all buttons are released.

mouseUp

fun mouseUp(buttons: Int): Int

Releases mouse buttons.

mouseWheel

fun mouseWheel(wheelAmt: Int): Unit

Spins the mouse wheel.

pressModifiers

fun pressModifiers(modifiers: Int): Unit

Presses key modifiers.

releaseModifiers

fun releaseModifiers(modifiers: Int): Unit

Releases key modifiers.

setAutoDelay

fun setAutoDelay(ms: Int): Unit

Sets the auto delay for this robot.

smoothMove

fun smoothMove(dest: Location): Unit

Moves the mouse to the destination in a smooth fashion.

fun smoothMove(src: Location, dest: Location, ms: Long): Unit

Moves the mouse from a source to the destination in a smooth fashion.

typeChar

fun typeChar(character: Char, mode: KeyMode): Unit

Types a given character.

typeEnds

fun typeEnds(): Unit

Does nothing, ignore.

typeKey

fun typeKey(key: Int): Unit

Types a given key.

typeStarts

fun typeStarts(): Unit

Does nothing, ignore.

waitForIdle

fun waitForIdle(): Unit

Does nothing, ignore.