机器人

From Minecraft Parkour Wiki
Revision as of 05:37, 31 August 2022 by Pjx1314 (talk | contribs) (Created page with "=== 范例: ===")
Other languages:

MCPK 机器人是一个致力于取代 MathBot 来计算运动的 Discord 机器人。实际上,一直重新定义函数越来越令人厌烦,而且语法使用起来也不太方便。MathBot 作为通用计算工具仍然非常有用。

相对于 Mathbot 的优点

  • 更充实且更具描述性的输出
  • 内置了函数:不需要手动重定义它们。
  • 机器人使用浮点数运算而不是分数,因此模拟更精确。
  • 对于模拟运动:
    • X 和 Z 运动都被考虑在内,并计入了动量阈值。
    • 操作是从左到右读取的,读写起来更方便。
    • 所有操作都有方向这一可选参数。



距离

%distance <X> [Z]

返回 X 乘 Z 跳跃的真距(以方块为距离单位,Z 方向为可选变量)

公式就是简单的


范例:

  • 4b 跳跃:%distance 4
  • 3x3 跳跃:%distance 3 3



滞空时间

%duration <跳跃高度> [天花板高度]

对于给定的高度,返回一个跳跃的滞空时间(高度以方块为单位,天花板高度为可选变量)


范例:

  • -1.5b 跳跃:%duration -1.5
  • 3bc +1 跳跃:%duration 1 3




Height

%height <jumpTicks> [ceilingHeight]

Returns the jump height of the player after n ticks (ceilingHeight is optional)


Examples:

  • 12t jump: %height 12
  • 2bc 9t jump: %height 9 2



Blip

%blip <repetitions> [initialHeight] [blipHeight] [lastJumpTicks]

Returns the height of the player after chaining consecutive blips (Y=0 is the bottom surface by convention).

  • <repetitions> is the number of chained blips performed
  • [initialHeight] is the player's initial height before the first jump (default: 0.0)
  • [BlipHeight] is the height of the blip's top surface (e.g. 0.0625 for carpet, 0.1875 for trapdoor...)
  • Unless specified with [lastJumpTicks], returns the peak of the jump by default (6 ticks).


Examples:

  • starting from Y=200: %blip 4
  • 17 chained blips on lilypad: %blip_top 17 0.015625



Simulate

%simulate <actions> (or simply %<actions>)

Reads the given actions from left to right, and simulates the resulting movement.


操作:

操作拥有两个变量:

  • 刻:操作的持续时间,以刻为单位
  • 方向(可选):操作的方向(不是 facing),以度为单位
操作 介绍
stop, stop_air 无输入
sneak, sneak_air 潜行
sneak45, sneak45_air 带有 45°斜跑的潜行
sneaksprint,

sneaksprint_air

带有疾跑的潜行(用于 1.14+,or for sprint delay in air)
sneaksprint45,

sneaksprint45_air

Sneak with sprint (used for 1.14+, or for sprint delay in air)
walk, walk_air 行走
walk45, walk45_air 带有 45°斜跑的行走
sprint, sprint_air 疾跑
sprint45, sprint45_air 带有 45°斜跑的疾跑
stopjump 无移动跳跃
walkjump 无疾跑跳跃
walkjump45 无疾跑跳跃,在跳跃期间使用 45°斜跑
Lwalkjump

Rwalkjump

无疾跑跳跃,在跳跃后的第一 tick 向左(Left)或右(Right)斜跑斜跑。
sprintjump 疾跑跳跃
sprintjump45 疾跑跳跃,在跳跃期间使用 45°斜跑
Lsprintjump

Rsprintjump

疾跑跳跃,在跳跃后的第一 tick 向左(Left)或右(Right)斜跑。

范例:用于 rex bwmm

Lsprintjump45

Rsprintjump45

疾跑跳跃,在跳跃期间向左(Left)或右(Right)斜跑斜跑。

范例:用于 1bm 5-1

Add "max_" in front to get the maximum momentum with that action (repeats the action 20 times)


Special Tokens:

  • Momentum, MM, and | sets the previous actions as momentum (resets the position minus the last tick)
  • Blocks and b convert the output landing distance to blocks (± 0.6 to X and Z if nonzero)
  • Meters, and m convert the output landing distance to meters (same values as default)
  • Position, pos, and p convert the output to a relative position (used when you're not calculating jump distance)



Usage:

The parser reads the actions and tokens from left to right. Actions and tokens should be separated by spaces.

The Momentum token can be used anywhere between two actions.

The Blocks, Meters, and Position tokens are to be used at the end of the sequence (mutually exclusive).



范例:

  • 延立:% sprint | sprintjump(12)
  • rex bwmm:% walkjump(12,180) walk(1,180) Lsprintjump(12) | sprintjump(12)
  • 1bm 5-1:% walkjump45(12,170) walk45(1,170) Lsprintjump45(1,-10) sprint45_air(11) |