Jump to content
bbh_blocked_dnftl
Automation Vault

Combat API


MrFade

Recommended Posts

  • Vault Administrator
SkullToxin
This post was recognized by SkullToxin!

MrFade was awarded the badge 'Helpful' and 5 points.

Test

// Amount of milliseconds since the bot last attempted an action
public long LastAction;

// Amount of milliseconds the bot has been in combat
public long TimeInCombat;

// Amount of milliseconds the bot has been out of combat.
public long TimeOutOfCombat;

// Local Player Unit
public LocalPlayer Player;

// Player's pet unit. Null if no pet exists.
public GameUnit Pet;

// Players targeted unit. Null if no target exists.
public GameUnit Target;

// Players last targeted unit. Null if no last target exists.
public GameUnit LastTarget;

// Get the amount of npc/player units around the local player.
// MaxRange => Default 10. Maximum distance of unit allowed.
// NotDead => Default True. Don't count dead units, or ghost players.
public uint UnitsNearMe(double MaxRange, bool NotDead);

// Get amount of Npc/Player units in combat, and targeting the player.
public uint UnitsAttackingMe();

// Get amount of Npc/Player units targeting the local player
public uint UnitsTargetingMe();

// Check if player can cast a spell by the Spell ID
// IsCasting => Default true. Check will return false if player is casting or channelling
// Unit => Default null. If input unit is not null, check if unit is within spell info Min/Max range.
public bool CanCast(uint SpellID, bool Casting, GameUnit Unit, float MaxRange = 5.5f);
public bool CanCast(string Name, bool Casting = false, GameUnit U = null, float MaxRange = 5.5f);

public bool HasSpell(uint SpellID);
public bool HasSpell(string Name);
public bool HasSpell(string Name, int Rank);

public long SpellCooldown(uint SpellID);
public long SpellCooldown(string Name);

public bool SpellInRange(uint SpellID, GameUnit u, float MaxRange = 5.5f);
public bool SpellInRange(string Name, GameUnit u, float MaxRange = 5.5f);

These are the open calls to gather basic item information.

// Checks if the player currently has an item by name or item id.
// BagOnly => If true will only look in the players backpack and bag slots, else will include bank items as well.
// BagOnly defaults to TRUE, and does NOT need to be included in calls unless setting as false.
public bool HasItem(string Name, bool BagOnly = true);
public bool HasItem(uint ItemID, bool BagOnly = true);
// Example: WoW.HasItem("Soul Shard") And/Or WoW.HasItem(2770, false);

// Checks if an item is currently on cooldown by name or item id.
// CheckSpell => Will check cooldown for the associated spell id of an item
// CheckSpell defaults to FALSE, and does NOT need to be included in calls unless setting as true.
public long ItemCooldown(uint ItemID, bool CheckSpell = false);
public long ItemCooldown(string Name, bool CheckSpell = false);
// Example: WoW.ItemCooldown("Health Potion") And/Or WoW.ItemCooldown("Hearthstone", true);

// Checks if an item is currently in range of input unit.
public bool ItemInRange(uint ItemID, GameUnit u, float MaxRange = 5.5f);
public bool ItemInRange(string Name, GameUnit u, float MaxRange = 5.5f);

Generic calls to use Spell, items, macros and in game commands.

// Attempt to cast a spell by either name or spell id.
public bool Cast(string Name);
public bool Cast(uint SpellID);

// Attempt to use an item by either name or spell id.
public bool Use(string Name);
public bool Use(uint ItemID);

// Attempt to use an in game macro. 
// The macro MUST be bound to a handled key (Numpad would be best)
public bool Trigger(string Name);

// Attempt to send a wow command in game.
// The command MUST be bound to an accepted key first.
// Commands can be found: https://wowpedia.fandom.com/wiki/BindingID
public bool Send(string Name);

// All return true if the action binding has been found, and it registered an attempted keypress. False otherwise.

Some wow commands are auto bound by ReBinder. 

// Used to dismount if player is mounted.
public bool Dismount();

// Used to start player auto attack
public bool StartAttack();

// Used to start players pet attack
public bool StartPetAttack();

// Will stop using Shoot/Attack.
public bool StopAttack();

// Used to stop casting the players current spell
public bool StopCasting();

// Used to target your targets target
public bool AssistTarget();

// Used to target the player
public bool TargetSelf();

// Used to target the players pet
public bool TargetPet();

// These last four do exactly as they say
public bool TargetLastTarget();
public bool TargetNearestEnemy();
public bool TargetNearestFriendly();
public bool TargetLastEnemy();

// All these calls just call WoW.Send("COMMAND"); internally, and are just here to provide simple access.
// These calls will return whatever WoW.Send("COMMAND"); calls. See above for more info.
Edited by SkullToxin
Link to comment
Share on other sites

×
×
  • Create New...