computercraft i/o library for people who like vocaloid
(also it's cute like miku)
hatsune
- cute event loop and coroutine schedulermiku
- future/promise implementationasync
- create a miku from a yielding/awaiting function, instead of using miku callbacksawait
- await a miku, also available asmiku:await
awaitSafe
- await a miku, catching errors and returningboolean, result
, also available asmiku:awaitSafe
hatsune also provides a few optional modules:
rin
- async httprana
- generator functions
the preferable language for hatsune is moonscript, since it allows for much more concise code. here are some examples:
as a lua library, hatsune is a bit more verbose (but still easy to use!). here are some examples:
from computercraft, run the following command:
wget https://github.com/tmpim/hatsune/raw/main/hatsune.lua
# additionally, if you want a few optional modules (for example rin):
wget https://github.com/tmpim/hatsune/raw/main/modules/rin.lua
you can build hatsune from source using moonscript externally, or using moonscript-cc in computercraft.
# if you're in computercraft (thanks to emma)
wget https://github.com/emmachase/moonscript-cc/raw/main/build/moonc.lua
moonc .
- websocket library
- krist library
- more examples