Table of Contents

Method InteractWith

Namespace
GrindFest
Assembly
GrindFest.dll

InteractWith(InteractiveBehaviour)

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

public bool InteractWith(InteractiveBehaviour interactive)

Parameters

interactive InteractiveBehaviour

The interactive object to interact with

Returns

bool

True if the interaction was successful, false if still moving towards the object

Remarks

This method handles both movement and interaction with game objects that implement InteractiveBehaviour. Common interactable objects include:

  • Chests - Contains loot and equipment
  • Shrines - Provides temporary buffs
  • NPCs - Trading and dialogue

The method will:

  1. Move the hero within interaction range if needed
  2. Trigger the same interaction that occurs when a player double-clicks the object
  3. Handle any resulting inventory changes or effects
Basic chest looting:
var chest = FindNearestInteractive("Chest");
if (chest != null)
{
    if (InteractWith(chest))
    {
        Say("Found and opened a chest!");
    }
}
Shrine buff hunting:
// Find and use shrines while exploring
if (!RunAroundInAreaAnd(() => {
    var shrine = FindNearestInteractive("Shrine");
    if (shrine != null)
    {
        return InteractWith(shrine);
    }
    return false;
}))
{
    Say("No shrines found, keep looking...");
}