Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0

Can I use these in an init script?


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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

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