js:Token

From RPTools Wiki
Jump to navigationJump to search

 This article describes a feature or macro function that is experimental and may be subject to change.

Within the javascript environment used by js.eval, Tokens are represented by the Token class. The token class cannot be directly instantiated, but tokens can be found from the MapTool top level name.


token.getNotes() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.10.0
Returns the notes field of the token.

Usage

1 token.getNotes();


token.setNotes() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.10.0
Sets the notes field of the token.

Usage

1 token.setNotes(newNotes);


token.getName() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.10.0
Returns the name of the token.

Usage

1 token.getName();


token.setName() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.10.0
Sets the name of the token

Usage

1 token.setName(newName);


token.hasSight() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.10.0
Returns true if sight is enabled for the token

Usage

1 token.hasSight();


token.getId() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.10.0
Returns the maptool ID of the token.

Usage

1 token.getId();


token.getProperty() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.10.0
Returns the value of the token property.

Usage

1 token.getProperty(property);


token.setProperty() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.10.0
Sets the value of the token property.

Usage

1 token.setProperty(property, newValue);


token.getX() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.10.0
Returns the X position of the token.

Usage

1 token.getX();



token.getY() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.10.0
Returns the Y position of the token.

Usage

1 token.getY();


token.setX() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.10.0
Sets the X position of the token.

Usage

1 token.setX(newX);


token.setY() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.10.0
Sets the Y position of the token.

Usage

1 token.setY(newY);


See Also

JS: MapTool