RynthSuite as of 2026-12-02 (internal 152e13d): release 2026.12.1.1

This commit is contained in:
Tom Bohar 2026-12-02 06:45:07 -05:00
commit 6b5a9c7e99
65 changed files with 3920 additions and 237 deletions

View file

@ -1405,6 +1405,32 @@ internal sealed partial class MetaManager
return true;
}
// /vt meta save <name> — the loaded meta saved under that name, which is then its file (2026-12-01
// command audit: it answered with the usage). /ra meta saveas: the same file again saves it, another
// existing one is refused (a command never replaces a file).
if (sub == "meta" && parts.Length >= 4 &&
parts[2].Equals("save", StringComparison.OrdinalIgnoreCase))
{
_raCommandHandler?.Invoke("/ra meta saveas " + string.Join(" ", parts, 3, parts.Length - 3));
return true;
}
// /vt loot save <name> — a copy of the loot profile in use under that name, then looted with (as
// VTank's save does; 2026-12-01 command audit). The profile in use itself is already saved.
if ((sub == "loot" || sub == "lootprofile" || sub == "looting") && parts.Length >= 4 &&
parts[2].Equals("save", StringComparison.OrdinalIgnoreCase))
{
string name = string.Join(" ", parts, 3, parts.Length - 3).Trim().Trim('"');
string current = _settings.CurrentLootPath ?? string.Empty;
if (current.Length > 0 && IsLootProfileNamed(current, name))
{
Reply.Ok($"[RynthAi] {Path.GetFileName(current)} is the loot profile in use; it is saved (the Loot Editor saves its changes).");
return true;
}
_raCommandHandler?.Invoke("/ra loot saveas " + name);
return true;
}
// /vt nav load <name> — load a nav route
// It used to store only the bare name as the nav path, so nothing loaded.
// /vt nav save <name> saves the current route under that name.
@ -1461,15 +1487,20 @@ internal sealed partial class MetaManager
return true;
}
// /vt settings loadchar|savechar <name> — RynthAi's settings profiles (/ra settings ...);
// universalremote.met switches profiles this way. Any other /vt settings verb is ignored.
// /vt settings loadchar|savechar|load|save <name> — RynthAi's settings profiles (/ra settings ...);
// universalremote.met switches profiles this way. VTank's load|save are its shared profiles and
// loadchar|savechar this character's; RynthAi's profiles are all the character's, so both pairs are
// the same here (load|save answered with the usage until the 2026-12-01 command audit).
if (sub == "settings")
{
if (parts.Length >= 4 && (parts[2].Equals("loadchar", StringComparison.OrdinalIgnoreCase)
|| parts[2].Equals("savechar", StringComparison.OrdinalIgnoreCase)))
_raCommandHandler?.Invoke($"/ra settings {parts[2].ToLowerInvariant()} {string.Join(" ", parts, 3, parts.Length - 3)}");
string verb = parts.Length >= 4 ? parts[2].ToLowerInvariant() : "";
if (verb is "loadchar" or "load") verb = "loadchar";
else if (verb is "savechar" or "save") verb = "savechar";
else verb = "";
if (verb.Length > 0)
_raCommandHandler?.Invoke($"/ra settings {verb} {string.Join(" ", parts, 3, parts.Length - 3)}");
else
Reply.Ignored("[RynthAi] Usage: /vt settings loadchar|savechar <name> (other /vt settings verbs are VTank's own; ignored).");
Reply.Ignored("[RynthAi] Usage: /vt settings load|save|loadchar|savechar <name> (other /vt settings verbs are VTank's own; ignored).");
return true;
}
@ -1515,19 +1546,58 @@ internal sealed partial class MetaManager
return true;
}
// /vt reverseroute — reverse the active nav route in place (shared settings;
// the engine re-reads CurrentRoute each tick, so the flip takes effect next tick).
// /vt reverseroute [true|false] — the route's direction (shared settings; the engine re-reads
// CurrentRoute each tick). VTank sets it from the argument: true = reversed, false = the file's own
// order, none = the other way. It flipped on every call before (2026-12-01 command audit: a meta
// sending "reverseroute true" on each state entry ran the route the wrong way every other time).
// A route newly loaded is the file's way round. /vt reverseroutequery says which way it is.
if (sub == "reverseroute")
{
var route = _settings.CurrentRoute;
if (route?.Points != null && route.Points.Count > 0)
if (route?.Points == null || route.Points.Count == 0)
{
Reply.Fail("[RynthAi] /vt reverseroute: no route is loaded.");
return true;
}
bool reversedNow = RouteReversed;
bool? asked = parts.Length >= 3 ? ParseVtBool(parts[2]) : null;
if (parts.Length >= 3 && asked == null)
{
Reply.Fail("[RynthAi] Usage: /vt reverseroute [true|false]");
return true;
}
bool want = asked ?? !reversedNow;
int n = route.Points.Count;
if (want != reversedNow)
{
int n = route.Points.Count;
route.Points.Reverse();
_settings.ActiveNavIndex = Math.Clamp(n - 1 - _settings.ActiveNavIndex, 0, n - 1);
Reply.Ok($"[RynthAi] Route reversed ({n} pts).");
}
else Reply.Fail("[RynthAi] /vt reverseroute: no route is loaded.");
_reversedRoute = route;
_routeReversed = want;
Reply.Ok(want == reversedNow
? $"[RynthAi] Route already {(want ? "reversed" : "in its own order")} ({n} pts)."
: $"[RynthAi] Route {(want ? "reversed" : "back in its own order")} ({n} pts).");
return true;
}
// /vt addnavjump <heading> <shift true|false> <milliseconds> [...]: a jump step at the end of the route
// (VTank's form), as /ra nav addjump does with a given heading (2026-12-01 command audit).
if (sub == "addnavjump")
{
if (parts.Length < 5
|| !float.TryParse(parts[2], System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out float jh)
|| ParseVtBool(parts[3]) is not bool jshift
|| !int.TryParse(parts[4], System.Globalization.NumberStyles.Integer, System.Globalization.CultureInfo.InvariantCulture, out int jms))
{
Reply.Fail("[RynthAi] Usage: /vt addnavjump <heading> <shift true|false> <milliseconds>");
return true;
}
_raCommandHandler?.Invoke(FormattableString.Invariant($"/ra nav addjump {Math.Clamp(jms, 0, 1000)}{(jshift ? " shift" : "")} heading {jh}"));
return true;
}
if (sub == "reverseroutequery")
{
Reply.Ok($"[RynthAi] Route reversed: {(RouteReversed ? "true" : "false")}.");
return true;
}
@ -1566,8 +1636,8 @@ internal sealed partial class MetaManager
/// <summary>The /vt verbs RynthAi takes, for the usage line.</summary>
internal const string VtVerbList = "opt set|get|list, <option> <value>, start, stop, e, jump, tapjump, equipitemsfor, "
+ "meta load, nav load|save, loot load, setmetastate, settings loadchar|savechar, setattackbar, forcebuff, "
+ "cancelforcebuff, cancelbuff, addnavpt, mexec, clearbusy, testitem, propertydump, reverseroute, echo";
+ "meta load|save, nav load|save, loot load|save, setmetastate, settings load|save|loadchar|savechar, setattackbar, forcebuff, "
+ "cancelforcebuff, cancelbuff, addnavpt, addnavjump, mexec, clearbusy, testitem, propertydump, reverseroute [true|false], reverseroutequery, echo";
/// <summary>The usage line for a /vt line RynthAi didn't take (an unknown verb or the wrong arguments).</summary>
internal static string VtUsageFor(string line)
@ -1577,9 +1647,9 @@ internal sealed partial class MetaManager
string? usage = verb switch
{
"opt" => "/vt opt set <option> <value> | /vt opt get <option> | /vt opt list",
"meta" => "/vt meta load <name>",
"meta" => "/vt meta load|save <name>",
"nav" => "/vt nav load <name> | /vt nav save <name>",
"loot" or "lootprofile" or "looting" => "/vt loot load <profile>",
"loot" or "lootprofile" or "looting" => "/vt loot load|save <profile>",
"setmetastate" => "/vt setmetastate <state>",
"equipitemsfor" => "/vt equipitemsfor <monster name>",
"setattackbar" => "/vt setattackbar <0 to 1>",
@ -1591,6 +1661,19 @@ internal sealed partial class MetaManager
: $"[RynthAi] Unknown /vt command{(verb.Length > 0 ? $" '{verb}'" : "")}. RynthAi takes: {VtVerbList}.";
}
/// <summary>
/// <paramref name="path"/> is the loot profile <paramref name="name"/> names: its file name, or its file
/// name without the extension (any case).
/// </summary>
internal static bool IsLootProfileNamed(string path, string name)
{
string n = name.Trim().Trim('"');
if (n.Length == 0) return false;
string file = Path.GetFileName(path);
return file.Equals(Path.GetFileName(n), StringComparison.OrdinalIgnoreCase)
|| Path.GetFileNameWithoutExtension(file).Equals(Path.GetFileName(n), StringComparison.OrdinalIgnoreCase);
}
/// <summary>The RynthAi setting a VTank option name maps to (EnableNav → EnableNavigation).</summary>
internal static bool TryMapVtOption(string vtName, out string raName)
{
@ -1633,8 +1716,13 @@ internal sealed partial class MetaManager
["lootnearbychests"] = "LootNearbyChests", // Settings > Looting > Loot Nearby Chests
["dooropenrange"] = "OpenDoorRange",
["autofellowmanagement"] = "AutoFellowMgmt",
["switchwandstodebuff"] = "UseDispelItems",
["lootonlyrarecorpses"] = "MineOnly",
// "SwitchWandToDebuff" (VTank: switch to the monster's wand even just to debuff it) was mapped here, as
// "switchwandstodebuff", to UseDispelItems: a meta setting it turned dispel items on (2026-12-01 command
// audit). RynthAi has no such switch; the option is kept for metas to read back, nothing else.
// VTank's Loot Only Rare Corpses is RynthAi's setting of that name (2026-11-22). It was mapped to
// MineOnly, a setting nothing reads, so a meta asking for rare corpses only looted every corpse
// (2026-12-01 command audit).
["lootonlyrarecorpses"] = "LootOnlyRareCorpses",
// Phase 1.2 VTank-meta migration aliases (targets verified in BuildSettingsMap)
["autocram"] = "EnableAutocram",
["autostack"] = "EnableAutostack",
@ -1674,6 +1762,15 @@ internal sealed partial class MetaManager
["rebufftimeremainingseconds"] = "RebuffSecondsRemaining", // VTank's spelling (the one above is a typo)
["petcustomrange"] = "CustomPetRange", // landblock units -> whole yards
["blacklistmonstertimeoutseconds"] = "BlacklistTimeoutSec",
// 2026-12-01 command audit: VTank options that were only stored though RynthAi has the same setting.
["corpeapproachrange-min"] = "CorpseApproachRangeMin", // VTank's own spelling in its option list
["blacklistmonsterattemptcount"] = "BlacklistAttempts", // misses (no damage) before a monster is blacklisted
["manachargeswhenoff"] = "ManaTapMacroOff", // stones keep worn gear filled with the macro off too
["manatankminimummana"] = "ManaTapMinMana", // an item must hold this much mana to be drained into a stone
// Fellow vitals (Recharge-Helper-*): RynthAi keeps these percents but doesn't heal others yet.
["recharge-helper-hitp"] = "HealOthersAt",
["recharge-helper-stam"] = "RestamOthersAt",
["recharge-helper-mana"] = "InfuseOthersAt",
};
/// <summary>VTank options given in landblock units (x240 = yards) whose RynthAi setting is yards.
@ -1682,6 +1779,7 @@ internal sealed partial class MetaManager
{
"attackdistance", "attackrange", "approachdistance", "dooropenrange", "opendoorrange", "ringdistance",
"corpseapproachrange", "corpseapproachrange-max", "corpseapproachrange-min", "petcustomrange",
"corpeapproachrange-min",
};
/// <summary>RynthAi distance settings kept in whole yards (their setter refuses a decimal).</summary>
@ -1715,12 +1813,28 @@ internal sealed partial class MetaManager
/// <summary>VTank options handled by <see cref="TrySetSpecialVtOption"/> (no 1:1 RynthAi setting).</summary>
private static bool IsSpecialVtOption(string vtName) => vtName.ToLowerInvariant() is
"defaultmeleeattackheight" or "lootfellowcorpses" or "lootallcorpses" or "usearcs" or "minimumhealkitsuccesschance"
or "autoattackpower";
or "autoattackpower" or "targetselectmethod" or "debuffeachfirst";
// The last /vt setattackbar power (percent), for AutoAttackPower false after it was on (-1 = none yet).
private int _lastAttackBarPct = -1;
private bool _deleteMonsterLogged;
// /vt reverseroute: the route the direction was set for, and whether it runs reversed. Another
// route loaded (a new object) is in its own order.
private NavRouteParser? _reversedRoute;
private bool _routeReversed;
/// <summary>The loaded route runs reversed (set by /vt reverseroute; a new route starts in its own order).</summary>
internal bool RouteReversed => _routeReversed && ReferenceEquals(_reversedRoute, _settings.CurrentRoute);
/// <summary>true/false, on/off, 1/0, yes/no (any case); null for anything else.</summary>
private static bool? ParseVtBool(string s) => s.Trim().ToLowerInvariant() switch
{
"true" or "on" or "1" or "yes" => true,
"false" or "off" or "0" or "no" => false,
_ => null,
};
/// <summary>
/// The VTank options whose value means something else in RynthAi:
/// DefaultMeleeAttackHeight 1-3 (low/medium/high) is RynthAi's 0-2; LootFellowCorpses /
@ -1756,6 +1870,22 @@ internal sealed partial class MetaManager
if (!num) return true;
_settings.KitMinSuccessPct = Math.Clamp((int)Math.Round(n > 0 && n <= 1 ? n * 100 : n), 0, 100);
return true;
case "targetselectmethod":
// VTank 1 By Range, 2 By Angle, 3 Both (near by angle, far by range). RynthAi's Targeting has
// Closest (1) and Least turning (3); it has no "both", so 3 is only kept (2026-12-01 command audit).
if (!num) return true;
Expressions.SetOption("TargetSelectMethod", value);
if ((int)Math.Round(n) == 1) _settings.TargetSelection = 1;
else if ((int)Math.Round(n) == 2) _settings.TargetSelection = 3;
return true;
case "debuffeachfirst":
// VTank 1 One (debuff one, attack it), 2 Priority (debuff the same priority first), 3 All. RynthAi's
// Debuff every monster in range before attacking is All on, One off; Priority is only kept.
if (!num) return true;
Expressions.SetOption("DebuffEachFirst", value);
if ((int)Math.Round(n) == 1) _settings.DebuffAllBeforeAttacking = false;
else if ((int)Math.Round(n) == 3) _settings.DebuffAllBeforeAttacking = true;
return true;
case "autoattackpower":
// On: RynthAi picks the power itself (-1, its "auto"). Off: the attack bar's value,
// the last /vt setattackbar (a power already set by hand stays as it is).
@ -1786,9 +1916,19 @@ internal sealed partial class MetaManager
"usearcs" => _settings.UseArcs ? "true" : "false",
"minimumhealkitsuccesschance" => _settings.KitMinSuccessPct.ToString(System.Globalization.CultureInfo.InvariantCulture),
"autoattackpower" => _settings.MeleeAttackPower < 0 ? "true" : "false",
// RynthAi's Targeting as VTank's number; another RynthAi choice reads the value a meta last set.
"targetselectmethod" => _settings.TargetSelection switch { 1 => "1", 3 => "2", _ => StoredVtOption("TargetSelectMethod") },
"debuffeachfirst" => _settings.DebuffAllBeforeAttacking ? "3" : StoredVtOption("DebuffEachFirst") == "2" ? "2" : "1",
_ => null,
};
/// <summary>A VTank option a meta set that is only kept, or null when none was.</summary>
private string? StoredVtOption(string name)
{
string v = Expressions.GetOption(name);
return v.Length == 0 || v == "0" ? null : v;
}
/// <summary>A VTank option's current value (mapped setting, else a stored generic option).</summary>
private string? GetVtOption(string vtName)
{