Jump to content




require()?

command lua api

1 reply to this topic

#1 bigflipperfish

  • New Members
  • 1 posts

Posted 28 April 2017 - 01:45 AM

I wanted to use the require() function from lua to add a module to my code. I know about os.loadAPI() and dofile() and the such and I can make my code have the result that I want, but I was wondering if there was a particular reason that require() is not included in computercraft. I've been searching through the documentation and reading forum after forum with no clear answer. Can anyone help me out?

#2 Exerro

  • Members
  • 801 posts

Posted 28 April 2017 - 03:34 PM

Not sure of the reason it's not implemented, but there are Lua-based versions that do the same thing on the forums. Alternatively, `dofile` is pretty much identical except it doesn't cache the result.

See http://www.computerc...r-computercraft





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users