timer v1

timer v1
500 Downloads

Sends a message or executes a command at the specified time.

 

Requirements

  • Minescript v2.0 or higher
  • eval action requires eval.py

 

Usage

\timer <time> (chat|echo|execute|eval) <messageOrCommand>

<time> can be a countdown in hours, minutes, or seconds or a time of day. Supported formats include: 1:23am, 1:23 PM, 13:23, 10s (seconds), 5m (minutes), 2h (hours). Add * to countdown times to repeat, e.g. 5m* repeats every 5 minutes. Add * and a number to repeat that number of times at the given time interval.

 

Examples

Send a chat at 12 noon:

\timer 12pm chat "FYI: it is now noon"

Send a message to yourself at 12:30:

\timer 12:30pm echo "note to self: time to eat lunch"

Copy blocks labeled “timed_copy” in 2 minutes:

\timer 2m execute  "\\copy ~ ~ ~ ~64 ~64 ~64 timed_copy"

(note the double backslash before copy; this is needed to escape the
backslash within double quotes.)

Set game time to midday every hour:

\timer 1h* execute "/time set day"

Take 3 screenshots 5 seconds apart:

\timer 5s*3 eval "screenshot()"

(note: screenshot() added in Minescript v2.1)

 

Author: maxuser

Version: 1

eval v1

eval v1
677 Downloads

Note: Minescript 3.1 now includes eval as a built-in script.

Executes the given parameter as Python code.

 

Usage

\eval <pythonCode>

Executes <pythonCode> as either a Python expression (code
that can appear on the right-hand side of an assignment, in
which case the value is echoed to the chat screen) or Python
statements (e.g. a for loop).

Functions from minescript.py are available automatically without
qualification.

Multiple lines of code can be written using escaped newlines
(\n).

 

Examples

Print information about nearby entities to the chat screen:

\eval "entities()"

(note: entities() added in Minescript v2.1)

Print the names of nearby entities to the chat screen:

\eval "for e in entities(): echo(e['name'])"

(note: entities() added in Minescript v2.1)

Import time module, sleep 3 seconds, and take a screenshot:

\eval "import time\ntime.sleep(3)\nscreenshot()"

(note: screenshot() added in Minescript v2.1)

 

Author: maxuser

Version: 1

execute_book v1

execute_book v1
493 Downloads

Executes the contents of a book interpreted as Python code.

 

Requirements

Minescript v2.0 or higher

 

Usage

\execute_book
\execute_book - [<args>]
\execute_book <title> [<args>]

<args> passed to the book-based script can be read as sys.argv.

 

Examples

Executes the book in the player’s hand with no args:

\execute_book

Executes the book in the player’s hand with args foo and bar:

\execute_book - foo bar

Executes a book in the player’s inventory with the title
“my python code” passing no args:

\execute_book "my python code"

Executes a book in the player’s inventory with the title
“my python code” passing args foo and bar:

\execute_book "my python code" foo bar`

 

Author: maxuser

Version: 1