Bot: Difference between revisions

From Minecraft Parkour Wiki
Content added Content deleted
(Prepared the page for translation)
(Marked this version for translation)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>
<!--T:1-->
__NOTOC__
__NOTOC__
MCPK-bot is a Discord Bot aiming to replace MathBot for movement calculations. Indeed, it was getting tiresome to redefine functions all the time, and the syntax is not very convenient to use. MathBot is still very useful as a general-purpose calculation tool.
MCPK-bot is a Discord Bot aiming to replace MathBot for movement calculations. Indeed, it was getting tiresome to redefine functions all the time, and the syntax is not very convenient to use. MathBot is still very useful as a general-purpose calculation tool.


<!--T:2-->
'''Advantages''' over using Mathbot:
'''Advantages''' over using Mathbot:


<!--T:3-->
* Richer and more descriptive outputs
* Richer and more descriptive outputs
* The functions are built-in: no need to redefine them manually.
* The functions are built-in: no need to redefine them manually.
Line 17: Line 20:




== Distance ==
== Distance == <!--T:4-->


<!--T:5-->
'''%distance''' <X> ''[Z]''
'''%distance''' <X> ''[Z]''


<!--T:6-->
Returns the real distance of a X by Z jump (distances in blocks, Z is optional)
Returns the real distance of a X by Z jump (distances in blocks, Z is optional)


<!--T:7-->
The formula is simply <math>\sqrt{max(0,X-0.6)^2 + max(0,Z-0.6)^2}</math>
The formula is simply <math>\sqrt{max(0,X-0.6)^2 + max(0,Z-0.6)^2}</math>






==== Examples: ====
==== Examples: ==== <!--T:8-->


<!--T:9-->
* 4b jump: %distance 4
* 4b jump: %distance 4
* 3x3 jump: %distance 3 3
* 3x3 jump: %distance 3 3
Line 36: Line 43:




== Duration ==
== Duration == <!--T:10-->


<!--T:11-->
'''%duration''' <jumpHeight> ''[ceilingHeight]''
'''%duration''' <jumpHeight> ''[ceilingHeight]''


<!--T:12-->
Returns the duration of a jump with the given height (heights in blocks, ceilingHeight is optional)
Returns the duration of a jump with the given height (heights in blocks, ceilingHeight is optional)






==== Examples: ====
==== Examples: ==== <!--T:13-->


<!--T:14-->
* -1.5b jump: %duration -1.5
* -1.5b jump: %duration -1.5
* 3bc +1 jump: %duration 1 3
* 3bc +1 jump: %duration 1 3
Line 54: Line 64:




== Height ==
== Height == <!--T:15-->


<!--T:16-->
'''%height''' <jumpTicks> ''[ceilingHeight]''
'''%height''' <jumpTicks> ''[ceilingHeight]''


<!--T:17-->
Returns the jump height of the player after n ticks (ceilingHeight is optional)
Returns the jump height of the player after n ticks (ceilingHeight is optional)






==== Examples: ====
==== Examples: ==== <!--T:18-->


<!--T:19-->
* 12t jump: %height 12
* 12t jump: %height 12
* 2bc 9t jump: %height 9 2
* 2bc 9t jump: %height 9 2
Line 71: Line 84:




== Blip ==
== Blip == <!--T:20-->


<!--T:21-->
'''%blip''' <repetitions> ''[initialHeight]'' ''[blipHeight] [lastJumpTicks]''
'''%blip''' <repetitions> ''[initialHeight]'' ''[blipHeight] [lastJumpTicks]''


<!--T:22-->
Returns the height of the player after chaining consecutive blips (Y=0 is the bottom surface by convention).
Returns the height of the player after chaining consecutive blips (Y=0 is the bottom surface by convention).


<!--T:23-->
* <repetitions> is the number of chained blips performed
* <repetitions> is the number of chained blips performed
* [initialHeight] is the player's initial height before the first jump (default: 0.0)
* [initialHeight] is the player's initial height before the first jump (default: 0.0)
Line 84: Line 100:




==== Examples: ====
==== Examples: ==== <!--T:24-->


<!--T:25-->
* starting from Y=200: %blip 4
* starting from Y=200: %blip 4
* 17 chained blips on lilypad: %blip_top 17 0.015625
* 17 chained blips on lilypad: %blip_top 17 0.015625
Line 93: Line 110:




== Simulate ==
== Simulate == <!--T:26-->


<!--T:27-->
'''%simulate''' <actions> (or simply '''%'''<actions>)
'''%simulate''' <actions> (or simply '''%'''<actions>)


<!--T:28-->
Reads the given actions from left to right, and simulates the resulting movement.
Reads the given actions from left to right, and simulates the resulting movement.






=== Actions: ===
=== Actions: === <!--T:29-->


