Bot/zh: Difference between revisions
Content added Content deleted
(Created page with "== 滞空时间 ==") |
(Created page with "MCPK-bot 是一款 Discord 机器人,旨在取代 MathBot 进行运动计算。事实上,一直重新定义函数让人厌烦,而且语法使用起来也不太方便。MathBot 作为一种通用计算工具仍然非常有用。") |
||
(39 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<languages/> |
<languages/> |
||
__NOTOC__ |
__NOTOC__ |
||
MCPK Bot 当前不可用,请转用 Mothball |
|||
MCPK 机器人是一个致力于取代 MathBot 来计算运动的 Discord 机器人。实际上,一直重新定义函数越来越令人厌烦,而且语法使用起来也不太方便。MathBot 作为通用计算工具仍然非常有用。 |
|||
([https://github.com/CyrenArkade/mothball 自述文件])。 |
|||
MCPK-bot 是一款 Discord 机器人,旨在取代 MathBot 进行运动计算。事实上,一直重新定义函数让人厌烦,而且语法使用起来也不太方便。MathBot 作为一种通用计算工具仍然非常有用。 |
|||
相对于 Mathbot 的'''优点''': |
相对于 Mathbot 的'''优点''': |
||
Line 16: | Line 21: | ||
<span id="Distance"></span> |
|||
== 距离 == |
== 距离 == |
||
'''%distance''' <X> ''[Z]'' |
'''%distance''' <X> ''[Z]'' |
||
返回 X 乘 Z 跳跃的真距(以方块为距离单位,Z 方向可选) |
返回 X 乘 Z 跳跃的真距(以方块为距离单位,Z 方向为可选变量) |
||
公式就是简单的 <math>\sqrt{max(0,X-0.6)^2 + max(0,Z-0.6)^2}</math> |
公式就是简单的 <math>\sqrt{max(0,X-0.6)^2 + max(0,Z-0.6)^2}</math> |
||
Line 26: | Line 32: | ||
<span id="Examples:"></span> |
|||
==== 范例: ==== |
==== 范例: ==== |
||
Line 35: | Line 42: | ||
<span id="Duration"></span> |
|||
== 滞空时间 == |
== 滞空时间 == |
||
'''%duration''' <跳跃高度> ''[天花板高度]'' |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
'''%duration''' <jumpHeight> ''[ceilingHeight]'' |
|||
</div> |
|||
对于给定的高度,返回一个跳跃的滞空时间(高度以方块为单位,天花板高度为可选变量) |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
Returns the duration of a jump with the given height (heights in blocks, ceilingHeight is optional) |
|||
</div> |
|||
<span id="Examples:"></span> |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
==== |
==== 范例: ==== |
||
</div> |
|||
* -1.5b 跳跃:%duration -1.5 |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
* |
* 3bc +1 跳跃:%duration 1 3 |
||
* 3bc +1 jump: %duration 1 3 |
|||
</div> |
|||
Line 61: | Line 62: | ||
<span id="Height"></span> |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
== |
== 高度 == |
||
</div> |
|||
'''%height''' <起跳 Tick 数> ''[天花板高度]'' |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
'''%height''' <jumpTicks> ''[ceilingHeight]'' |
|||
</div> |
|||
返回玩家 n ticks 后的起跳高度(天花板高度可选填) |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
Returns the jump height of the player after n ticks (ceilingHeight is optional) |
|||
</div> |
|||
<span id="Examples:"></span> |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
==== |
==== 范例: ==== |
||
</div> |
|||
* 12t 跳跃:%height 12 |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
* |
* 2bc 9t 跳跃:%height 9 2 |
||
* 2bc 9t jump: %height 9 2 |
|||
</div> |
|||
Line 88: | Line 81: | ||
<span id="Blip"></span> |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
== |
== 卡角 == |
||
</div> |
|||
'''%blip''' <重复次数> ''[初始高度]'' ''[卡角高度] [最后跳跃 Tick 数]'' |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
'''%blip''' <repetitions> ''[initialHeight]'' ''[blipHeight] [lastJumpTicks]'' |
|||
</div> |
|||
返回连续卡角后玩家的高度(按惯例,Y=0 作为地面) |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
Returns the height of the player after chaining consecutive blips (Y=0 is the bottom surface by convention). |
|||
</div> |
|||
* <重复次数> 为连续卡角的次数 |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
* [初始高度] 是玩家第一次起跳前的初始高度(默认:0.0) |
|||
* <repetitions> is the number of chained blips performed |
|||
* [卡角高度] 是卡角所用平面的高度(例如:地毯为 0.0625,活板门为 0.1875……) |
|||
* [initialHeight] is the player's initial height before the first jump (default: 0.0) |
|||
* 除非指定了 [最后跳跃 Tick 数],否则按照默认值(6 tick)来返回跳跃的最高高度。 |
|||
* [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). |
|||
</div> |
|||
<span id="Examples:"></span> |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
==== |
==== 范例: ==== |
||
</div> |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
* starting from Y=200: %blip 4 |
* starting from Y=200: %blip 4 |
||
* 17 |
* 荷叶 17 连卡角:%blip_top 17 0.015625 |
||
</div> |
|||
Line 122: | Line 105: | ||
<span id="Simulate"></span> |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
== |
== 模拟 == |
||
</div> |
|||
'''%simulate''' <操作>(或仅输入 '''%'''<操作>) |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
'''%simulate''' <actions> (or simply '''%'''<actions>) |
|||
</div> |
|||
从左到右读取给出的操作,并模拟运动的结果。 |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
Reads the given actions from left to right, and simulates the resulting movement. |
|||
</div> |
|||
<span id="Actions:"></span> |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
=== |
=== 操作: === |
||
</div> |
|||
操作拥有两个变量: |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
* 刻:操作的持续时间,以刻为单位 |
|||
Actions take two arguments: |
|||
* 方向(可选):操作的方向(不是 facing),以度为单位 |
|||
* Ticks : the duration of the action, in ticks |
|||
* Direction (optional) : the direction (not facing) of the action, in degrees |
|||
{| class="wikitable" |
{| class="wikitable" |
||
!操作 |
|||
!Action |
|||
!介绍 |
|||
!Description |
|||
|- |
|- |
||
|stop, stop_air |
|stop, stop_air |
||
|无输入 |
|||
|No input |
|||
|- |
|- |
||
|sneak, sneak_air |
|sneak, sneak_air |
||
|潜行 |
|||
|Sneak |
|||
|- |
|- |
||
|sneak45, sneak45_air |
|sneak45, sneak45_air |
||
|带有 45°斜跑的潜行 |
|||
|Sneak with 45° strafe |
|||
|- |
|- |
||
|sneaksprint, |
|sneaksprint, |
||
sneaksprint_air |
sneaksprint_air |
||
| |
|带有疾跑的潜行(用于 1.14+,or for sprint delay in air) |
||
|- |
|- |
||
|sneaksprint45, |
|sneaksprint45, |
||
Line 166: | Line 142: | ||
|- |
|- |
||
|walk, walk_air |
|walk, walk_air |
||
|行走 |
|||
|Walk |
|||
|- |
|- |
||
|walk45, walk45_air |
|walk45, walk45_air |
||
|带有 45°斜跑的行走 |
|||
|Walk with 45° strafe |
|||
|- |
|- |
||
|sprint, sprint_air |
|sprint, sprint_air |
||
|疾跑 |
|||
|Sprint |
|||
|- |
|- |
||
|sprint45, sprint45_air |
|sprint45, sprint45_air |
||
|带有 45°斜跑的疾跑 |
|||
|Sprint with 45° strafe |
|||
|- |
|- |
||
|stopjump |
|stopjump |
||
|无移动跳跃 |
|||
|Jump without moving |
|||
|- |
|- |
||
|walkjump |
|walkjump |
||
|无疾跑跳跃 |
|||
|Jump without sprinting |
|||
|- |
|- |
||
|walkjump45 |
|walkjump45 |
||
|无疾跑跳跃,在跳跃期间使用 45°斜跑 |
|||
|Jump without sprinting, 45° strafe throughout the jump |
|||
|- |
|- |
||
|Lwalkjump |
|Lwalkjump |
||
Rwalkjump |
Rwalkjump |
||
|无疾跑跳跃,在跳跃的 tick 向左('''L'''eft)或右('''R'''ight)斜键。 |
|||
|Jump without sprinting, strafe '''L'''eft or '''R'''ight on the first tick. |
|||
|- |
|- |
||
|sprintjump |
|sprintjump |
||
|疾跑跳跃 |
|||
|Sprintjump |
|||
|- |
|- |
||
|sprintjump45 |
|sprintjump45 |
||
|疾跑跳跃,在跳跃期间使用 45°斜跑 |
|||
|Sprintjump forward, start 45° strafe after the first tick |
|||
|- |
|- |
||
|Lsprintjump |
|Lsprintjump |
||
Rsprintjump |
Rsprintjump |
||
|疾跑跳跃,在跳跃的 tick 向左('''L'''eft)或右('''R'''ight)斜键。 |
|||
|Strafe '''L'''eft or '''R'''ight on the first tick of a sprintjump. |
|||
范例:用于 rex bwmm |
|||
|- |
|- |
||
|Lsprintjump45 |
|Lsprintjump45 |
||
Rsprintjump45 |
Rsprintjump45 |
||
|疾跑跳跃,在跳跃期间向左('''L'''eft)或右('''R'''ight)斜跑。 |
|||
|Strafe '''L'''eft or '''R'''ight throughout a sprintjump. |
|||
范例:用于 1bm 5-1 |
|||
|} |
|} |
||
</div> |
|||
在操作前添加“max_”以获得该操作的最大加速(将该操作重复 20 次) |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
Add "max_" in front to get the maximum momentum with that action (repeats the action 20 times) |
|||
</div> |
|||
<span id="Special_Tokens:"></span> |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
=== |
=== 特殊符号: === |
||
</div> |
|||
* '''Momentum''','''MM''',以及 '''|''' 将当前的操作设置为助跑(在最后一 tick 重置位置的负值) |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
* '''Momentum''', '''MM''', and '''|''' sets the previous actions as momentum (resets the position minus the last tick) |
|||
</div> |
|||
* '''Blocks''',和 '''b''' 将输出的落地距离转换成方块(如果不为零,在 X 和 Z 轴上 ± 0.6) |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
* '''Blocks''' and '''b''' convert the output landing distance to blocks (± 0.6 to X and Z if nonzero) |
|||
</div> |
|||
* '''Meters''',和 '''m''' 将输出的落地距离转换成米(默认值) |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
* '''Meters''', and '''m''' convert the output landing distance to meters (same values as default) |
|||
</div> |
|||
* '''Position''','''pos''',以及 '''p''' 将输出转换为相对位置(当你不在计算跳跃距离时使用) |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
* '''Position''', '''pos''', and '''p''' convert the output to a relative position (used when you're not calculating jump distance) |
|||
</div> |
|||
<span id="Usage:"></span> |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
=== |
=== 用法: === |
||
</div> |
|||
语法分析器从左向右读取操作和记号。所有的操作和记号应当用空格分隔。 |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
The parser reads the actions and tokens from left to right. Actions and tokens should be separated by spaces. |
|||
</div> |
|||
'''Momentum''' 记号可以置于任意两个操作之间。 |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
The '''Momentum''' token can be used anywhere between two actions. |
|||
</div> |
|||
'''Blocks''','''Meters''' 与 '''Position''' 记号置于语句末尾(不可同时使用)。 |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
The '''Blocks''', '''Meters''', and '''Position''' tokens are to be used at the end of the sequence (mutually exclusive). |
|||
</div> |
|||
<span id="Examples:"></span> |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
=== |
=== 范例: === |
||
</div> |
|||
* 延立:% sprint | sprintjump(12) |
|||
<div lang="en" dir="ltr" class="mw-content-ltr"> |
|||
* |
* 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) | |
||
* 1bm 5-1: % walkjump45(12,170) walk45(1,170) Lsprintjump45(1,-10) sprint45_air(11) | sprintjump45(14) b |
|||
</div> |
Latest revision as of 04:56, 16 August 2023
MCPK Bot 當前不可用,請轉用 Mothball (自述文件)。
MCPK-bot 是一款 Discord 機器人,旨在取代 MathBot 進行運動計算。事實上,一直重新定義函數讓人厭煩,而且語法使用起來也不太方便。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 <起跳 Tick 數> [天花板高度]
返回玩家 n ticks 後的起跳高度(天花板高度可選填)
範例:
- 12t 跳躍:%height 12
- 2bc 9t 跳躍:%height 9 2
卡角
%blip <重複次數> [初始高度] [卡角高度] [最後跳躍 Tick 數]
返回連續卡角後玩家的高度(按慣例,Y=0 作為地面)
- <重複次數> 為連續卡角的次數
- [初始高度] 是玩家第一次起跳前的初始高度(默認:0.0)
- [卡角高度] 是卡角所用平面的高度(例如:地毯為 0.0625,活板門為 0.1875……)
- 除非指定了 [最後跳躍 Tick 數],否則按照默認值(6 tick)來返回跳躍的最高高度。
範例:
- starting from Y=200: %blip 4
- 荷葉 17 連卡角:%blip_top 17 0.015625
模擬
%simulate <操作>(或僅輸入 %<操作>)
從左到右讀取給出的操作,並模擬運動的結果。
操作:
操作擁有兩個變量:
- 刻:操作的持續時間,以刻為單位
- 方向(可選):操作的方向(不是 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 |
在操作前添加「max_」以獲得該操作的最大加速(將該操作重複 20 次)
特殊符號:
- Momentum,MM,以及 | 將當前的操作設置為助跑(在最後一 tick 重置位置的負值)
- Blocks,和 b 將輸出的落地距離轉換成方塊(如果不為零,在 X 和 Z 軸上 ± 0.6)
- Meters,和 m 將輸出的落地距離轉換成米(默認值)
- Position,pos,以及 p 將輸出轉換為相對位置(當你不在計算跳躍距離時使用)
用法:
語法分析器從左向右讀取操作和記號。所有的操作和記號應當用空格分隔。
Momentum 記號可以置於任意兩個操作之間。
Blocks,Meters 與 Position 記號置於語句末尾(不可同時使用)。
範例:
- 延立:% 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) |