-
Notifications
You must be signed in to change notification settings - Fork 440
Scripting
exiler25 edited this page Dec 17, 2025
·
1 revision
//MCCScript 1.0 /* This script searches for the Armor Stand ID and auto-feeds minions using '/entity near #ID use'. */
using System.Text.RegularExpressions;
class EntityFeedScript : ChatBot { // Regex pattern for Armor Stand extraction private readonly Regex armorStandRegex = new Regex(@"#(\d+): Type: Armor Stand,", RegexOptions.Compiled);
// Variable to store the target entity ID
private string targetEntityId = "";
public override void Initialize()
{
// Log initialization status
LogToConsole("EntityFeedScript initialized. Type '/entity armor list' to extract Armor Stand ID.");
}
public override void OnChatMessage(string message, string sender)
{
// Check if the message contains Armor Stand information
if (message.Contains("Type: Armor Stand"))
{
Match match = armorStandRegex.Match(message);
if (match.Success)
{
targetEntityId = match.Groups[1].Value; // Extract the ID
LogToConsole($"Target entity set to: #{targetEntityId}");
}
}
}
public override void Update()
{
// Execute the '/entity near #ID use' command periodically if target ID is available
if (!string.IsNullOrEmpty(targetEntityId))
{
SendText($"/entity near #{targetEntityId} use");
LogToConsole($"Command sent: /entity near #{targetEntityId} use");
}
}
}