Python API Documentation
This is automatically generated documentation for the Python API scripting.
This was generated on 8/1/25
.
Properties
Section titled “Properties”JournalEntries
Section titled “JournalEntries”Type: ConcurrentQueue<JournalEntry>
Backpack
Section titled “Backpack”Type: uint
Get the player’s backpack serial
Player
Section titled “Player”Type: PlayerMobile
Returns the player character object
Type: uint
Return the player’s bank container serial if open, otherwise 0
Random
Section titled “Random”Type: Random
Can be used for random numbers.
API.Random.Next(1, 100)
will return a number between 1 and 100.
API.Random.Next(100)
will return a number between 0 and 100.
LastTargetSerial
Section titled “LastTargetSerial”Type: uint
The serial of the last target, if it has a serial.
LastTargetPos
Section titled “LastTargetPos”Type: Vector3Int
The last target’s position
LastTargetGraphic
Section titled “LastTargetGraphic”Type: ushort
The graphic of the last targeting object
Type: uint
The serial of the last item or mobile from the various findtype/mobile methods
PyProfile
Section titled “PyProfile”Type: PyProfile
Access useful player settings.
ScanType
Section titled “ScanType”Values:
Hostile
Party
Followers
Objects
Mobiles
Notoriety
Section titled “Notoriety”Values:
Unknown
Innocent
Ally
Gray
Criminal
Enemy
Murderer
Invulnerable
PersistentVar
Section titled “PersistentVar”Values:
Char
Account
Server
Global
Methods
Section titled “Methods”ProcessCallbacks
Section titled “ProcessCallbacks”Use this when you need to wait for players to click buttons. Example:
while True: API.ProcessCallbacks() API.Pause(0.1)
Return Type: void
(Does not return anything)
SetSharedVar
Section titled “SetSharedVar”(name, value)
Set a variable that is shared between scripts.
Example:
API.SetSharedVar("myVar", 10)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
name | string | ❌ No | Name of the var |
value | object | ❌ No | Value, can be a number, text, or most other objects too. |
Return Type: void
(Does not return anything)
GetSharedVar
Section titled “GetSharedVar”(name)
Get the value of a shared variable.
Example:
myVar = API.GetSharedVar("myVar")if myVar: API.SysMsg(f"myVar is {myVar}")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
name | string | ❌ No | Name of the var |
Return Type: object
RemoveSharedVar
Section titled “RemoveSharedVar”(name)
Try to remove a shared variable.
Example:
API.RemoveSharedVar("myVar")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
name | string | ❌ No | Name of the var |
Return Type: void
(Does not return anything)
ClearSharedVars
Section titled “ClearSharedVars”Clear all shared vars. Example:
API.ClearSharedVars()
Return Type: void
(Does not return anything)
CloseGumps
Section titled “CloseGumps”Close all gumps created by the API unless marked to remain open.
Return Type: void
(Does not return anything)
Attack
Section titled “Attack”(serial)
Attack a mobile
Example:
enemy = API.NearestMobile([API.Notoriety.Gray, API.Notoriety.Criminal], 7)if enemy: API.Attack(enemy)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
serial | uint | ❌ No |
Return Type: void
(Does not return anything)
BandageSelf
Section titled “BandageSelf”Attempt to bandage yourself. Older clients this will not work, you will need to find a bandage, use it, and target yourself. Example:
if player.HitsMax - player.Hits > 10 or player.IsPoisoned: if API.BandageSelf(): API.CreateCooldownBar(delay, "Bandaging...", 21) API.Pause(8) else: API.SysMsg("WARNING: No bandages!", 32) break
Return Type: bool
ClearLeftHand
Section titled “ClearLeftHand”If you have an item in your left hand, move it to your backpack Sets API.Found to the item’s serial. Example:
leftHand = API.ClearLeftHand()if leftHand: API.SysMsg("Cleared left hand: " + leftHand.Name)
Return Type: PyItem
ClearRightHand
Section titled “ClearRightHand”If you have an item in your right hand, move it to your backpack Sets API.Found to the item’s serial. Example:
rightHand = API.ClearRightHand()if rightHand: API.SysMsg("Cleared right hand: " + rightHand.Name)
Return Type: PyItem
ClickObject
Section titled “ClickObject”(serial)
Single click an object
Example:
API.ClickObject(API.Player)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
serial | uint | ❌ No | Serial, or item/mobile reference |
Return Type: void
(Does not return anything)
UseObject
Section titled “UseObject”(serial, skipQueue)
Attempt to use(double click) an object.
Example:
API.UseObject(API.Backpack)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
serial | uint | ❌ No | The serial |
skipQueue | bool | ✅ Yes | Defaults true, set to false to use a double click queue |
Return Type: void
(Does not return anything)
Contents
Section titled “Contents”(serial)
Get an item count for the contents of a container
Example:
count = API.Contents(API.Backpack)if count > 0: API.SysMsg(f"You have {count} items in your backpack")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
serial | uint | ❌ No |
Return Type: int
ContextMenu
Section titled “ContextMenu”(serial, entry)
Send a context menu(right click menu) response.
This does not open the menu, you do not need to open the menu first. This handles both in one action.
Example:
API.ContextMenu(API.Player, 1)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
serial | uint | ❌ No | |
entry | ushort | ❌ No | Entries start at 0, the top entry will be 0, then 1, 2, etc. (Usually) |
Return Type: void
(Does not return anything)
EquipItem
Section titled “EquipItem”(serial)
Attempt to equip an item. Layer is automatically detected.
Example:
lefthand = API.ClearLeftHand()API.Pause(2)API.EquipItem(lefthand)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
serial | uint | ❌ No |
Return Type: void
(Does not return anything)
ClearMoveQueue
Section titled “ClearMoveQueue”Clear the move item que of all items.
Return Type: void
(Does not return anything)
QueMoveItem
Section titled “QueMoveItem”(serial, destination, amt, x, y)
Move an item to another container.
Use x, and y if you don’t want items stacking in the desination container.
Example:
items = API.ItemsInContainer(API.Backpack)
API.SysMsg("Target your fish barrel", 32)barrel = API.RequestTarget()
if len(items) > 0 and barrel: for item in items: data = API.ItemNameAndProps(item) if data and "An Exotic Fish" in data: API.QueMoveItem(item, barrel)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
serial | uint | ❌ No | |
destination | uint | ❌ No | |
amt | ushort | ✅ Yes | Amount to move |
x | int | ✅ Yes | X coordinate inside a container |
y | int | ✅ Yes | Y coordinate inside a container |
Return Type: void
(Does not return anything)
MoveItem
Section titled “MoveItem”(serial, destination, amt, x, y)
Move an item to another container.
Use x, and y if you don’t want items stacking in the desination container.
Example:
items = API.ItemsInContainer(API.Backpack)
API.SysMsg("Target your fish barrel", 32)barrel = API.RequestTarget()
if len(items) > 0 and barrel: for item in items: data = API.ItemNameAndProps(item) if data and "An Exotic Fish" in data: API.MoveItem(item, barrel) API.Pause(0.75)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
serial | uint | ❌ No | |
destination | uint | ❌ No | |
amt | int | ✅ Yes | Amount to move |
x | int | ✅ Yes | X coordinate inside a container |
y | int | ✅ Yes | Y coordinate inside a container |
Return Type: void
(Does not return anything)
QueMoveItemOffset
Section titled “QueMoveItemOffset”(serial, amt, x, y, z, OSI)
Move an item to the ground near you.
Example:
items = API.ItemsInContainer(API.Backpack)for item in items: API.QueMoveItemOffset(item, 0, 1, 0, 0)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
serial | uint | ❌ No | |
amt | ushort | ✅ Yes | 0 to grab entire stack |
x | int | ✅ Yes | Offset from your location |
y | int | ✅ Yes | Offset from your location |
z | int | ✅ Yes | Offset from your location. Leave blank in most cases |
OSI | bool | ✅ Yes | True if you are playing OSI |
Return Type: void
(Does not return anything)
MoveItemOffset
Section titled “MoveItemOffset”(serial, amt, x, y, z, OSI)
Move an item to the ground near you.
Example:
items = API.ItemsInContainer(API.Backpack)for item in items: API.MoveItemOffset(item, 0, 1, 0, 0) API.Pause(0.75)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
serial | uint | ❌ No | |
amt | int | ✅ Yes | 0 to grab entire stack |
x | int | ✅ Yes | Offset from your location |
y | int | ✅ Yes | Offset from your location |
z | int | ✅ Yes | Offset from your location. Leave blank in most cases |
OSI | bool | ✅ Yes | True if you are playing OSI |
Return Type: void
(Does not return anything)
UseSkill
Section titled “UseSkill”(skillName)
Use a skill.
Example:
API.UseSkill("Hiding")API.Pause(11)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
skillName | string | ❌ No | Can be a partial match. Will match the first skill containing this text. |
Return Type: void
(Does not return anything)
CastSpell
Section titled “CastSpell”(spellName)
Attempt to cast a spell by its name.
Example:
API.CastSpell("Fireball")API.WaitForTarget()API.Target(API.Player)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
spellName | string | ❌ No | This can be a partial match. Fireba will cast Fireball. |
Return Type: void
(Does not return anything)
BuffExists
Section titled “BuffExists”(buffName)
Check if a buff is active.
Example:
if API.BuffExists("Bless"): API.SysMsg("You are blessed!")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
buffName | string | ❌ No | The name/title of the buff |
Return Type: bool
ActiveBuffs
Section titled “ActiveBuffs”Get a list of all buffs that are active. See Buff to see what attributes are available. Buff does not get updated after you access it in python, you will need to call this again to get the latest buff data. Example:
buffs = API.ActiveBuffs()for buff in buffs: API.SysMsg(buff.Title)
Return Type: Buff[]
SysMsg
Section titled “SysMsg”(message, hue)
Show a system message(Left side of screen).
Example:
API.SysMsg("Script started!")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
message | string | ❌ No | Message |
hue | ushort | ✅ Yes | Color of the message |
Return Type: void
(Does not return anything)
(message)
Say a message outloud.
Example:
API.Say("Hello friend!")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
message | string | ❌ No | The message to say |
Return Type: void
(Does not return anything)
HeadMsg
Section titled “HeadMsg”(message, serial, hue)
Show a message above a mobile or item, this is only visible to you.
Example:
API.HeadMsg("Only I can see this!", API.Player)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
message | string | ❌ No | The message |
serial | uint | ❌ No | The item or mobile |
hue | ushort | ✅ Yes | Message hue |
Return Type: void
(Does not return anything)
PartyMsg
Section titled “PartyMsg”(message)
Send a message to your party.
Example:
API.PartyMsg("The raid begins in 30 second! Wait... we don't have raids, wrong game..")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
message | string | ❌ No | The message |
Return Type: void
(Does not return anything)
GuildMsg
Section titled “GuildMsg”(message)
Send your guild a message.
Example:
API.GuildMsg("Hey guildies, just restocked my vendor, fresh valorite suits available!")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
message | string | ❌ No |
Return Type: void
(Does not return anything)
AllyMsg
Section titled “AllyMsg”(message)
Send a message to your alliance.
Example:
API.AllyMsg("Hey allies, just restocked my vendor, fresh valorite suits available!")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
message | string | ❌ No |
Return Type: void
(Does not return anything)
WhisperMsg
Section titled “WhisperMsg”(message)
Whisper a message.
Example:
API.WhisperMsg("Psst, bet you didn't see me here..")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
message | string | ❌ No |
Return Type: void
(Does not return anything)
YellMsg
Section titled “YellMsg”(message)
Yell a message.
Example:
API.YellMsg("Vendor restocked, get your fresh feathers!")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
message | string | ❌ No |
Return Type: void
(Does not return anything)
EmoteMsg
Section titled “EmoteMsg”(message)
Emote a message.
Example:
API.EmoteMsg("laughing")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
message | string | ❌ No |
Return Type: void
(Does not return anything)
FindItem
Section titled “FindItem”(serial)
Try to get an item by its serial.
Sets API.Found to the serial of the item found.
Example:
donkey = API.RequestTarget()item = API.FindItem(donkey)if item: API.SysMsg("Found the donkey!") API.UseObject(item)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
serial | uint | ❌ No | The serial |
Return Type: PyItem
FindType
Section titled “FindType”(graphic, container, range, hue, minamount)
Attempt to find an item by type(graphic).
Sets API.Found to the serial of the item found.
Example:
item = API.FindType(0x0EED, API.Backpack)if item: API.SysMsg("Found the item!") API.UseObject(item)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
graphic | uint | ❌ No | Graphic/Type of item to find |
container | uint | ✅ Yes | Container to search |
range | ushort | ✅ Yes | Max range of item |
hue | ushort | ✅ Yes | Hue of item |
minamount | ushort | ✅ Yes | Only match if item stack is at least this much |
Return Type: PyItem
FindTypeAll
Section titled “FindTypeAll”(graphic, container, range, hue, minamount)
Return a list of items matching the parameters set.
Example:
items = API.FindTypeAll(0x0EED, API.Backpack)if items: API.SysMsg("Found " + str(len(items)) + " items!")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
graphic | uint | ❌ No | Graphic/Type of item to find |
container | uint | ✅ Yes | Container to search |
range | ushort | ✅ Yes | Max range of item(if on ground) |
hue | ushort | ✅ Yes | Hue of item |
minamount | ushort | ✅ Yes | Only match if item stack is at least this much |
Return Type: PyItem[]
FindLayer
Section titled “FindLayer”(layer, serial)
Attempt to find an item on a layer.
Sets API.Found to the serial of the item found.
Example:
item = API.FindLayer("Helmet")if item: API.SysMsg("Wearing a helmet!")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
layer | string | ❌ No | The layer to check, see https://github.com/PlayTazUO/TazUO/blob/main/src/ClassicUO.Client/Game/Data/Layers.cs |
serial | uint | ✅ Yes | Optional, if not set it will check yourself, otherwise it will check the mobile requested |
Return Type: PyItem
ItemsInContainer
Section titled “ItemsInContainer”(container, recursive)
Get all items in a container.
Example:
items = API.ItemsInContainer(API.Backpack)if items: API.SysMsg("Found " + str(len(items)) + " items!") for item in items: API.SysMsg(item.Name) API.Pause(0.5)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
container | uint | ❌ No | |
recursive | bool | ✅ Yes | Search sub containers also? |
Return Type: PyItem[]
UseType
Section titled “UseType”(graphic, hue, container, skipQueue)
Attempt to use the first item found by graphic(type).
Example:
API.UseType(0x3434, API.Backpack)API.WaitForTarget()API.Target(API.Player)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
graphic | uint | ❌ No | Graphic/Type |
hue | ushort | ✅ Yes | Hue of item |
container | uint | ✅ Yes | Parent container |
skipQueue | bool | ✅ Yes | Defaults to true, set to false to queue the double click |
Return Type: void
(Does not return anything)
CreateCooldownBar
Section titled “CreateCooldownBar”(seconds, text, hue)
Create a cooldown bar.
Example:
API.CreateCooldownBar(5, "Healing", 21)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
seconds | double | ❌ No | Duration in seconds for the cooldown bar |
text | string | ❌ No | Text on the cooldown bar |
hue | ushort | ❌ No | Hue to color the cooldown bar |
Return Type: void
(Does not return anything)
IgnoreObject
Section titled “IgnoreObject”(serial)
Adds an item or mobile to your ignore list.
These are unique lists per script. Ignoring an item in one script, will not affect other running scripts.
Example:
for item in ItemsInContainer(API.Backpack): if item.Name == "Dagger": API.IgnoreObject(item)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
serial | uint | ❌ No | The item/mobile serial |
Return Type: void
(Does not return anything)
ClearIgnoreList
Section titled “ClearIgnoreList”Clears the ignore list. Allowing functions to see those items again. Example:
API.ClearIgnoreList()
Return Type: void
(Does not return anything)
OnIgnoreList
Section titled “OnIgnoreList”(serial)
Check if a serial is on the ignore list.
Example:
if API.OnIgnoreList(API.Backpack): API.SysMsg("Currently ignoring backpack")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
serial | uint | ❌ No |
Return Type: bool
Pathfind
Section titled “Pathfind”(x, y, z, distance, wait, timeout)
Attempt to pathfind to a location. This will fail with large distances.
Example:
API.Pathfind(1414, 1515)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
x | int | ❌ No | |
y | int | ❌ No | |
z | int | ✅ Yes | |
distance | int | ✅ Yes | Distance away from goal to stop. |
wait | bool | ✅ Yes | True/False if you want to wait for pathfinding to complete or time out |
timeout | int | ✅ Yes | Seconds to wait before cancelling waiting |
Return Type: bool
PathfindEntity
Section titled “PathfindEntity”(entity, distance, wait, timeout)
Attempt to pathfind to a mobile or item.
Example:
mob = API.NearestMobile([API.Notoriety.Gray, API.Notoriety.Criminal], 7)if mob: API.PathfindEntity(mob)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
entity | uint | ❌ No | The mobile or item |
distance | int | ✅ Yes | Distance to stop from goal |
wait | bool | ✅ Yes | True/False if you want to wait for pathfinding to complete or time out |
timeout | int | ✅ Yes | Seconds to wait before cancelling waiting |
Return Type: bool
Pathfinding
Section titled “Pathfinding”Check if you are already pathfinding. Example:
if API.Pathfinding(): API.SysMsg("Pathfinding...!") API.Pause(0.25)
Return Type: bool
CancelPathfinding
Section titled “CancelPathfinding”Cancel pathfinding. Example:
if API.Pathfinding(): API.CancelPathfinding()
Return Type: void
(Does not return anything)
GetPath
Section titled “GetPath”(x, y, z, distance)
Attempt to build a path to a location. This will fail with large distances.
Example:
API.RequestTarget()path = API.GetPath(int(API.LastTargetPos.X), int(API.LastTargetPos.Y))if path is not None: for x, y, z in path: tile = API.GetTile(x, y) tile.Hue = 53
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
x | int | ❌ No | |
y | int | ❌ No | |
z | int | ✅ Yes | |
distance | int | ✅ Yes | Distance away from goal to stop. |
Return Type: PythonList
AutoFollow
Section titled “AutoFollow”(mobile)
Automatically follow a mobile. This is different than pathfinding. This will continune to follow the mobile.
Example:
mob = API.NearestMobile([API.Notoriety.Gray, API.Notoriety.Criminal], 7)if mob: API.AutoFollow(mob)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
mobile | uint | ❌ No | The mobile |
Return Type: void
(Does not return anything)
CancelAutoFollow
Section titled “CancelAutoFollow”Cancel auto follow mode. Example:
if API.Pathfinding(): API.CancelAutoFollow()
Return Type: void
(Does not return anything)
(direction)
Run in a direction.
Example:
API.Run("north")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
direction | string | ❌ No | north/northeast/south/west/etc |
Return Type: void
(Does not return anything)
(direction)
Walk in a direction.
Example:
API.Walk("north")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
direction | string | ❌ No | north/northeast/south/west/etc |
Return Type: void
(Does not return anything)
(direction)
Turn your character a specific direction.
Example:
API.Turn("north")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
direction | string | ❌ No | north, northeast, etc |
Return Type: void
(Does not return anything)
Rename
Section titled “Rename”(serial, name)
Attempt to rename something like a pet.
Example:
API.Rename(0x12345678, "My Handsome Pet")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
serial | uint | ❌ No | Serial of the mobile to rename |
name | string | ❌ No | The new name |
Return Type: void
(Does not return anything)
Dismount
Section titled “Dismount”(skipQueue)
Attempt to dismount if mounted.
Example:
API.Dismount()
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
skipQueue | bool | ✅ Yes | Defaults true, set to false to use a double click queue |
Return Type: void
(Does not return anything)
(serial, skipQueue)
Attempt to mount(double click)
Example:
API.Mount(0x12345678)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
serial | uint | ❌ No | |
skipQueue | bool | ✅ Yes | Defaults true, set to false to use a double click queue |
Return Type: void
(Does not return anything)
WaitForTarget
Section titled “WaitForTarget”(targetType, timeout)
Wait for a target cursor.
Example:
API.WaitForTarget()
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
targetType | string | ✅ Yes | neutral/harmful/beneficial/any/harm/ben |
timeout | double | ✅ Yes | Max duration in seconds to wait |
Return Type: bool
Target
Section titled “Target”(serial)
Target an item or mobile.
Example:
if API.WaitForTarget(): API.Target(0x12345678)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
serial | uint | ❌ No | Serial of the item/mobile to target |
Return Type: void
(Does not return anything)
Target
Section titled “Target”(x, y, z, graphic)
Target a location. Include graphic if targeting a static.
Example:
if API.WaitForTarget(): API.Target(1243, 1337, 0)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
x | ushort | ❌ No | |
y | ushort | ❌ No | |
z | short | ❌ No | |
graphic | ushort | ✅ Yes | Graphic of the static to target |
Return Type: void
(Does not return anything)
RequestTarget
Section titled “RequestTarget”(timeout)
Request the player to target something.
Example:
target = API.RequestTarget()if target: API.SysMsg("Targeted serial: " + str(target))
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
timeout | double | ✅ Yes | Mac duration to wait for them to target something. |
Return Type: uint
RequestAnyTarget
Section titled “RequestAnyTarget”(timeout)
Prompts the player to target any object in the game world, including an
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
timeout | double | ✅ Yes | The maximum time, in seconds, to wait for a valid target selection. |
If the timeout expires without a selection, the method returns <c>null</c> . |
Return Type: PyGameObject
TargetSelf
Section titled “TargetSelf”Target yourself. Example:
API.TargetSelf()
Return Type: void
(Does not return anything)
TargetLandRel
Section titled “TargetLandRel”(xOffset, yOffset)
Target a land tile relative to your position.
If this doesn’t work, try TargetTileRel instead.
Example:
API.TargetLand(1, 1)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
xOffset | int | ❌ No | X from your position |
yOffset | int | ❌ No | Y from your position |
Return Type: void
(Does not return anything)
TargetTileRel
Section titled “TargetTileRel”(xOffset, yOffset, graphic)
Target a tile relative to your location.
If this doesn’t work, try TargetLandRel instead.’
Example:
API.TargetTileRel(1, 1)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
xOffset | int | ❌ No | X Offset from your position |
yOffset | int | ❌ No | Y Offset from your position |
graphic | ushort | ✅ Yes | Optional graphic, will try to use the graphic of the tile at that location if left empty. |
Return Type: void
(Does not return anything)
CancelTarget
Section titled “CancelTarget”Cancel targeting. Example:
if API.WaitForTarget(): API.CancelTarget() API.SysMsg("Targeting cancelled, april fools made you target something!")
Return Type: void
(Does not return anything)
HasTarget
Section titled “HasTarget”(targetType)
Check if the player has a target cursor.
Example:
if API.HasTarget(): API.CancelTarget()
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
targetType | string | ✅ Yes | neutral/harmful/beneficial/any/harm/ben |
Return Type: bool
GetMap
Section titled “GetMap”Get the current map index. Standard maps are: 0 = Fel 1 = Tram 2 = Ilshenar 3 = Malas 4 = Tokuno 5 = TerMur
Return Type: int
SetSkillLock
Section titled “SetSkillLock”(skill, up_down_locked)
Set a skills lock status.
Example:
API.SetSkillLock("Hiding", "locked")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
skill | string | ❌ No | The skill name, can be partia; |
up_down_locked | string | ❌ No | up/down/locked |
Return Type: void
(Does not return anything)
SetStatLock
Section titled “SetStatLock”(stat, up_down_locked)
Set a skills lock status.
Example:
API.SetStatLock("str", "locked")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
stat | string | ❌ No | The stat name, str, dex, int; Defaults to str. |
up_down_locked | string | ❌ No | up/down/locked |
Return Type: void
(Does not return anything)
Logout
Section titled “Logout”Logout of the game. Example:
API.Logout()
Return Type: void
(Does not return anything)
ItemNameAndProps
Section titled “ItemNameAndProps”(serial, wait, timeout)
Gets item name and properties.
This returns the name and properties in a single string. You can split it by new line if you want to separate them.
Example:
data = API.ItemNameAndProps(0x12345678, True)if data: API.SysMsg("Item data: " + data) if "An Exotic Fish" in data: API.SysMsg("Found an exotic fish!")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
serial | uint | ❌ No | |
wait | bool | ✅ Yes | True or false to wait for name and props |
timeout | int | ✅ Yes | Timeout in seconds |
Return Type: string
HasGump
Section titled “HasGump”(ID)
Check if a player has a server gump. Leave blank to check if they have any server gump.
Example:
if API.HasGump(0x12345678): API.SysMsg("Found a gump!")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
ID | uint | ✅ Yes | Skip to check if player has any gump from server. |
Return Type: uint
ReplyGump
Section titled “ReplyGump”(button, gump)
Reply to a gump.
Example:
API.ReplyGump(21)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
button | int | ❌ No | Button ID |
gump | uint | ✅ Yes | Gump ID, leave blank to reply to last gump |
Return Type: bool
CloseGump
Section titled “CloseGump”(ID)
Close the last gump open, or a specific gump.
Example:
API.CloseGump()
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
ID | uint | ✅ Yes | Gump ID |
Return Type: void
(Does not return anything)
GumpContains
Section titled “GumpContains”(text, ID)
Check if a gump contains a specific text.
Example:
if API.GumpContains("Hello"): API.SysMsg("Found the text!")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
text | string | ❌ No | Can be regex if you start with $, otherwise it’s just regular search. Case Sensitive. |
ID | uint | ✅ Yes | Gump ID, blank to use the last gump. |
Return Type: bool
GetGump
Section titled “GetGump”(ID)
Get a gump by ID.
Example:
gump = API.GetGump()if gump: API.SysMsg("Found the gump!") API.CloseGump(gump)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
ID | uint | ✅ Yes | Leabe blank to use last gump opened from server |
Return Type: Gump
ToggleFly
Section titled “ToggleFly”Toggle flying if you are a gargoyle. Example:
API.ToggleFly()
Return Type: void
(Does not return anything)
ToggleAbility
Section titled “ToggleAbility”(ability)
Toggle an ability.
Example:
if not API.PrimaryAbilityActive(): API.ToggleAbility("primary")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
ability | string | ❌ No | primary/secondary/stun/disarm |
Return Type: void
(Does not return anything)
PrimaryAbilityActive
Section titled “PrimaryAbilityActive”Check if your primary ability is active. Example:
if API.PrimaryAbilityActive(): API.SysMsg("Primary ability is active!")
Return Type: bool
SecondaryAbilityActive
Section titled “SecondaryAbilityActive”Check if your secondary ability is active. Example:
if API.SecondaryAbilityActive(): API.SysMsg("Secondary ability is active!")
Return Type: bool
InJournal
Section titled “InJournal”(msg)
Check if your journal contains a message.
Example:
if API.InJournal("You have been slain"): API.SysMsg("You have been slain!")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
msg | string | ❌ No | The message to check for. Can be regex, prepend your msg with $ |
Return Type: bool
InJournalAny
Section titled “InJournalAny”(msgs)
Check if the journal contains any of the strings in this list.
Can be regex, prepend your msgs with $
Example:
if API.InJournalAny(["You have been slain", "You are dead"]): API.SysMsg("You have been slain or dead!")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
msgs | IList<string> | ❌ No |
Return Type: bool
ClearJournal
Section titled “ClearJournal”Clear your journal(This is specific for each script). Example:
API.ClearJournal()
Return Type: void
(Does not return anything)
(seconds)
Pause the script.
Example:
API.Pause(5)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
seconds | double | ❌ No |
Return Type: void
(Does not return anything)
Stops the current script. Example:
API.Stop()
Return Type: void
(Does not return anything)
ToggleAutoLoot
Section titled “ToggleAutoLoot”Toggle autolooting on or off. Example:
API.ToggleAutoLoot()
Return Type: void
(Does not return anything)
AutoLootContainer
Section titled “AutoLootContainer”(container)
Use autoloot on a specific container.
Example:
targ = API.RequestTarget()if targ: API.AutoLootContainer(targ)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
container | uint | ❌ No |
Return Type: void
(Does not return anything)
Virtue
Section titled “Virtue”(virtue)
Use a virtue.
Example:
API.Virtue("honor")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
virtue | string | ❌ No | honor/sacrifice/valor |
Return Type: void
(Does not return anything)
NearestEntity
Section titled “NearestEntity”(scanType, maxDistance)
Find the nearest item/mobile based on scan type.
Sets API.Found to the serial of the item/mobile.
Example:
item = API.NearestEntity(API.ScanType.Item, 5)if item: API.SysMsg("Found an item!") API.UseObject(item) # You can use API.FindItem or API.FindMobile(item.Serial) to determine if it's an item or mobile
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
scanType | ScanType | ❌ No | |
maxDistance | int | ✅ Yes |
Return Type: PyEntity
NearestMobile
Section titled “NearestMobile”(notoriety, maxDistance)
Get the nearest mobile by Notoriety.
Sets API.Found to the serial of the mobile.
Example:
mob = API.NearestMobile([API.Notoriety.Murderer, API.Notoriety.Criminal], 7)if mob: API.SysMsg("Found a criminal!") API.Msg("Guards!") API.Attack(mob)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
notoriety | IList<Notoriety> | ❌ No | List of notorieties |
maxDistance | int | ✅ Yes |
Return Type: PyMobile
NearestCorpse
Section titled “NearestCorpse”(distance)
Get the nearest corpse within a distance.
Sets API.Found to the serial of the corpse.
Example:
corpse = API.NearestCorpse()if corpse: API.SysMsg("Found a corpse!") API.UseObject(corpse)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
distance | int | ✅ Yes |
Return Type: PyItem
NearestMobiles
Section titled “NearestMobiles”(notoriety, maxDistance)
Get all mobiles matching Notoriety and distance.
Example:
mob = API.NearestMobiles([API.Notoriety.Murderer, API.Notoriety.Criminal], 7)if len(mob) > 0: API.SysMsg("Found enemies!") API.Msg("Guards!") API.Attack(mob[0])
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
notoriety | IList<Notoriety> | ❌ No | List of notorieties |
maxDistance | int | ✅ Yes |
Return Type: PyMobile[]
FindMobile
Section titled “FindMobile”(serial)
Get a mobile from its serial.
Sets API.Found to the serial of the mobile.
Example:
mob = API.FindMobile(0x12345678)if mob: API.SysMsg("Found the mobile!") API.UseObject(mob)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
serial | uint | ❌ No |
Return Type: PyMobile
GetAllMobiles
Section titled “GetAllMobiles”Return a list of all mobiles the client is aware of. Example:
mobiles = API.GetAllMobiles()if mobiles: API.SysMsg("Found " + str(len(mobiles)) + " mobiles!") for mob in mobiles: API.SysMsg(mob.Name) API.Pause(0.5)
Return Type: PyMobile[]
GetTile
Section titled “GetTile”(x, y)
Get the tile at a location.
Example:
tile = API.GetTile(1414, 1515)if tile: API.SysMsg(f"Found a tile with graphic: {tile.Graphic}")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
x | int | ❌ No | |
y | int | ❌ No |
Return Type: PyGameObject
CreateGump
Section titled “CreateGump”(acceptMouseInput, canMove, keepOpen)
Get a blank gump.
Example:
g = API.CreateGump()g.SetRect(100, 100, 200, 200)g.Add(API.CreateGumpLabel("Hello World!"))API.AddGump(g)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
acceptMouseInput | bool | ✅ Yes | Allow clicking the gump |
canMove | bool | ✅ Yes | Allow the player to move this gump |
keepOpen | bool | ✅ Yes | If true, the gump won’t be closed if the script stops. Otherwise, it will be closed when the script is stopped. Defaults to false. |
Return Type: Gump
AddGump
Section titled “AddGump”(g)
Add a gump to the players screen.
Example:
g = API.CreateGump()g.SetRect(100, 100, 200, 200)g.Add(API.CreateGumpLabel("Hello World!"))API.AddGump(g)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
g | Gump | ❌ No | The gump to add |
Return Type: void
(Does not return anything)
CreateGumpCheckbox
Section titled “CreateGumpCheckbox”(text, hue, isChecked)
Create a checkbox for gumps.
Example:
g = API.CreateGump()g.SetRect(100, 100, 200, 200)cb = API.CreateGumpCheckbox("Check me?!")g.Add(cb)API.AddGump(g)
API.SysMsg("Checkbox checked: " + str(cb.IsChecked))
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
text | string | ✅ Yes | Optional text label |
hue | ushort | ✅ Yes | Optional hue |
isChecked | bool | ✅ Yes | Default false, set to true if you want this checkbox checked on creation |
Return Type: Checkbox
CreateGumpLabel
Section titled “CreateGumpLabel”(text, hue)
Create a label for a gump.
Example:
g = API.CreateGump()g.SetRect(100, 100, 200, 200)g.Add(API.CreateGumpLabel("Hello World!"))API.AddGump(g)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
text | string | ❌ No | The text |
hue | ushort | ✅ Yes | The hue of the text |
Return Type: Label
CreateGumpColorBox
Section titled “CreateGumpColorBox”(opacity, color)
Get a transparent color box for gumps.
Example:
g = API.CreateGump()g.SetRect(100, 100, 200, 200)cb = API.CreateGumpColorBox(0.5, "#000000")cb.SetWidth(200)cb.SetHeight(200)g.Add(cb)API.AddGump(g)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
opacity | float | ✅ Yes | 0.5 = 50% |
color | string | ✅ Yes | Html color code like #000000 |
Return Type: AlphaBlendControl
CreateGumpItemPic
Section titled “CreateGumpItemPic”(graphic, width, height)
Create a picture of an item.
Example:
g = API.CreateGump()g.SetRect(100, 100, 200, 200)g.Add(API.CreateGumpItemPic(0x0E78, 50, 50))API.AddGump(g)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
graphic | uint | ❌ No | |
width | int | ❌ No | |
height | int | ❌ No |
Return Type: ResizableStaticPic
CreateGumpButton
Section titled “CreateGumpButton”(text, hue, normal, pressed, hover)
Create a button for gumps.
Example:
g = API.CreateGump()g.SetRect(100, 100, 200, 200)button = API.CreateGumpButton("Click Me!")g.Add(button)API.AddGump(g)
while True: API.SysMsg("Button currently clicked?: " + str(button.IsClicked)) API.SysMsg("Button clicked since last check?: " + str(button.HasBeenClicked())) API.Pause(0.2)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
text | string | ✅ Yes | |
hue | ushort | ✅ Yes | |
normal | ushort | ✅ Yes | Graphic when not clicked or hovering |
pressed | ushort | ✅ Yes | Graphic when pressed |
hover | ushort | ✅ Yes | Graphic on hover |
Return Type: Button
CreateSimpleButton
Section titled “CreateSimpleButton”(text, width, height)
Create a simple button, does not use graphics.
Example:
g = API.CreateGump()g.SetRect(100, 100, 200, 200)button = API.CreateSimpleButton("Click Me!", 100, 20)g.Add(button)API.AddGump(g)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
text | string | ❌ No | |
width | int | ❌ No | |
height | int | ❌ No |
Return Type: NiceButton
CreateGumpRadioButton
Section titled “CreateGumpRadioButton”(text, group, inactive, active, hue, isChecked)
Create a radio button for gumps, use group numbers to only allow one item to be checked at a time.
Example:
g = API.CreateGump()g.SetRect(100, 100, 200, 200)rb = API.CreateGumpRadioButton("Click Me!", 1)g.Add(rb)API.AddGump(g)API.SysMsg("Radio button checked?: " + str(rb.IsChecked))
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
text | string | ✅ Yes | Optional text |
group | int | ✅ Yes | Group ID |
inactive | ushort | ✅ Yes | Unchecked graphic |
active | ushort | ✅ Yes | Checked graphic |
hue | ushort | ✅ Yes | Text color |
isChecked | bool | ✅ Yes | Defaults false, set to true if you want this button checked by default. |
Return Type: RadioButton
CreateGumpTextBox
Section titled “CreateGumpTextBox”(text, width, height, multiline)
Create a text area control.
Example:
w = 500h = 600
gump = API.CreateGump(True, True)gump.SetWidth(w)gump.SetHeight(h)gump.CenterXInViewPort()gump.CenterYInViewPort()
bg = API.CreateGumpColorBox(0.7, "#D4202020")bg.SetWidth(w)bg.SetHeight(h)
gump.Add(bg)
textbox = API.CreateGumpTextBox("Text example", w, h, True)
gump.Add(textbox)
API.AddGump(gump)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
text | string | ✅ Yes | |
width | int | ✅ Yes | |
height | int | ✅ Yes | |
multiline | bool | ✅ Yes |
Return Type: TTFTextInputField
CreateGumpTTFLabel
Section titled “CreateGumpTTFLabel”(text, size, color, font, aligned, maxWidth, applyStroke)
Create a TTF label with advanced options.
Example:
gump = API.CreateGump()gump.SetRect(100, 100, 200, 200)
ttflabel = API.CreateGumpTTFLabel("Example label", 25, "#F100DD", "alagard")ttflabel.SetRect(10, 10, 180, 30)gump.Add(ttflabel)
API.AddGump(gump) #Add the gump to the players screen
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
text | string | ❌ No | |
size | float | ❌ No | Font size |
color | string | ✅ Yes | Hex color: #FFFFFF. Must begin with #. |
font | string | ✅ Yes | Must have the font installed in TazUO |
aligned | string | ✅ Yes | left/center/right. Must set a max width for this to work. |
maxWidth | int | ✅ Yes | Max width before going to the next line |
applyStroke | bool | ✅ Yes | Uses players stroke settings, this turns it on or off |
Return Type: TextBox
CreateGumpSimpleProgressBar
Section titled “CreateGumpSimpleProgressBar”(width, height, backgroundColor, foregroundColor, value, max)
Create a progress bar. Can be updated as needed with bar.SetProgress(current, max)
.
Example:
gump = API.CreateGump()gump.SetRect(100, 100, 400, 200)
pb = API.CreateGumpSimpleProgressBar(400, 200)gump.Add(pb)
API.AddGump(gump)
cur = 0max = 100
while True: pb.SetProgress(cur, max) if cur >= max: break cur += 1 API.Pause(0.5)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
width | int | ❌ No | The width of the bar |
height | int | ❌ No | The height of the bar |
backgroundColor | string | ✅ Yes | The background color(Hex color like #616161) |
foregroundColor | string | ✅ Yes | The foreground color(Hex color like #212121) |
value | int | ✅ Yes | The current value, for example 70 |
max | int | ✅ Yes | The max value(or what would be 100%), for example 100 |
Return Type: SimpleProgressBar
CreateGumpScrollArea
Section titled “CreateGumpScrollArea”(x, y, width, height)
Create a scrolling area, add and position controls to it directly.
Example:
sa = API.CreateGumpScrollArea(0, 60, 200, 140)gump.Add(sa)
for i in range(10): label = API.CreateGumpTTFLabel(f"Label {i + 1}", 20, "#FFFFFF", "alagard") label.SetRect(5, i * 20, 180, 20) sa.Add(label)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
x | int | ❌ No | |
y | int | ❌ No | |
width | int | ❌ No | |
height | int | ❌ No |
Return Type: ScrollArea
CreateGumpPic
Section titled “CreateGumpPic”(graphic, x, y, hue)
Create a gump pic(Use this for gump art, not item art)
Example:
gumpPic = API.CreateGumpPic(0xafb)gump.Add(gumpPic)
**Parameters:**
| Name | Type | Optional | Description || --- | --- | --- | --- || `graphic` | `ushort` | ❌ No | || `x` | `int` | ✅ Yes | || `y` | `int` | ✅ Yes | || `hue` | `ushort` | ✅ Yes | |
**Return Type:** `GumpPic`
---
### AddControlOnClick`(control, onClick, leftOnly)`Add an onClick callback to a control.Example:```pydef myfunc: API.SysMsg("Something clicked!")bg = API.CreateGumpColorBox(0.7, "#D4202020")API.AddControlOnClick(bg, myfunc)while True: API.ProcessCallbacks()
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
control | Control | ❌ No | The control listening for clicks |
onClick | object | ❌ No | The callback function |
leftOnly | bool | ✅ Yes | Only accept left mouse clicks? |
Return Type: Control
AddControlOnDisposed
Section titled “AddControlOnDisposed”(control, onDispose)
Add onDispose(Closed) callback to a control.
Example:
def onClose(): API.Stop()
gump = API.CreateGump()gump.SetRect(100, 100, 200, 200)
bg = API.CreateGumpColorBox(opacity=0.7, color="#000000")gump.Add(bg.SetRect(0, 0, 200, 200))
API.AddControlOnDisposed(gump, onClose)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
control | Control | ❌ No | |
onDispose | object | ❌ No |
Return Type: Control
GetSkill
Section titled “GetSkill”(skill)
Get a skill from the player. See the Skill class for what properties are available: https://github.com/PlayTazUO/TazUO/blob/main/src/ClassicUO.Client/Game/Data/Skill.cs
Example:
skill = API.GetSkill("Hiding")if skill: API.SysMsg("Skill: " + skill.Name) API.SysMsg("Skill Value: " + str(skill.Value)) API.SysMsg("Skill Cap: " + str(skill.Cap)) API.SysMsg("Skill Lock: " + str(skill.Lock))
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
skill | string | ❌ No | Skill name, case-sensitive |
Return Type: Skill
DisplayRange
Section titled “DisplayRange”(distance, hue)
Show a radius around the player.
Example:
API.DisplayRange(7, 32)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
distance | ushort | ❌ No | Distance from the player |
hue | ushort | ✅ Yes | The color to change the tiles at that distance |
Return Type: void
(Does not return anything)
ToggleScript
Section titled “ToggleScript”(scriptName)
Toggle another script on or off.
Example:
API.ToggleScript("MyScript.py")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
scriptName | string | ❌ No | Full name including extension. Can be .py or .lscript. |
Return Type: void
(Does not return anything)
PlayScript
Section titled “PlayScript”(scriptName)
Play a legion script.
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
scriptName | string | ❌ No | This is the file name including extension. |
Return Type: void
(Does not return anything)
StopScript
Section titled “StopScript”(scriptName)
Stop a legion script.
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
scriptName | string | ❌ No | This is the file name including extension. |
Return Type: void
(Does not return anything)
AddMapMarker
Section titled “AddMapMarker”(name, x, y, map, color)
Add a marker to the current World Map (If one is open)
Example:
API.AddMapMarker("Death")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
name | string | ❌ No | |
x | int | ✅ Yes | Defaults to current player X. |
y | int | ✅ Yes | Defaults to current player Y. |
map | int | ✅ Yes | Defaults to current map. |
color | string | ✅ Yes | red/green/blue/purple/black/yellow/white. Default purple. |
Return Type: void
(Does not return anything)
RemoveMapMarker
Section titled “RemoveMapMarker”(name)
Remove a marker from the world map.
Example:
API.RemoveMapMarker("Death")
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
name | string | ❌ No |
Return Type: void
(Does not return anything)
IsProcessingMoveQue
Section titled “IsProcessingMoveQue”Check if the move item queue is being processed. You can use this to prevent actions if the queue is being processed. Example:
if API.IsProcessingMoveQue(): API.Pause(0.5)
Return Type: bool
IsProcessingUseItemQueue
Section titled “IsProcessingUseItemQueue”Check if the use item queue is being processed. You can use this to prevent actions if the queue is being processed. Example:
if API.IsProcessingUseItemQueue(): API.Pause(0.5)
Return Type: bool
IsGlobalCooldownActive
Section titled “IsGlobalCooldownActive”Check if the global cooldown is currently active. This applies to actions like moving or using items, and prevents new actions from executing until the cooldown has expired.
Example:
if API.IsGlobalCooldownActive(): API.Pause(0.5)
Return Type: bool
SavePersistentVar
Section titled “SavePersistentVar”(name, value, scope)
Save a variable that persists between sessions and scripts.
Example:
API.SavePersistentVar("TotalKills", "5", API.PersistentVar.Char)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
name | string | ❌ No | |
value | string | ❌ No | |
scope | PersistentVar | ❌ No |
Return Type: void
(Does not return anything)
RemovePersistentVar
Section titled “RemovePersistentVar”(name, scope)
Delete/remove a persistent variable.
Example:
API.RemovePersistentVar("TotalKills", API.PersistentVar.Char)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
name | string | ❌ No | |
scope | PersistentVar | ❌ No |
Return Type: void
(Does not return anything)
GetPersistentVar
Section titled “GetPersistentVar”(name, defaultValue, scope)
Get a persistent variable.
Example:
API.GetPersistentVar("TotalKills", "0", API.PersistentVar.Char)
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
name | string | ❌ No | |
defaultValue | string | ❌ No | The value returned if no value was saved |
scope | PersistentVar | ❌ No |
Return Type: string
MarkTile
Section titled “MarkTile”(x, y, hue, map)
Mark a tile with a specific hue.
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
x | int | ❌ No | |
y | int | ❌ No | |
hue | ushort | ❌ No | |
map | int | ✅ Yes | Defaults to current map |
Return Type: void
(Does not return anything)
RemoveMarkedTile
Section titled “RemoveMarkedTile”(x, y, map)
Remove a marked tile. See MarkTile for more info.
Parameters:
Name | Type | Optional | Description |
---|---|---|---|
x | int | ❌ No | |
y | int | ❌ No | |
map | int | ✅ Yes |
Return Type: void
(Does not return anything)