From 0b3e29dea9863c4b5ca0c77958bbcb32a05867ca Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 14 Feb 2015 23:12:07 +0100 Subject: Some work towards scriptable events --- resources/script/interact.lua | 3 +++ resources/script/test.lua | 20 +++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 resources/script/interact.lua (limited to 'resources/script') diff --git a/resources/script/interact.lua b/resources/script/interact.lua new file mode 100644 index 0000000..98bb34f --- /dev/null +++ b/resources/script/interact.lua @@ -0,0 +1,3 @@ +function interact(entity, time) + print('Interact! ' .. time) +end diff --git a/resources/script/test.lua b/resources/script/test.lua index f78cf13..1dc1fc4 100644 --- a/resources/script/test.lua +++ b/resources/script/test.lua @@ -1,14 +1,20 @@ -function print_table(foo, bar) +local function print_table(foo, bar) for k, v in pairs(foo) do print(bar .. k, v) - if type(v) == 'table' and bar .. k ~= '_G' then - print_table(v, bar .. k .. '.') - end + --if type(v) == 'table' and bar .. k ~= '_G' then + -- print_table(v, bar .. k .. '.') + --end end end -print_table(_G, '') +--print(getmetatable(_G)) +--setmetatable(_G, {}) +--print_table(_G, '') -print(getmetatable('').__index) -print(string) +print(bar) +print(getmetatable(bar)) + +--print(getmetatable('').bar) +--getmetatable('').bar = 'bar' +--print(getmetatable('').bar) -- cgit v1.2.3