Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
Forum Connectivity Upgrade Read more... ×
  • 0
Varscott11

Can I use these in an init script?

Question

I've looked at the page showing everything that can be used in an init script and well as the Open Computers kernel.lua but I still have some questions:

What is available in the debug library (Lua 5.3) aka debug.sethook for example. Can someone please post what functions are and aren't available?

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 1
for k in pairs(debug) do print(k) end
traceback
getupvalue
getlocal
getinfo

getlocal, btw, is limited, it only returns the first result (the name of the field, not its value)

Share this post


Link to post
Share on other sites
  • 0

Is this list a part of OpenOS or actually what you have provided by the mod what you start the computer?

I'm asking this because the OpenOS Kernel.lua seems to be using debug.sethook

Share this post


Link to post
Share on other sites
  • 0

1. OpenOS doesn't add to nor remove from the debug library, what you see in OpenOS is available to all user space programs/custom operating systems

2. The debug library filtering/sandboxing occurs in the "hardware", before your eeprom code is executed, by our machine.lua (which builds the sandbox)

3. OpenOS has no kernel.lua and never has. OpenOS never calls debug.sethook anywhere. The machine.lua I mentioned (which again, runs OUTSIDE the sandbox, running unsandboxed, running lua code unavailable to OpenOS, unavailable to any user code), but this machine.lua used to be called kernel.lua -- renamed December 7th 2014. Yes, it uses debug.sethook, but users (and openos) are inside the sandbox.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.