Skip to main content

GamiumClient

Provides the ability to interact with the Gamium Engine. Gamium Client can communicate with game builds with Gamium Engine SDK. The Gamium Client sends the specified message and the Gamium Engine SDK that receives the message performs the logic corresponding to the message.

The Gamium Client can be used as follows.

Usage
import { GamiumClient, NodeGamiumService } from 'gamium';

const gamiumService = new NodeGamiumService('127.0.0.1', 50061);
await gamiumService.connect();
const gamium = new GamiumClient(gamiumService);

Methods

actions

public

Create an ActionChain. You can check how to use it in Control Game.

Usage
await gamium.actions().click({ x: 0, y: 0 }).move({ x: 0, y: 0 }).perform();
Returns

executeRpc

public

You can call a specific function within the game. You can check the usage in Remote Procedure Call.

Usage
await gamium.executeRpc(
RpcBy.method('Gamium.Private.CodebaseSample', 'CallParam1', 10),
);
await gamium.executeRpc(RpcBy.method('Namespace', 'FunctionName', params));
Arguments
Returns

find

public

Locate the object through Locator.

Usage
const object = await gamium.find(By.path('Object path'));
Arguments
Returns

finds

public

Locate the object through Locator. Returns all objects that match the specified Object path.

Usage
const objects = await gamium.finds(By.path('Object path'));

A GamiumError of the code ObjectNotFound will occur if the specified object is not found.

Arguments
Returns

player

public

Locate the object through Locator. Returns the object by considering the object as Player. This object allows you to manipulate Player.

Usage
const player = await gamium.player(By.path('Object path'));
Arguments
Returns

profile

public

Collect performance indicators within the game. Returns the performance indicators collected at the time requested by Game.

Returns

screen

public

Get the screen information for the Game.

Usage
const screen = await gamium.screen();
Returns

sendKey

public

Enter the key that corresponds to KeyBy. You can check how to use it in Control Game.

Usage
await gamium.sendKey(KeyBy.unityKeycode('E'));
Arguments
Returns

sendKeys

public

Enter the key corresponding to the KeyBy array at the same time. You can check how to use it in Control Game.

Usage
await gamium.sendKeys([KeyBy.unityKeycode('W'), KeyBy.unityKeycode('D')], {
duratiomMs: 300,
});
Arguments
Returns

tryFind

public
Arguments
Returns

tryFinds

public
Arguments
Returns

tryWait

public

Wait until the conditions are satisfied. If the condition is not satisfied, the Gamium-error code returns.

Usage
const buttonInfoOrError = await gamium.tryWait(
Until.objectLocated(By.path('Object path')),
);
if (buttonInfoOrError instanceof GamiumError) {
// handle error
}
Arguments
Returns

ui

public

Create UI object. UI Object makes it easy to manipulate UI objects.

Usage
const ui = gamium.ui();
Returns

wait

public

Wait until the conditions are satisfied. If the conditions are not met, a Timeout code is generated.

Usage
const buttonInfo = await gamium.wait(
Until.objectLocated(By.path('Object path')),
);
Arguments
Returns