This is a list of all functions available from the functions.lua and some from the MalowBotLK.lua file.
- mb_OnUpdate() This is the loop function which is automatically executed every 0.1 seconds, if there are sufficient fps.
Communication[edit | edit source]
- mb_StringStartsWith(fullString, startString) Returns a bool, and the substring of the remaining string
- mb_SplitString(str, char) "char" is a string to search withing "str". Return is a list of strings where "str" is split into multiple strings every place "char" was found.
- mb_SayRaid(message) Prints message in raid-chat
- mb_Print(msg) Prints a message in the default chatbox
- mb_SendMessage(messageType, message) sends a message to set behaviour. Syntax must be handeled by onEvent()
- mb_HarvestCreature() commands the toon to skin/mine/herb the target, if it has the respective profession
- mb_InitAsCommander() Initializes the bot on all toons in that raid, if they have the sender listed as "trusted character" in config.
- mb_HandleReadyCheck() Checks for buffs, auras, etc. actions taken can be defined in class modules.
Macro[edit | edit source]
- mb_CreateMacro(name, body, actionSlot) Creates a macro with "name" and "body" and places it in the specified "actionSlot"
Units[edit | edit source]
- mb_GetClass(unit) Returns the class of the "unit"
- mb_GetNumPartyOrRaidMembers Returns the number of toons in the players raid/party, 1 if not in party/raid.
- mb_GetNumOnlinePartyOrRaidMembers Returns the number of online toons in the players raid/party, 1 if not in party/raid.
- mb_GetUnitFromPartyOrRaidIndex(index) Returns the name of the toon with the given party/raid "index"
- mb_GetUnitForPlayerName(playerName) Returns the unit for the given "name"
- mb_IsValidOffensiveUnit(unit, requireCombat) Returns true if the "unit" is good to attack
- mb_GetMissingHealth(unit) Returns the raw amount of hp deficit for "unit"
- mb_UnitHealthPercentage(unit) Returns the health of the "unit" in percent
- mb_UnitPowerPercentage(unit) Returns the power (Mana, Energy, Rage, Runic Power, Focus) of the "unit" in percent
- mb_GetTargetStrength() Returns a number between 0 and 3 corresponding to how strong the target is. Scales depending on your own max-hp and how many members are in your raid.
[edit | edit source]
- mb_GetMySpecName() Returns the name of your spec
- mb_SpecNotSupported(msg) Makes the toon send a raid message if not commanding
- mb_IsTank() returns true if the toon has a hardcoded tank spec
- mb_IsHealer() returns true if the toon has a hardcoded heal spec
- mb_UpdateClassOrder() Is automatically executed on init. Can be used to update after changing a config variable to receive another buff/aura
Buffs/Preparation[edit | edit source]
- mb_IsUnitResurrector(unit) Returns true/false depending on if the unit is capable of resurrecting other players
- mb_IsSomeoneResurrectingUnit(resurrectUnit) Checks if any friendly unit is resurrecting another raid-member
- mb_GetResurrectionTarget(resurrectionSpell) Returns a resurrectable target
- mb_ResurrectRaid(resurrectionSpell) Will try to resurrect a dead raid member. Returns true if cast starts
- mb_UnitHasMyBuff(unit, spell) Checks if unit has a buff from the spell specified that specifically you have cast
- mb_GetBuffTimeRemaining(unit, spell) Returns the time remaining of a buff named "spell" on "unit"
- mb_GetBuffStackCount(unit, spell) Returns number of buff stacks of "spell" on "unit"
- mb_SetPetAutocast(spell, desiredState) Checks and possibly changes the autocast state of the pets "spell"
- mb_CheckReagentAmount(itemName, desiredItemCount) Print a message if reagent count is lower than treshold
- mb_GetItemCount(itemName) Returns the count of item with specified name
- mb_CheckDurability() Makes the character say in raid if durability of any item is lower than 30%
- mb_ShouldBuff() Checks whether it's a good time to buff, returns true/false
- mb_GetItemLocation(itemName) returns the bag and slot indexes for where an item is located
- mb_HasItem(itemName) returns the amount of "itemName" in the players bags
- mb_UseItem(itemName) tries to use an item in the bags, returns true/false depending on if successful
- mb_IsDrinking() returns true if player is drinking
- mb_Drink(force) Starts drinking if possible, mana below 60% or if "force" is true and mana below 99% and if good to do so. Returns true if drinking
- mb_RegisterInterruptSpell(spell) Tells the bot that this toon as a spell to be cast for interrupting.
- mb_Respec() Makes the toon change its spec
Combat[edit | edit source]
- mb_IsSpellInRange(spell, unit) Returns true if player is in range to cast spell on unit
- mb_GetMostDamagedFriendly(spell) Scans through the raid or party for the unit missing the most health. If "spell" is provided it will make sure the spell is within range of the target
- mb_IsUsableSpell(spell, unit) Returns true if spell can be cast. Unit is optional. If provided it will check if unit is a valid target and is in range.
- mb_CanCastSpell(spell, unit, withinNextGlobal) Checks if there's no cooldown and if the spell use useable (have mana to cast it), and that if we're moving that it doesn't have a cast time. Unit is optional, if provided it will check that the spell can be cast on the unit (that it's a valid target and is in range)
- mb_CastSpellOnTarget(spell) Returns true on successful cast of "spell" on the players target
- mb_CastSpellWithoutTarget(spell) Returns true on successful cast of "spell" without a target
- mb_CastSpellOnFriendly(unit, spell) Casts directly without changing your current target unless required to do so. Returns true on success
- mb_CastSpellOnSelf(spell) Returns true on successful cast of "spell" on self
- mb_GetDebuffStackCount(unit, spell) Returns number of debuff stacks
- mb_GetDebuffTimeRemaining(unit, spell) Returns the time remaining of ANY toons debuff, 0 if it doesn't exist
- mb_GetMyDebuffTimeRemaining(unit, spell) Returns the time remaining of a debuff that YOU have cast, 0 if it doesn't exist
- mb_CleanseRaid(spell, debuffType1, debuffType2, debuffType3) Looks for a unit with "debuffType1", 2 or 3 and tries to cast "spell" on it. Returs true on success.
- mb_UnitHasDebuffOfType(unit, debuffType1, debuffType2, debuffType3) Checks for a unit with "debuffType1", 2 or 3
- mb_IsOnGCD() Returns true if you're on Global Cooldown
- mb_IsReadyForNewCast() Returns true if you're not on GCD and not currently casting
- mb_ShouldUseDpsCooldowns(rangeCheckSpell) Returns true if using CDs is a good idea, modified by "mb_forceBlockDpsCooldowns"
- mb_GetSpellIdForName(spellName) Returns a spell-id for a "spell-name"
- mb_RaidHeal(spell, acceptedOverheal) Finds the most damaged member in the raid and casts the spell on that target as long as it doesn't over-heal
- mb_AcquireOffensiveTarget() Tries to acquire an offensive target. Will assist the commander unit if it exists. Returns true/false depending on if a valid offensive target was acquired.
- mb_StopCast() Stops the current cast.
- mb_GetRemainingSpellCooldown(spell) returns the remaining cooldown of "spell" in seconds
- mb_UseItemCooldowns() Uses trinkets and engineering gloves if available
- mb_IsUnitStunned(unit) Checks for Paladin stuns on the "unit"
- mb_IsUnitSlowed(unit) Checks for certain slow effects on the "unit"
- mb_CrowdControl(unit) Attempts to casts spells in mb_crowdControlSpells on "unit"
- mb_GetMyThreatPercentage(unit) Returns how close you are to actually pull aggro on your target, returns a value between 0 and 100, ranged over-aggro at 130% is baked in.
- mb_HandleAutomaticSalvationRequesting() Requests Hand of Salvation if overaggro is due
- mb_GetComboPoints() Returns number of players combo points on target
- mb_GetTanks(rangeCheckSpell) Returns a list of unit-references of tanks, filtered by if they're valid targets and actually tanking something. Filtered by in-range if "rangeCheckSpell" is provided
- mb_SendExclusiveRequest(requestType, message) requests a certain skill/spell e.g. Heroism/Bloodlust.
Movement[edit | edit source]
- mb_IsMoving() returns true if player speed is not 0
- mb_GetMapPosition(unit) returns x and y coordinates for the "unit"
- mb_GoToPosition_SetDestination(x, y, acceptedDistance, preventAutomaticMovementDisabling) Called once to initiate a movement to a specific x/y map coordinate. The character will continue to try to stay close to that place until mb_GoToPosition_Reset is called
- mb_GoToPosition_Reset() Stops movement, if the condition for GoToPosition changes before it has reached it destination characters can get stuck moving / turning otherwise.
- mb_GoToPosition_Update() Returns false while the character is running towards the point. Returns true once the character reaches it.
- mb_FollowUnit(unit) Returns true on succesful follow attempt
- mb_BreakFollow() Breaks follow with an unnoticable short turn left
- mb_IWTClickToMove(unit) activates click to move, interacts with target and deactivates click to move
- mb_StopMoving() Stops all movement
- mb_DisableAutomaticMovement() Turn auto-movement off and stop
- mb_EnableAutomaticMovement() Turn auto-movement on
Gear checks and QOL (only Honey's fork)[edit | edit source]
- mb_Prospect_auto() Toggles the toon auto prospecting any and all Cobalt and Saronite Ore inside its inventory or personal bank if opened
- mb_Disenchant_auto() Toggles the toon auto disenchanting any and all green armor/weapons inside its inventory or personal bank if opened
- mb_forceMovement = 1 If set to 1 it calls the mb_GoToPosition_Update() function in every onUpdate. Useful for bosses like Heigan so the player just sets a position with mb_GoToPosition_SetDestination(x, y, acceptedDistance, preventAutomaticMovementDisabling)
- mb_CheckStatCaps() Does the math which is required for the functions below.
- mb_PrintAllCaps() When called with /run it prints all stat caps (AP, Expertise, Hit and Defense) and the progress for all toons in chat. Requires init. Avoid toons in "free" mode when using this.
- mb_PrintHitCaps() When called with /run it prints all hit caps and the progress for all toons in chat. Requires init. Avoid toons in "free" mode when using this.
- mb_PrintFailedCaps() When called with /run it prints failed caps (hit+defense) and the progress for all toons in chat. Requires init. Avoid toons in "free" mode when using this.
- mb_FindMissingGems() Checks the gear on all toons for empty sockets and prompts in chat if any are found. Requires init. Avoid toons in "free" mode when using this. Also checks for missing eternal belt buckles on all toons as well as missing prismatic socket in hand and wrist items if the toon is a blacksmith.
- mb_FindMissingEnchants() Checks the gear on all toons for empty sockets and prompts in chat if any are found. Requires init. Avoid toons in "free" mode when using this. Also checks for missing ring enchants if the toon is an enchanter.
Community content is available under CC-BY-SA unless otherwise noted.