Table of Contents

Class Hero

Namespace
GrindFest
Assembly
GrindFest.dll
public static class Hero
Inheritance
object
Hero

Properties

Character
CurrentArea
Dexterity
Equipment

Access the hero's equipment to check what items are equipped or equip/unequip items

Health
Intelligence
Inventory

Gets all items in the hero's inventory as an enumerable collection.

Level
MaxHealth
Party
SelectedHero
SkillPoints
Skills
StatPoints
Strength

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.

FindNearestItem(string, string, string, float)
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.

Follow(GameObject, float)
FollowCursorAndAttack()

Makes your hero follow your mouse cursor and attack nearest enemies in a way

FollowFlags(Color)

Follow the flags of a certain color

GetFlagsByColor(Color)
GetRandomPointInArea()
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.

HasHealthPotion()
HasManaPotion()
HealthPotionCount()
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 becomes Hero.CurrentArea?.Root.Name and GoToArea("Stony Plains") becomes Hero.GoToArea("Stony Plains").

InteractWith(InteractiveBehaviour)

Makes the hero move to and interact with an interactive object like a chest, shrine, or NPC.

LookAt(InteractiveBehaviour)
OnEnterArea(AreaBehaviour)
OnHear(SpeechBehaviour, string)
OnSay(string, Transform)
OpenInventory()
PickUp(ItemBehaviour)

Pick up an item, moving to it if necessary

ResetFlags()
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.

RunInDirection(Direction)
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.

StopMoving()
StopRunningAround()