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?
0
1 reply to this topic
#1
Posted 28 April 2017 - 01:45 AM
#2
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
See http://www.computerc...r-computercraft
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users