Both sides previous revision
Previous revision
|
Next revision
Both sides next revision
|
macros_commands [2017/08/20 17:31] megano0body |
macros_commands [2018/09/08 04:23] megano0body |
| |
====== Macro Commands ====== | ====== Macro Commands ====== |
| |
**!**//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 ===== |
| |
| |
**GoLabel**//(Name)// Go to a Label | **GoLabel**//(Name)// Go to a Label |
| |
| **Comment**//()// No-op |
| |
| **VarSet**//(Name, Value)// Set the variable to given value |
| |
| **VarGet**//(Name)// Return the INT value of a variable by its name (only for numeric variables!!) |
| |
| **HasVar**//(VarName)// If a variable exists |
| |
| **GenWikiDoc**//()// Generates the Macro Documentation in the BBot.Macros.Documentation.txt file |
| |
===== Math ===== | ===== Math ===== |
| |
**Mod**//(A, B)// Return A % B (modulos remainder) | **Mod**//(A, B)// 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 variables ===== |
| |
**Cooldown.UnBlocked**//(CooldownName)// Verifies if there is not 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 ===== |
**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 Trade, requires 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 |
| |
**Map.CreatureOnTop.ID**//(X, Y, Z)// Return creature ID 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 ===== |
| |
**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 |
| |
**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 |
| |
**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 |
| |
| |