<!--T:30-->
Actions take two arguments:
Actions take two arguments:
* Ticks : the duration of the action, in ticks
* Ticks : the duration of the action, in ticks
Line 169: Line 189:
|}
|}


<!--T:31-->
Add "max_" in front to get the maximum momentum with that action (repeats the action 20 times)
Add "max_" in front to get the maximum momentum with that action (repeats the action 20 times)






=== Special Tokens: ===
=== Special Tokens: === <!--T:32-->


<!--T:33-->
* '''Momentum''', '''MM''', and '''|''' sets the previous actions as momentum (resets the position minus the last tick)
* '''Momentum''', '''MM''', and '''|''' sets the previous actions as momentum (resets the position minus the last tick)


<!--T:34-->
* '''Blocks''' and '''b''' convert the output landing distance to blocks (± 0.6 to X and Z if nonzero)
* '''Blocks''' and '''b''' convert the output landing distance to blocks (± 0.6 to X and Z if nonzero)


<!--T:35-->
* '''Meters''', and '''m''' convert the output landing distance to meters (same values as default)
* '''Meters''', and '''m''' convert the output landing distance to meters (same values as default)


<!--T:36-->
* '''Position''', '''pos''', and '''p''' convert the output to a relative position (used when you're not calculating jump distance)
* '''Position''', '''pos''', and '''p''' convert the output to a relative position (used when you're not calculating jump distance)


Line 186: Line 211:




=== Usage: ===
=== Usage: === <!--T:37-->


<!--T:38-->
The parser reads the actions and tokens from left to right. Actions and tokens should be separated by spaces.
The parser reads the actions and tokens from left to right. Actions and tokens should be separated by spaces.


<!--T:39-->
The '''Momentum''' token can be used anywhere between two actions.
The '''Momentum''' token can be used anywhere between two actions.


<!--T:40-->
The '''Blocks''', '''Meters''', and '''Position''' tokens are to be used at the end of the sequence (mutually exclusive).
The '''Blocks''', '''Meters''', and '''Position''' tokens are to be used at the end of the sequence (mutually exclusive).


Line 197: Line 225:




=== Examples: ===
=== Examples: === <!--T:41-->


<!--T:42-->
* hh timing: % sprint | sprintjump(12)
* hh timing: % sprint | sprintjump(12)
* rex bwmm: % walkjump(12,180) walk(1,180) Lsprintjump(12) | sprintjump(12)
* rex bwmm: % walkjump(12,180) walk(1,180) Lsprintjump(12) | sprintjump(12)

Revision as of 05:15, 31 August 2022

Other languages:

MCPK-bot is a Discord Bot aiming to replace MathBot for movement calculations. Indeed, it was getting tiresome to redefine functions all the time, and the syntax is not very convenient to use. MathBot is still very useful as a general-purpose calculation tool.

Advantages over using Mathbot:

  • Richer and more descriptive outputs
  • The functions are built-in: no need to redefine them manually.
  • The bot uses float math instead of fractions, so the simulation is more accurate.
  • For simulating movement:
    • X and Z movement are both considered, and momentum threshold is taken into account.
    • Actions are read from left to right, which is way easier to read and write.
    • All actions take direction as an optional argument.



Distance

%distance <X> [Z]

Returns the real distance of a X by Z jump (distances in blocks, Z is optional)

The formula is simply


Examples:

  • 4b jump: %distance 4
  • 3x3 jump: %distance 3 3



Duration

%duration <jumpHeight> [ceilingHeight]

Returns the duration of a jump with the given height (heights in blocks, ceilingHeight is optional)


Examples:

  • -1.5b jump: %duration -1.5
  • 3bc +1 jump: %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.


Actions:

Actions take two arguments:

  • Ticks : the duration of the action, in ticks
  • Direction (optional) : the direction (not facing) of the action, in degrees
Action Description
stop, stop_air No input
sneak, sneak_air Sneak
sneak45, sneak45_air Sneak with 45° strafe
sneaksprint,

sneaksprint_air

Sneak with sprint (used for 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 Walk
walk45, walk45_air Walk with 45° strafe
sprint, sprint_air Sprint
sprint45, sprint45_air Sprint with 45° strafe
stopjump Jump without moving
walkjump Jump without sprinting
walkjump45 Jump without sprinting, 45° strafe throughout the jump
Lwalkjump

Rwalkjump

Jump without sprinting, strafe Left or Right on the first tick.
sprintjump Sprintjump
sprintjump45 Sprintjump forward, start 45° strafe after the first tick
Lsprintjump

Rsprintjump

Strafe Left or Right on the first tick of a sprintjump.

Example: used for rex bwmm

Lsprintjump45

Rsprintjump45

Strafe Left or Right throughout a sprintjump.

Example: used for 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).



Examples:

  • hh timing:  % 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) | sprintjump45(14) b