babalae/better-genshin-impact · error · ArgumentException

moveby方法必须有两个入参,分别是x和y。例:moveby(100, 100)

Error message

moveby方法必须有两个入参,分别是x和y。例:moveby(100, 100)

What it means

Error "moveby方法必须有两个入参,分别是x和y。例:moveby(100, 100)" thrown in babalae/better-genshin-impact.

Source

Thrown at BetterGenshinImpact/GameTask/AutoFight/Script/CombatCommand.cs:278

            {
                avatar.Click(Args![0]);
            }
            else
            {
                avatar.Click();
            }
        }
        else if (Method == Method.MoveBy)
        {
            if (Args is { Count: 2 })
            {
                var x = int.Parse(Args![0]);
                var y = int.Parse(Args[1]);
                avatar.MoveBy(x, y);
            }
            else
            {
                throw new ArgumentException("moveby方法必须有两个入参,分别是x和y。例:moveby(100, 100)");
            }
        }
        else if (Method == Method.KeyDown)
        {
            avatar.KeyDown(Args![0]);
        }
        else if (Method == Method.KeyUp)
        {
            avatar.KeyUp(Args![0]);
            TryTriggerESkillCdCheck(avatar, Args![0]);
        }
        else if (Method == Method.KeyPress)
        {
            avatar.KeyPress(Args![0]);
            TryTriggerESkillCdCheck(avatar, Args![0]);
        }
        else if (Method == Method.Scroll)
        {

View on GitHub (pinned to a7cb36712d)

Solutions

  1. 按照 moveby(x, y) 格式提供两个数值入参,例如 moveby(100, 100)
  2. 检查脚本中该指令是否缺少逗号或括号

Example fix

改为 moveby(100, 100) 形式,提供x和y两个整数参数。

When it happens

Trigger: 执行 moveby 指令时参数个数不是2(缺x或y),在校验或执行阶段抛出。

Common situations: 脚本写成 moveby(100) 或参数被误删,未按 moveby(x, y) 格式书写。


AI-assisted analysis of babalae/better-genshin-impact@a7cb36712d (2026-08-13). Data as JSON: /api/errors/99d4fcb08a0c6060. Report an issue: GitHub.