Target

The Target class provides various methods for targeting Land, Items and Mobiles in game.

Table of Contents

Methods

AttackTargetFromList

Syntax: Target.AttackTargetFromList(target_name)

Attack Target from gui filter selector, in Targetting tab.

Parameters:
  • target_name (String)
Returns: Void

Cancel

Syntax: Target.Cancel()

Cancel the current target.

Returns: Void

ClearLast

Syntax: Target.ClearLast()

Clear the last target.

Returns: Void

ClearLastAttack

Syntax: Target.ClearLastAttack()

Clear the last attacked target

Returns: Void

ClearLastandQueue

Syntax: Target.ClearLastandQueue()

Clear last target and target queue.

Returns: Void

ClearQueue

Syntax: Target.ClearQueue()

Clear Queue Target.

Returns: Void

GetLast

Syntax: Target.GetLast()

Get serial number of last target

Returns: Int32

GetLastAttack

Syntax: Target.GetLastAttack()

Get serial number of last attack target

Returns: Int32

GetTargetFromList

Syntax: Target.GetTargetFromList(target_name)

Get Mobile object from GUI filter selector, in Targetting tab.

Parameters:
  • target_name (String): Name of the target filter.
Returns: Mobile

HasTarget

Syntax: Target.HasTarget(targetFlag)

Get the status of the in-game target cursor Optionally specify the target flag and check if the cursor is "Beneficial", "Harmful", or "Neutral".

Parameters:
  • targetFlag (String): The target flag to check for can be "Any", "Beneficial", "Harmful", or "Neutral".
Returns: Boolean

Last

Syntax: Target.Last()

Execute the target on the last Item or Mobile targeted.

Returns: Void

LastQueued

Syntax: Target.LastQueued()

Enqueue the next target on the last Item or Mobile targeted.

Returns: Void

LastUsedObject

Syntax: Target.LastUsedObject()

Returns the serial of last object used by the player.

Returns: Int32

PerformTargetFromList

Syntax: Target.PerformTargetFromList(target_name)

Execute Target from GUI filter selector, in Targetting tab.

Parameters:
  • target_name (String): Name of the target filter.
Returns: Void

PromptGroundTarget

Syntax: Target.PromptGroundTarget(message, color)

Prompt a target in-game, wait for the Player to select the ground. Can also specific a text message for prompt.

Parameters:
  • message (String): Hint on what to select.
  • color (Int32): Color of the message. (default: 945, gray)
Returns: Point3D

PromptTarget

Syntax: Target.PromptTarget(message, color)

Prompt a target in-game, wait for the Player to select an Item or a Mobile. Can also specific a text message for prompt.

Parameters:
  • message (String): Hint on what to select.
  • color (Int32): Color of the message. (default: 945, gray)
Returns: Int32

Self

Syntax: Target.Self()

Execute the target on the Player.

Returns: Void

SelfQueued

Syntax: Target.SelfQueued()

Enqueue the next target on the Player.

Returns: Void

SetLast

Syntax: Target.SetLast(serial, wait)

Set the last target to specific mobile, using the serial.

Parameters:
  • serial (Int32): Serial of the Mobile.
  • wait (Boolean): Wait confirmation from the server.
Returns: Void

SetLastTargetFromList

Syntax: Target.SetLastTargetFromList(target_name)

Set Last Target from GUI filter selector, in Targetting tab.

Parameters:
  • target_name (String): Name of the target filter.
Returns: Void

TargetExecute

Syntax: Target.TargetExecute(x, y, z, StaticID)

Execute target on specific serial, item, mobile, X Y Z point. Targets the Mobile or Item specified

Parameters:
  • x (Int32): X coordinate.
  • y (Int32): Y coordinate.
  • z (Int32): Z coordinate.
  • StaticID (Int32): ID of Land/Tile
Returns: Void

TargetExecuteRelative

Syntax: Target.TargetExecuteRelative(mobile, offset)

Execute target on specific land point with offset distance from Mobile. Distance is calculated by target Mobile.Direction.

Parameters:
  • mobile (Mobile): Mobile object to target.
  • offset (Int32): Distance from the target.
Returns: Void

TargetResource

Syntax: Target.TargetResource(item_serial, resource_number)

Find and target a resource using the specified item.

Parameters:
  • item_serial (Int32): Item object to use.
  • resource_number (Int32): Resource as standard name or custom number 0: ore 1: sand 2: wood 3: graves 4: red_mushrooms n: custom
Returns: Void

TargetType

Syntax: Target.TargetType(graphic, color, range, selector, notoriety)
Parameters:
  • graphic (Int32)
  • color (Int32)
  • range (Int32)
  • selector (String)
  • notoriety (List[Byte])
Returns: Boolean

WaitForTarget

Syntax: Target.WaitForTarget(delay, noshow)

Wait for the cursor to show the target, pause the script for a maximum amount of time. and optional flag True or False. True Not show cursor, false show it

Parameters:
  • delay (Int32): Maximum amount to wait, in milliseconds
  • noshow (Boolean): Pevent the cursor to display the target.
Returns: Boolean

WaitForTargetOrFizzle

Syntax: Target.WaitForTargetOrFizzle(delay, noshow)

Wait for the cursor to show the target, or the sound for fizzle (0x5c) or pause the script for a maximum amount of time. and an optional flag True or False. True Not show cursor, false show it

Parameters:
  • delay (Int32): Maximum amount to wait, in milliseconds
  • noshow (Boolean): Prevent the cursor to display the target.
Returns: Boolean