- 欠点 (Lua/Defact)
入門†
- Lua(ルア)でHello World!
- Luaスクリプト機能
sleep†
- How to add a "sleep" or "wait" to my Lua Script?
- https://stackoverflow.com/questions/17987618/how-to-add-a-sleep-or-wait-to-my-lua-script
local socket = require('socket') socket.sleep(0.2)
- https://stackoverflow.com/questions/17987618/how-to-add-a-sleep-or-wait-to-my-lua-script
coroutine.sleep(0.2)
module†
- (Nvim) Lua for Javascripters: Module Exports
local M = {} - function M.deleteDataFile(name) ... end return M
coroutine†
- luaのcoroutine
class†
Lua に class は存在しないので、それっぽいラッパー。
- Tylas11 / XivParty
- https://github.com/Tylas11/XivParty/blob/master/classes.lua
- https://github.com/Tylas11/XivParty/blob/master/player.lua
local player = classes.class()
function player:init(name, id, model)
self.name = name
table†
- https://github.com/torch/xlua/blob/master/init.lua#L640
function table.splice(tbl, start, length) length = length or 1 start = start or 1 local endd = start + length local spliced = {} local remainder = {} for i,elt in ipairs(tbl) do if i < start or i >= endd then table.insert(spliced, elt) else table.insert(remainder, elt) end end return spliced, remainder end
array†
- Lua 配列(Array)
- https://ooo.iiyudana.net/htm/lua_chp5frame.htm
local a = {} a[1] = 0; a[2] = 0; a[100] = 0; print( #a ) -- 2 print( table.getn( a ) ) -- 2 print( table.maxn( a ) )-- 100
- https://ooo.iiyudana.net/htm/lua_chp5frame.htm
.†
- 論理演算子を用いたLuaの慣用表現
- Lua > 乱数を使う