This is an old revision of the document!
To create variables you must use the following syntax:
VariableName := DefaultValue
Example:
HP:=Self.Health()
MagicNumber:=3529
You can use the variables in many places of the BBot, to use a variable use this syntax:
!VariableName!
Teste:=!HP!
MyMagicNumber:=!MagicNumber!
Variables can be used in the FullCheck and some other features of the BBot.
Exit() Stop the macro execution
Label(Name) Go to a Label
VarAdd(Name, Value) Increase the variable value by a given value
Inc(Name, Value) Increase the variable value by a given value
VarSub(Name, Value) Decrease the variable value by a given value
Dec(Name, Value) Decrease the variable value by a given value
VarMult(Name, Value) Multiplies the variable value by the given value
Mult(Name, Value) Multiplies the variable value by the given value
VarDiv(Name, Value) Divides the variable value by the given value
Div(Name, Value) Divides the variable value by the given value
VarMod(Name, Value) Returns the modulos remainder of the Variable by the Value
Mod(Name, Value) Returns the modulos remainder of the Variable by the Value
Self.Health() Absolute player health
Self.Health%() Percent player health
Self.HealthMax() Absolute max player health
Self.Mana() Absolute player mana
Self.Mana%() Percent player mana
Self.ManaMax() Absolute max player mana
Self.StaminaMins() The player stamina minutes
Self.Stamina%() The percent of the player stamina
Self.Soul() The soul of the player
Self.Experience() The experience of the player
Self.ExpToNextLevel() The experience left to the next level
Self.Level() The current player level
Self.Level%() The current percent of the player level
Self.Attacking() Is the player attacking (Returns: Yes=1; No=0)
Self.MagicLevel() The player magic level
Self.MagicLevel%() The player magic level percent
Self.Capacity() The player capacity
Self.X() The player global position X
Self.Y() The player global position Y
Self.Z() The player global position Z
Self.Mount() The player mount id
Status.Poison() The player poison status (Returns: Yes=1; No=0)
Status.Fire() The player burning status (Returns: Yes=1; No=0)
Status.Energy() The player electrified status (Returns: Yes=1; No=0)
Status.Drunk() The player good drunk status (Returns: Yes=1; No=0)
Status.ManaShield() The player mana shield status (Returns: Yes=1; No=0)
Status.Paralysis() The player paralysis status (Returns: Yes=1; No=0)
Status.Haste() The player haste status (Returns: Yes=1; No=0)
Status.Battle() The player in battle status (Returns: Yes=1; No=0)
Status.Underwater() The player under water status (Returns: Yes=1; No=0)
Status.Freezing() The player freezing status (Returns: Yes=1; No=0)
Status.Dazzled() The player dazzled status (Returns: Yes=1; No=0)
Status.Cursed() The player cursed status (Returns: Yes=1; No=0)
Status.Buff() The player strengthened or buffered status (Returns: Yes=1; No=0)
Status.PZBlock() The player PZ block (cannot logout, enter pz) status (Returns: Yes=1; No=0)
Status.InPZ() The player inside protection zone status (Returns: Yes=1; No=0)
Status.NoLight() The player no light status (Returns: Yes=1; No=0)
Status.Bleeding() The player bleeding status (Returns: Yes=1; No=0)
Status.Invisible() The player invisible status (Returns: Yes=1; No=0)
Self.Inventory.Helmet() The player Helmet slot item id
Self.Inventory.Amulet() The player Amulet slot item id
Self.Inventory.Backpack() The player Backpack slot item id
Self.Inventory.Armor() The player Armor slot item id
Self.Inventory.RightHand() The player Right Hand (→) slot item id
Self.Inventory.LeftHand() The player Left Hand (←) slot item id
Self.Inventory.Legs() The player Legs slot item id
Self.Inventory.Boots() The player Boots slot item id
Self.Inventory.Ring() The player Ring slot item id
Self.Inventory.Ammunition() The player Ammunition slot item id
Self.Inventory.Helmet.Count() The player Helmet slot item count
Self.Inventory.Amulet.Count() The player Amulet slot item count
Self.Inventory.Backpack.Count() The player Backpack slot item count
Self.Inventory.Armor.Count() The player Armor slot item count
Self.Inventory.RightHand.Count() The player Right Hand (→) slot item count
Self.Inventory.LeftHand.Count() The player Left Hand (←) slot item count
Self.Inventory.Legs.Count() The player Legs slot item count
Self.Inventory.Boots.Count() The player Boots slot item count
Self.Inventory.Ring.Count() The player Ring slot item count
Self.Inventory.Ammunition.Count() The player Ammunition slot item count
Self.Skill.Fist; () The current First skill level
Self.Skill.Club; () The current Club skill level
Self.Skill.Axe; () The current Axe skill level
Self.Skill.Sword; () The current Sword skill level
Self.Skill.Distance; () The current Distance skill level
Self.Skill.Shielding; () The current Shielding skill level
Self.Skill.Fishing; () The current Fishing skill level
Self.Skill.Fist%; () The current First skill percent
Self.Skill.Club%; () The current Club skill percent
Self.Skill.Axe%; () The current Axe skill percent
Self.Skill.Sword%; () The current Sword skill percent
Self.Skill.Distance%; () The current Distance skill percent
Self.Skill.Shielding%; () The current Shielding skill percent
Self.Skill.Fishing%; () The current Fishing skill percent
Vip.Online(Name) (Disabled since Tibia 962)The Online status of a friend (Returns: Yes=1; No=0)
Self.Say(Text) Say a text in the default channel
Self.Yell(Text) Yell a text in the game
Self.Stop() Stop current action
Self.PositionIn(X1, Y1, Z1, X2, Y2, Z2) Check if the player is in a position box (Returns: Yes=1; No=0)
Self.MoveTo(X, Y, Z) Walk to a position
Self.MoveN() Step one sqm to the north
Self.StepNorth() Step one sqm to the north
Self.MoveS() Step one sqm to the south
Self.StepSouth() Step one sqm to the south
Self.MoveE() Step one sqm to the east
Self.StepEast() Step one sqm to the east
Self.MoveW() Step one sqm to the west
Self.StepWest() Step one sqm to the west
Self.MoveNE() Step one sqm to the north east
Self.StepNorthEast() Step one sqm to the north east
Self.MoveNW() Step one sqm to the north west
Self.StepNorthWest() Step one sqm to the north west
Self.MoveSE() Step one sqm to the south east
Self.StepSouthEast() Step one sqm to the south east
Self.MoveSW() Step one sqm to the south west
Self.StepSouthWest() Step one sqm to the south west
Self.Logout() Logout the player as soon as possible (stop cavebot and wait for logout unblock)
Self.TurnN() Turn the player to the north
Self.TurnNorth() Turn the player to the north
Self.TurnS() Turn the player to the south
Self.TurnSouth() Turn the player to the south
Self.TurnE() Turn the player to the east
Self.TurnEast() Turn the player to the east
Self.TurnW() Turn the player to the west
Self.TurnWest() Turn the player to the west
Self.ReOpenBackpacks() Closes and open the player backpacks
Self.SayInChannel(ChannelID, Words) Send a message to a channel ID
Self.ToggleMount() Toggle the player mount
Self.Backpacks.UseOn(UseID, UseOn) Use a item on a item inside your backpack
Self.Equip.Helmet(ID) Equip a item on the Helmet slot
Self.Equip.Amulet(ID) Equip a item on the Amulet slot
Self.Equip.Backpack(ID) Equip a item on the Backpack slot
Self.Equip.Armor(ID) Equip a item on the Armor slot
Self.Equip.RightHand(ID) Equip a item on the Right Hand (→) slot
Self.Equip.LeftHand(ID) Equip a item on the Left Hand (←) slot
Self.Equip.Legs(ID) Equip a item on the Legs slot
Self.Equip.Boots(ID) Equip a item on the Boots slot
Self.Equip.Ring(ID) Equip a item on the Ring slot
Self.Equip.Ammo(ID) Equip a item on the Ammunition slot
Self.UnEquip.Helmet(ToContainer) Unequip the Helmet slot and put the item on the given container index
Self.UnEquip.Amulet(ToContainer) Unequip the Amulet slot and put the item on the given container index
Self.UnEquip.Backpack(ToContainer) Unequip the Backpack and put the item on the given container index
Self.UnEquip.Armor(ToContainer) Unequip the Armor slot and put the item on the given container index
Self.UnEquip.RightHand(ToContainer) Unequip the Right Hand (→) slot and put the item on the given container index
Self.UnEquip.LeftHand(ToContainer) Unequip the Left Hand (←) slot and put the item on the given container index
Self.UnEquip.Legs(ToContainer) Unequip the Legs slot and put the item on the given container index
Self.UnEquip.Boots(ToContainer) Unequip the Boots slot and put the item on the given container index
Self.UnEquip.Ring(ToContainer) Unequip the Ring slot and put the item on the given container index
Self.UnEquip.Ammo(ToContainer) Unequip the Ammunition slot and put the item on the given container index
NPC.Buy(ID, Count, IgnoreCap) Buy a item on the Trade, requires the Trade open before using the macro (by saying Hi,Trade)
NPC.BuyInBP(ID, Count, IgnoreCap) Buy a item in a backpack from the Trade, requires the Trade open before using the macro (by saying Hi,Trade)
NPC.Sell(ID, Count(-1 is all)) Sell item to the Trade, requires the Trade open before using the macro (by saying Hi,Trade)
NPC.Say(Text) Say a text in the special NPC channel
Map.UseOn(ID, OnID, X, Y, Z, Range) Use a item on the Map (shovel) (Returns: Yes=1; No=0)
Map.Use(ID, X, Y, Z, Range) Use a item from the Map (Ports) (Returns: Yes=1; No=0)
Map.HasID(ID, X, Y, Z) Check if a map position has a item (Returns: Yes=1; No=0)
Map.Thrown(ID, Count, X, Y, Z) Thrown a item on the map from your backpacks (Returns: Yes=1; No=0)
Map.PickUp(ID, Count, ContainerTo, X, Y, Z) Pick a item from the map (Returns: Yes=1; No=0)
Map.PickUpEx(ID, Count, ContainerTo, X, Y, Z, Range) Pick a item from the map in a range (Returns: Yes=1; No=0)
Creature.ByName(Name) Gather a ID from the first creature with the name given found
Creature.Attacking() Gather the ID from the creature being attacked
Creature.Target() Gather the ID from the creature being attacked
Creature.Self() Gather the ID from the player
Creature.Health(ID) Returns the health percent of the creature with the given ID
Creature.Speed(ID) Returns the absolute speed value of the creature with the given ID
Creature.DistanceToSelf(Calculate the distance from the creature with the given ID to the player) ID
Creature.NameIn(ID, Name,Na..) Verify if the creature from the given ID name is in the list (Returns: Yes=1; No=0)
Creature.ShootOn(ID, Ammo) Shoot a item on the creature (potions, runes and other items)
Creature.X(ID) Global position X from the creature
Creature.Y(ID) Global position Y from the creature
Creature.Z(ID) Global position Z from the creature
Creature.IsPlayer(ID) Check if a creature is a player (Returns: Yes=1; No=0)
Creature.IsNPC(ID) Check if a creature is NPC or a Monster (Returns: Yes=1; No=0)
Creature.GroupCount(ID) Returns the number of the group that the player is in (guild or party)
Creature.SquareVisible(ID) Check if a creature has a square
Creature.SquareRed(ID) Return the RED color of the creature square
Creature.SquareGreen(ID) Return the GREEN color of the creature square
Creature.SquareBlue(ID) Return the BLUE color of the creature square
Creature.Attack(ID) Attack a creature
Creature.Follow(ID) Follow a creature
Creature.KeepDistance(ID, Distance) Keep a certain distance from a creature
Creature.KeepDiagonal(ID) Keeps on the diagonal of a creature
Creatures.Beside() Count the number of creatures in a 1 sqm range
Creatures.OnScreen() Count the number of creatures in the screen
Creatures.ByRange(Range) Count the number of creatures in a sqm range
Creatures.Killed(Name) Count the number of creatures killed with a certain name
Creatures.PlayersOnScreen() Count the number of players on the screen
Creatures.TaskKilled(Name) Counts the number of task kills from a certain creature (BOT count, not absolute count)
Creatures.PlayersOnRange(Range) Counts the number of players in a sqm range
Creatures.ByName(Name) Counts the number of creatures with a certain name
Creatures.NPCOnScreen() Counts the number of NPC or Monsters in the screen
Misc.ShootCount(InLastSeconds) Return the number of magic shoot effects in a certain number of seconds
Misc.AttackersCount(InLastSeconds) Return the number of creatures that attacked the player in a certain number of seconds
Misc.HPLose(InLastSeconds) Return the number of HP loose in a certain number of seconds
Misc.HPGain(InLastSeconds) Return the number of HP gained in a certain number of seconds
Misc.HPDelta(InLastSeconds) Return the number of HP delta in a certain number of seconds
Misc.ManaDelta(InLastSeconds) Return the number of MANA delta in a certain number of seconds
Misc.HPHitsBigger(InLastSeconds, BiggerThan) Counts the number of hits that was bigger than a given value in a certain number of seconds
Misc.StandTime() Returns in seconds the time that the player dont walk
Misc.ItemCount(ItemName) Return the number of items from the hotkey message: You are using the…
Misc.Alert(Message) Start a sound alarm with a message
Misc.LoadUrl(Url) Load a URL
Misc.LogFile(File, Text) Log a message in a text file
Misc.ItemCountEx(ItemID) Count the number of items with a ID on the open backpacks
HUD.Display(Text) Displays a HUD message on game screen
HUD.Setup(HAlign, VAlign, R, B, G) Set how the HUD message from the macro is shown in the game screen
HUD.Print(HAlign, VAlign, R, B, G, Expire, Text) Show a HUD in the game screen with specific settings
Cavebot.Start() Starts the Cavebot
Cavebot.Stop() Stops the Cavebot
Cavebot.Reset() Resets the Cavebot
CaveBot.GoLabel(Label) Makes the Cavebot go to a waypoint label
CaveBot.GoStart() Makes the Cavebot go to the first waypoint item
Killer.Start() Start the Killer
Killer.Stop() Stop the Killer
Bot.Pause() Toggle the BBot pause
BBot.TogglePause() Toggle the BBot pause
Bot.LoadSettings(Name) Load a settings configuration file
BBot.ToggleVisible() Toggles the BBot main window visible
BBot.ToggleStats() Shows the BBot statistics on the game screen (HUD and Informations)
BBot.LevelSpyReset() Reset the Level Spy
BBot.LevelSpyUp() Makes the Level Spy go up one floor
BBot.LevelSpyDown() Makes the Level Spy go down one floor
Macro.Wait(Delay) Pause the macro and the entire bot for a delay in miliseconds
Hotkey.Use(ID) Use a Tibia item with a hotkey (e.g Gold Coin)
Misc.SystemTime.Hour() Returns the system HOUR
Misc.SystemTime.Minute() Returns the system MINUTE
Misc.SystemTime.Second() Returns the system SECOND
Tibia.KeyDown(VirtualKeyCode) Check if a Key is down in tibia
Tibia.IsKeyDown(VirtualKeyCode) Check if a Key is down in tibia
Trainers.Stop() Stop the Trainers
Trainers.Start() Start the Trainers
Misc.Random(Min, Max) Generate a random number in a range
Trainers.ClearTrainers() Clear the Trainers training creatures
Protectors.Disable(Name) Disable a protector by its name
Protectors.Enable(Name) Enable a protector by its name
Protectors.DisableAll() Disable all the Protectors
Protectors.EnableAll() Enable all the Protectors
Tibia.SendKey(VirtualKeyCode) Send a key to the Tibia
Tibia.SendText(Text) Send a text to the Tibia
Tibia.Screenshot() Takes a Tibia Screenshot
Tibia.StealthScreenshot() Clean up the HUD and take a Tibia Screenshot
Tibia.Close() Close the Tibia process