User Tools

Site Tools


macros_commands

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
macros_commands [2017/03/08 17:59]
megano0body
macros_commands [2021/11/15 16:43] (current)
Line 1: Line 1:
 +
 ====== Macro Commands ====== ====== Macro Commands ======
  
Line 19: Line 20:
 **!**//VariableName//**!** **!**//VariableName//**!**
  
-Self.Say(**!**//HP//**!**)+Self.Say(**!**//HP//**!** or shorthand **!**//HP//)
  
 SecondMagicNumber:=**!**//MagicNumber//**!** SecondMagicNumber:=**!**//MagicNumber//**!**
 +ThirdMagicNumber:=**!**//MagicNumber//
  
 Variables can be used in the FullCheck and some other features of the BBot. Variables can be used in the FullCheck and some other features of the BBot.
- 
 ===== Internals ===== ===== Internals =====
  
Line 31: Line 32:
 **Label**//(Name)// Go to a Label **Label**//(Name)// Go to a Label
  
-**VarAdd**//(Name, Value)// Increase the variable value by given value+**GoLabel**//(Name)// Go to Label
  
-**Inc**//(Name, Value)// Increase the variable value by a given value+**Comment**//()// No-op
  
-**VarSub**//(Name, Value)// Decrease the variable value by a given value+**VarSet**//(Name, Value)// Set the variable to given value
  
-**Dec**//(Name, Value)// Decrease the variable value by given value+**VarGet**//(Name)// Return the INT value of variable by its name (only for numeric variables!!)
  
-**VarMult**//(Name, Value)// Multiplies the variable value by the given value+**HasVar**//(VarName)// If a variable exists
  
-**Mult**//(Name, Value)// Multiplies the variable value by the given value+**GenWikiDoc**//()// Generates the Macro Documentation in the BBot.Macros.Documentation.txt file
  
-**VarDiv**//(Name, Value)// Divides the variable value by the given value+===== Math =====
  
-**Div**//(Name, Value)// Divides the variable value by the given value+**VarAdd**//(Name, Value)// Increase the variable by a given value 
 + 
 +**VarSub**//(Name, Value)// Decrease the variable by a given value 
 + 
 +**VarMult**//(Name, Value)// Multiplies the variable by the given value 
 + 
 +**VarDiv**//(Name, Value)// Divides the variable by the given value
  
 **VarMod**//(Name, Value)// Returns the modulos remainder of the Variable by the Value **VarMod**//(Name, Value)// Returns the modulos remainder of the Variable by the Value
  
-**Mod**//(NameValue)// Returns the modulos remainder of the Variable by the Value+**Add**//(A, B)// Return A + B 
 + 
 +**Sub**//(A, B)// Return A - B 
 + 
 +**Mult**//(A, B)// Return A * B 
 + 
 +**Div**//(A, B)// Return A / B (integer) 
 + 
 +**Mod**//(AB)// Return A % B (modulos remainder
 + 
 +**Smallest**//(A, B, C...)// Return smallest of all the parameters 
 + 
 +**Greatest**//(A, B, C...)// Return greatest of all the parameters 
 + 
 +===== String ===== 
 + 
 +**Str.Set**//(StrVariableName, StrValue)// Set variable name to STR value 
 + 
 +**Str.Copy**//(StrInputVariable, StrOutputVariable)// Copy a Input variable into a Output variable 
 + 
 +**Str.VarEquals**//(StrVariableNameA, StrVariableNameB)// Check if two STR variables are equals (non-sensitive) 
 + 
 +**Str.VarEqualsSensitive**//(StrVariableNameA, StrVariableNameB)// Check if two STR variables are equals (sensitive) 
 + 
 +**Str.Equals**//(StrA, StrB)// Check if two strings are equals 
 + 
 +**Str.EqualsSensitive**//(StrA, StrB)// Check if two strings are equals (sensitive) 
 + 
 +**Str.Regex**//(PatternVariableName, SubjectVariableName)// Check SubjectVariable content matches to PatternVariable content regex, outputs to !Str.MatchSucced, !Str.MatchFailed, !Str.Match.0, !Str.Match.1 [..] !Str.Match.9 
 + 
 +**Str.Upper**//(StrVariableName)// Makes a string variable uppercase 
 + 
 +**Str.Lower**//(StrVariableName)// Makes a string variable lowercase 
 + 
 +**Str.Reverse**//(StrVariableName)// Reverses a string variable 
 + 
 +**Str.ToHex8**//(OutHex8, Int8)// Convert a number to Hex8 string representation 
 + 
 +**Str.ToHex16**//(OutHex16, Int16)// Convert a number to Hex16 string representation 
 + 
 +**Str.ToHex32**//(OutHex32, Int32)// Convert a number to Hex32 string representation 
 + 
 +===== Cooldown variables ===== 
 + 
 +**Cooldown.Create**//(CooldownName, Delay)// Create a cooldown named CooldownName with Delay 
 + 
 +**Cooldown.Clear**//(CooldownName)// Clear a cooldown named CooldownName 
 + 
 +**Cooldown.Rest**//(CooldownName)// How many miliseconds Cooldown will be still active (or return 0) 
 + 
 +**Cooldown.Blocked**//(CooldownName)// Verifies if there is an active Cooldown named CooldownName 
 + 
 +**Cooldown.UnBlocked**//(CooldownName)// Verifies if there is not an active Cooldown named CooldownName 
 + 
 +**When.Cast**//(WhenName)// Cast a when event 
 + 
 +**When.UnWatch**//()// Unwatches for all the When event 
 + 
 +**When.AnyMessage**//(WhenLabel, MessagePattern)// Add a When listener for all kinds of messages (avoid: bad performance) 
 + 
 +**When.Say**//(WhenLabel, MessagePattern)// Add a When listener for Say messages, when the current character says something 
 + 
 +**When.Yell**//(WhenLabel, MessagePattern)// Add a When listener for Yell messages, when the current character says something 
 + 
 +**When.SystemMessage**//(WhenLabel, MessagePattern)// Add a When listener for System kind of messages 
 + 
 +**When.PlayerMessage**//(WhenLabel, MessagePattern)// Add a When listener for Player kind of messages 
 + 
 +**When.PrivateMessage**//(WhenLabel, MessagePattern)// Add a When listener for Private kind of messages 
 + 
 +**When.NPCMessage**//(WhenLabel, MessagePattern)// Add a When listener for NPC kind of messages
  
 ===== Player State ===== ===== Player State =====
Line 79: Line 156:
 **Self.Level%**//()// The current percent of the player level **Self.Level%**//()// The current percent of the player level
  
-**Self.Attacking**//()// Is the player attacking (ReturnsYes=1; No=0)+**Self.Attacking**//()// Is the player attacking -> :True | :False
  
 **Self.MagicLevel**//()// The player magic level **Self.MagicLevel**//()// The player magic level
Line 96: Line 173:
  
 **Self.Balance**//()// The player current balance gathered from NPC Trade window **Self.Balance**//()// The player current balance gathered from NPC Trade window
 +
 +**Self.Direction**//()// The player direction -> :North | :East | :South | :West | :NorthEast | :SouthEast | :SouthWest | :NorthWest
  
 ===== Player Status ===== ===== Player Status =====
  
-**Status.Poison**//()// The player poison status (ReturnsYes=1; No=0)+**Status.Poison**//()// The player poison status -> :True | :False
  
-**Status.Fire**//()// The player burning status (ReturnsYes=1; No=0)+**Status.Fire**//()// The player burning status -> :True | :False
  
-**Status.Energy**//()// The player electrified status (ReturnsYes=1; No=0)+**Status.Energy**//()// The player electrified status -> :True | :False
  
-**Status.Drunk**//()// The player good drunk status (ReturnsYes=1; No=0)+**Status.Drunk**//()// The player good drunk status -> :True | :False
  
-**Status.ManaShield**//()// The player mana shield status (ReturnsYes=1; No=0)+**Status.ManaShield**//()// The player mana shield status -> :True | :False
  
-**Status.Paralysis**//()// The player paralysis status (ReturnsYes=1; No=0)+**Status.Paralysis**//()// The player paralysis status -> :True | :False
  
-**Status.Haste**//()// The player haste status (ReturnsYes=1; No=0)+**Status.Haste**//()// The player haste status -> :True | :False
  
-**Status.Battle**//()// The player in battle status (ReturnsYes=1; No=0)+**Status.Battle**//()// The player in battle status -> :True | :False
  
-**Status.Underwater**//()// The player under water status (ReturnsYes=1; No=0)+**Status.Underwater**//()// The player under water status -> :True | :False
  
-**Status.Freezing**//()// The player freezing status (ReturnsYes=1; No=0)+**Status.Freezing**//()// The player freezing status -> :True | :False
  
-**Status.Dazzled**//()// The player dazzled status (ReturnsYes=1; No=0)+**Status.Dazzled**//()// The player dazzled status -> :True | :False
  
-**Status.Cursed**//()// The player cursed status (ReturnsYes=1; No=0)+**Status.Cursed**//()// The player cursed status -> :True | :False
  
-**Status.Buff**//()// The player strengthened or buffered status (ReturnsYes=1; No=0)+**Status.Buff**//()// The player strengthened or buffered status -> :True | :False
  
-**Status.PZBlock**//()// The player PZ block (cannot logout, enter pz) status (ReturnsYes=1; No=0)+**Status.PZBlock**//()// The player PZ block (cannot logout, enter pz) status -> :True | :False
  
-**Status.InPZ**//()// The player inside protection zone status (ReturnsYes=1; No=0)+**Status.InPZ**//()// The player inside protection zone status -> :True | :False
  
-**Status.NoLight**//()// The player no light status (ReturnsYes=1; No=0)+**Status.NoLight**//()// The player no light status -> :True | :False
  
-**Status.Bleeding**//()// The player bleeding status (ReturnsYes=1; No=0)+**Status.Bleeding**//()// The player bleeding status -> :True | :False
  
-**Status.Invisible**//()// The player invisible status (ReturnsYes=1; No=0)+**Status.Invisible**//()// The player invisible status -> :True | :False
  
 ===== Player Inventory ===== ===== Player Inventory =====
Line 225: Line 304:
 **Self.Stop**//()// Stop current action **Self.Stop**//()// Stop current action
  
-**Self.PositionIn**//(X1, Y1, Z1, X2, Y2, Z2)// Check if the player is in a position box (ReturnsYes=1; No=0)+**Self.PositionIn**//(X1, Y1, Z1, X2, Y2, Z2)// Check if the player is in a position box -> :True | :False
  
 **Self.MoveTo**//(X, Y, Z)// Walk to a position **Self.MoveTo**//(X, Y, Z)// Walk to a position
Line 382: Line 461:
  
 **Self.PickUp.Ammo**//(ID, X, Y, Z, Range)// Pickup a item from the ground to the Ammo slot **Self.PickUp.Ammo**//(ID, X, Y, Z, Range)// Pickup a item from the ground to the Ammo slot
 +
 +===== Party =====
 +
 +**Party.Status**//(ID)// Return the party status for given creature id -> :None | :Invited | :Inviting | :Member | :Leader | :OtherParty
 +
 +**Party.IsShared**//()// Return if the party is sharing exp
 +
 +**Party.CanShared**//()// Return if the party is sharing exp
 +
 +**Party.Invite**//(ID)// Invite given ID party
 +
 +**Party.Inviting**//(ID)// Return if given creature ID is inviting you to party
 +
 +**Party.Revoke**//(ID)// Revoke party invitation for given ID
 +
 +**Party.Join**//(Leader)// Join party of given leader creature id
 +
 +**Party.PassLeader**//(Leader)// Pass the leadership to a new given leader id
 +
 +**Party.Leave**//()// Leave the current party
 +
 +**Party.ToggleShared**//()// Enable or disable party shared exp
  
 ===== NPC Trading ===== ===== NPC Trading =====
Line 389: Line 490:
 **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.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.SellAll**//(ID)// Sell item to the Traderequires the Trade open before using the macro (by saying Hi,Trade) 
 + 
 +**NPC.Sell**//(ID, Count)// 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 **NPC.Say**//(Text)// Say a text in the special NPC channel
Line 397: Line 500:
 ===== Working with Maps ===== ===== Working with Maps =====
  
-**Map.UseOn**//(ID, OnID, X, Y, Z, Range)// Use a item on the Map (shovel) (ReturnsYes=1; No=0)+**Map.UseOn**//(ID, OnID, X, Y, Z, Range)// Use a item on the Map (shovel) -> :True | :False
  
-**Map.Use**//(ID, X, Y, Z, Range)// Use a item from the Map (Ports) (ReturnsYes=1; No=0)+**Map.Use**//(ID, X, Y, Z, Range)// Use a item from the Map (Ports) -> :True | :False
  
-**Map.HasID**//(ID, X, Y, Z)// Check if a map position has a item (ReturnsYes=1; No=0)+**Map.HasID**//(ID, X, Y, Z)// Check if a map position has a item -> :True | :False
  
-**Map.Thrown**//(ID, Count, X, Y, Z)// Thrown a item on the map from your backpacks (ReturnsYes=1; No=0)+**Map.Thrown**//(ID, Count, X, Y, Z)// Thrown a item on the map from your backpacks -> :True | :False
  
-**Map.PickUp**//(ID, Count, ContainerTo, X, Y, Z)// Pick a item from the map (ReturnsYes=1; No=0)+**Map.PickUp**//(ID, Count, ContainerTo, X, Y, Z)// Pick a item from the map -> :True | :False
  
-**Map.PickUpEx**//(ID, Count, ContainerTo, X, Y, Z, Range)// Pick a item from the map in a range (ReturnsYes=1; No=0)+**Map.PickUpEx**//(ID, Count, ContainerTo, X, Y, Z, Range)// Pick a item from the map in a range -> :True | :False 
 + 
 +**Map.ItemsOnTile**//(X, Y, Z)// Return the number of items on given SQM 
 + 
 +**Map.Item.ID**//(X, Y, Z, Index)// Return item ID on given SQM and Index 
 + 
 +**Map.Item.Count**//(X, Y, Z, Index)// Return item Count on given SQM and Index 
 + 
 +**Map.ItemOnTop.ID**//(X, Y, Z)// Return item ID on given SQM top index 
 + 
 +**Map.ItemOnTop.Count**//(X, Y, Z)// Return item Count on given SQM top index 
 + 
 +**Map.CreatureOnTop.ID**//(X, Y, Z)// Return creature ID on given SQM top index 
 + 
 +**Map.Find**//(ID, X, Y, Z, Range, OnlyTopItem?)// Find a item by ID in a range, outputs to !Found.X, !Found.Y and !Found.Z, also returns  -> :True | :False 
 + 
 +**Map.UseOn.Equip**//(UseID, X, Y, Z, OnSlot)// Use a item from the map on an equipament -> :True | :False
  
 ===== Working with Creatures ===== ===== Working with Creatures =====
Line 420: Line 539:
  
 **Creature.Health**//(ID)// Returns the health percent of the creature with the given ID **Creature.Health**//(ID)// Returns the health percent of the creature with the given ID
 +
 +**Creature.IsAlive**//(ID)// Returns creature is alive
  
 **Creature.Speed**//(ID)// Returns the absolute speed value of the creature with the given ID **Creature.Speed**//(ID)// Returns the absolute speed value of the creature with the given ID
Line 425: Line 546:
 **Creature.DistanceToSelf**//(ID)// Calculate the distance from the creature with the given ID to the player **Creature.DistanceToSelf**//(ID)// Calculate the distance from the creature with the given ID to the player
  
-**Creature.NameIn**//(ID, Name,Na..)// Verify if the creature from the given ID name is in the list (ReturnsYes=1; No=0)+**Creature.NameIn**//(ID, Name,Na..)// Verify if the creature from the given ID name is in the list -> :True | :False
  
 **Creature.ShootOn**//(ID, Ammo)// Shoot a item on the creature (potions, runes and other items) **Creature.ShootOn**//(ID, Ammo)// Shoot a item on the creature (potions, runes and other items)
Line 435: Line 556:
 **Creature.Z**//(ID)// Global position Z from the creature **Creature.Z**//(ID)// Global position Z from the creature
  
-**Creature.IsPlayer**//(ID)// Check if a creature is a player (ReturnsYes=1; No=0)+**Creature.IsPlayer**//(ID)// Check if a creature is a player -> :True | :False
  
-**Creature.IsNPC**//(ID)// Check if a creature is NPC or a Monster (ReturnsYes=1; No=0)+**Creature.IsNPC**//(ID)// Check if a creature is NPC or a Monster -> :True | :False
  
 **Creature.GroupCount**//(ID)// Returns the number of the group that the player is in (guild or party) **Creature.GroupCount**//(ID)// Returns the number of the group that the player is in (guild or party)
Line 456: Line 577:
  
 **Creature.KeepDiagonal**//(ID)// Keeps on the diagonal of a creature **Creature.KeepDiagonal**//(ID)// Keeps on the diagonal of a creature
 +
 +**Creature.Iterator**//(VariableName)// Initialize a creature iterator variable
 +
 +**Creature.Next**//(CreatureIterator, NextLabel)// Iterates to NextLabel if CreatureIterator has new valid creature state
  
 ===== Creature Statistics ===== ===== Creature Statistics =====
Line 462: Line 587:
  
 **Creatures.OnScreen**//()// Count the number of creatures in the screen **Creatures.OnScreen**//()// Count the number of creatures in the screen
 +
 +**Creatures.OnScreenParty**//()// Count the number of creatures in the screen in party
  
 **Creatures.ByRange**//(Range)// Count the number of creatures in a sqm range **Creatures.ByRange**//(Range)// Count the number of creatures in a sqm range
 +
 +**Creatures.ByRangeParty**//(Range)// Count the number of creatures in a sqm range in party
  
 **Creatures.Killed**//(Name)// Count the number of creatures killed with a certain name **Creatures.Killed**//(Name)// Count the number of creatures killed with a certain name
Line 511: Line 640:
 **HUD.Display**//(Text)// Displays a HUD message on game screen **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.Setup**//(HAlign, VAlign, R, B, G)// Set how the HUD message from the macro is shown in the game screen. HAligns = :HLeft | :HCenter | :HRight; VAligns = :VTop | :VMiddle | :VBottom
  
-**HUD.Print**//(HAlign, VAlign, R, B, G, Expire, Text)// Show a HUD in the game screen with specific settings+**HUD.Print**//(HAlign, VAlign, R, B, G, Expire, Text)// Show a HUD in the game screen with specific settings. HAligns = :HLeft | :HCenter | :HRight; VAligns = :VTop | :VMiddle | :VBottom
  
 **Cavebot.Start**//()// Starts the Cavebot **Cavebot.Start**//()// Starts the Cavebot
Line 524: Line 653:
  
 **CaveBot.GoStart**//()// Makes the Cavebot go to the first waypoint item **CaveBot.GoStart**//()// Makes the Cavebot go to the first waypoint item
 +
 +**CaveBot.NoKill**//(enabled)// Start or stop a NoKill state
  
 **Killer.Start**//()// Start the Killer **Killer.Start**//()// Start the Killer
  
 **Killer.Stop**//()// Stop the Killer **Killer.Stop**//()// Stop the Killer
 +
 +**OpenCorpses.Pause**//()// Pause the Open Corpses feature
 +
 +**OpenCorpses.UnPause**//()// Unpause the Open Corpses feature
  
 **Bot.Pause**//()// Toggle the BBot pause **Bot.Pause**//()// Toggle the BBot pause
Line 554: Line 689:
  
 **Misc.SystemTime.Second**//()// Returns the system SECOND **Misc.SystemTime.Second**//()// Returns the system SECOND
 +
 +**Misc.SystemTime.Tick**//()// Returns the system TICK
  
 **Tibia.KeyDown**//(VirtualKeyCode)// Check if a Key is down in tibia **Tibia.KeyDown**//(VirtualKeyCode)// Check if a Key is down in tibia
Line 616: Line 753:
  
 **Debug.ClickEx**//(X, Y)// Debug a mouse click **Debug.ClickEx**//(X, Y)// Debug a mouse click
 +
 +**Debug.Log**//(Message)// Log a message to Macro Debugger
  
 **Misc.Click**//(X, Y)// Send a mouse click **Misc.Click**//(X, Y)// Send a mouse click
  
 **Misc.ClickEx**//(X, Y)// Send a mouse click **Misc.ClickEx**//(X, Y)// Send a mouse click
 +
 +**Misc.SendPacket**//(Buffer)// Send a packet to the server, make sure you know what the hell youre doing
 +
 +===== Container Functions =====
 +
 +**Containers.TotalOpen**//()// Number of Open Containers
 +
 +**Container.Name**//(ContainerIndex, NameVar)// Sets NameVar to ContainerIndex container name
 +
 +**Container.IsOpen**//(ContainerIndex)// Return if the container is open  -> :True | :False
 +
 +**Container.Capacity**//(ContainerIndex)// Return the capacity of a container
 +
 +**Container.Items**//(ContainerIndex)// Return the amount of items in a container
 +
 +**Container.Icon**//(ContainerIndex)// Return the IconID of a container
 +
 +**Container.IsCorpse**//(ContainerIndex)// Return if the container is a corpse  -> :True | :False
 +
 +**Container.IsDepot**//(ContainerIndex)// Return if the container is a depot  -> :True | :False
 +
 +**Container.Item.ID**//(ContainerIndex, SlotIndex)// Return item id at a container/slot
 +
 +**Container.Item.Count**//(ContainerIndex, SlotIndex)// Return item id at a container/slot
 +
 +**Container.Find**//(ItemID)// Find a item in the containers, output to !Found.Succeed, !Found.Container and !Found.Slot  -> :True | :False
 +
 +**Container.Item.Use**//(ContainerIndex, SlotIndex)// Use the item at a container/slot
 +
 +**Container.Item.UseOn**//(ContainerIndex, SlotIndex, UseOnId)// Use an item in this container/slot
 +
 +**Container.Item.Move**//(FromContainer, FromSlot, ToContainer, Count)// Move a item from a container to another
 +
 +**Container.Item.MoveToPos**//(FromContainer, FromSlot, X, Y, Z, Count)// Move a item from a container to a position
  
  
macros_commands.1488995981.txt.gz · Last modified: 2021/11/15 16:43 (external edit)