0

I would like to code

if (???) then
-- Code which is intended to run specially on CORE ( e.g. special references to CORE objects )
else
-- Code which is not intended to run on CORE ( e.g. the standard "require()",..)
end

How to do this? I guessed that I might do it with "os" library functions, but I did not get a clue.

Sincerely Rolf

1 Answers1

2

Some of Lua's standard functions have been removed in Core.

So if you for example have access to the io library you're not running your script from within Core.

if not io then
  print("not running standard Lua")
end

Alternatively find something that only exists in Core.

if CoreObject then
  print("we're likely running Core")
end
Piglet
  • 27,501
  • 3
  • 20
  • 43