Class Hero
- Namespace
- GrindFest
- Assembly
- GrindFest.dll
public static class Hero
- Inheritance
-
objectHero
Properties
- Equipment
Access the hero's equipment to check what items are equipped or equip/unequip items
- Inventory
Gets all items in the hero's inventory as an enumerable collection.
Methods
- AttackNearestEnemy(float)
Attacks the nearest enemy within range using the hero's basic attack skill.
- BuyStat(Stat, int)
Spends available stat points to increase a specific stat.
- DrinkHealthPotion()
Start drinking a health potion if the hero has one
- Equip(ItemBehaviour)
Equips an item, automatically picking it up from the ground if needed. Useful for gear management and automatic equipment upgrades.
- FindItemInInventory(string, bool)
Finds an item in the inventory by name
- FindItemsOnGround(string, string, string, float)
Returns a list of all items on the ground within range that match the specified name criteria.
- FindNearestEnemy(float, float)
Finds the nearest hostile enemy within range that the hero can reach.
- FindNearestInteractive(Predicate<InteractiveBehaviour>, float)
Finds the nearest interactive object (like chests or shrines) that matches the name criteria.
- FindNearestInteractive(string, string, string, float)
Finds the nearest interactive object (like chests or shrines) that matches the name criteria.
- FindNearestItemOnGround(Predicate<ItemBehaviour>, float)
Finds the nearest item on the ground that matches the specified name criteria.
- FindNearestItemOnGround(string, string, string, float)
Finds the nearest item on the ground that matches the specified name criteria.
- FollowCursorAndAttack()
Makes your hero follow your mouse cursor and attack nearest enemies in a way
- FollowFlags(Color)
Follow the flags of a certain color
- GoTo(Vector3, float)
Moves the hero to a specific position in the world.
- GoToAnd(Vector3, float, Func<bool>)
Moves to a position while performing an action.
- GoToAndAttack(Vector3, float)
Moves to a position while attacking any enemies that come within range.
- GoToArea(string)
Makes the hero navigate to a specific area in the game world.
- Idle(string)
A simple bot that handles basic combat, looting, and survival in a specified area. Call this method repeatedly to make your hero automatically fight and survive.
Copying the source code of this method to your own script is a good starting point for creating your own bot. Remember that this method is implemented inside the AutomaticHero class. If you are not using classes but a single script with top-level methods, you need to use Hero static class that is representing your currently selected hero. And prefix all methods calls and properties with Hero. like this:
CurrentArea?.Root.Name
becomesHero.CurrentArea?.Root.Name
andGoToArea("Stony Plains")
becomesHero.GoToArea("Stony Plains")
.
- InteractWith(InteractiveBehaviour)
Makes the hero move to and interact with an interactive object like a chest, shrine, or NPC.
- PickUp(ItemBehaviour)
Pick up an item, moving to it if necessary
- RunAroundInArea()
Makes the hero run around randomly within the current area.
- RunAroundInAreaAnd(Func<bool>)
Makes the hero run around in the current area while performing an action.
- RunAroundInAreaAndAttack()
Makes your hero run around and attack enemies in the area automatically.
- RunAwayFromNearestEnemy(float)
Makes the hero run away from the nearest enemy.
- Say(string)
Makes the hero say something. Useful for debugging, casting spells, and giving commands.
- SayTo(string, Transform)
Makes the hero say something to a specific target. Essential for targeted spells and commands.