Skip to content

Combat

A monsterResolvable is either a monster name or monMapID prefixed with id and delimited by a ', ., :, - character.

Type: Bot

Whether attacks are paused due to an active counter attack.

Type: boolean

Gets the target of the player.

Type: Monster | Avatar | null

Attacks a monster.

ParameterTypeDescription
monsterResolvablestringThe name or monMapID of the monster.

Returns: void

Cancels an auto attack.

Returns: void

Cancels the current target.

Returns: void

ParameterTypeDescription
indexstring | number

Returns: boolean

Exit from combat state.

Returns: Promise<boolean>

Whether the player has a target.

Returns: boolean

Kills a monster.

ParameterTypeOptionalDefaultDescription
monsterResolvablestringThe name or monMapId of the monster.
optionsPartial<KillOptions>{}The optional configuration to use for the kill.

Returns: Promise<void>

// Basic usage
await combat.kill("Frogzard");
// Advanced usage
// Kill Ultra Engineer, but prioritize attacking Defense Drone and Attack Drone first.
await combat.kill("Ultra Engineer", {
killPriority: ["Defense Drone", "Attack Drone"],
skillSet: [5,3,2,1,4],
skillDelay: 50,
});

Kills the monster until the quantity of the item is met in the inventory.

ParameterTypeOptionalDefaultDescription
monsterResolvablestringThe name or monMapID of the monster.
itemstring | numberThe name or ID of the item.
quantitynumberThe quantity of the item.
optionsPartial<KillOptions>{}The configuration to use for the kill.

Returns: Promise<void>

Kills the monster until the quantity of the item is met in the temp inventory.

ParameterTypeOptionalDefaultDescription
monsterResolvablestringThe name or monMapID of the monster.
itemstring | numberThe name or ID of the item.
quantitynumberThe quantity of the item.
optionsPartial<KillOptions>{}The configuration to use for the kill.

Returns: Promise<void>

Rests the player.

ParameterTypeOptionalDefaultDescription
fullbooleanfalseWhether to rest until max hp and mp are reached.
exitbooleanfalseWhether to exit combat before attempting to rest.

Returns: Promise<void>

Casts a skill.

ParameterTypeOptionalDefaultDescription
indexstring | numberThe index of the skill. Skills range from 0 (skill 1) to 5 (potions).
forcebooleanfalseWhether to use the skill regardless if there is a target.
waitbooleanfalseWhether to wait for the skill to be available.

Returns: Promise<void>