diff options
Diffstat (limited to 'script-beta/vm/guideInterface.lua')
-rw-r--r-- | script-beta/vm/guideInterface.lua | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/script-beta/vm/guideInterface.lua b/script-beta/vm/guideInterface.lua index 3ddb86ea..b21aee79 100644 --- a/script-beta/vm/guideInterface.lua +++ b/script-beta/vm/guideInterface.lua @@ -3,6 +3,7 @@ local files = require 'files' local ws = require 'workspace' local guide = require 'parser.guide' local await = require 'await' +local library = require 'library' local m = {} @@ -65,11 +66,12 @@ vm.interface = {} vm.interface.searchLevel = 0 function vm.interface.call(func, args, index) - await.delay() if func.special == 'require' and index == 1 then + await.delay() return m.require(args, index) end if func.special == 'dofile' then + await.delay() return m.dofile(args, index) end end @@ -84,6 +86,15 @@ function vm.interface.link(uri) return vm.getLinksTo(uri) end +function vm.interface.index(obj) + local tp = obj.type + local lib = library.object[tp] + if not lib then + return nil + end + return lib.fields +end + function vm.interface.cache(source, mode) await.delay() local cache = vm.getCache('cache') |