Hello Guest it is March 29, 2024, 09:57:33 AM

Author Topic: lua script require() question  (Read 1722 times)

0 Members and 1 Guest are viewing this topic.

Offline gorf23

*
  •  183 183
    • View Profile
lua script require() question
« on: April 03, 2017, 03:54:58 PM »
is there a way to use require() in a lua script without having a file dialog box loaded,  or is that another lua command to do the same call without a file dialog box.
It seems to works for calling a lua script from another lua script and being able to pass variables just don't want to wait to pick the file...

thanks

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: lua script require() question
« Reply #1 on: April 03, 2017, 04:55:09 PM »
The require function is to load modules, take a look in the Screen Load Script and see how its being used there.

DazTheGas
New For 2022 - Instagram: dazthegas

Offline gorf23

*
  •  183 183
    • View Profile
Re: lua script require() question
« Reply #2 on: April 04, 2017, 04:51:26 PM »
Thanks daz

I used some code form the load screen script it works, it will load my module and run it... But it always pop's up a file dialog box i have to pick the file and click ok
I just want the module to load and run with no file box...

Thanks

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: lua script require() question
« Reply #3 on: April 20, 2017, 04:41:28 PM »
This is a path issue.  If lua can't "find" your module, it will ask you where it is via the file dialog.  Make sure the module's path is in the package.path.

Steve