DSLua Community
Welcome, Guest. Please login or register.
February 05, 2012, 07:33:07 AM
1371 Posts in 262 Topics by 33109 Members
Latest Member: Limewire Download
DSLua Community  |  General DS Programming Chats  |  Code Hashing  |  Load another script « previous next »
Pages: [1]
Author Topic: Load another script  (Read 2141 times)
molster
Waxing Crescent
**
Posts: 19


« on: July 20, 2007, 10:40:54 PM »

Im just now for the firs time using lua (I script in ActionScript (flash)) so I know the basics of coding =)-


anyway, what I wish to know is, is it possible to load another .lua file from a lua file. so instead of a script like

DSLua.WaitForAnyKey()

then just having it end, make it so once hit, it loads a new .lua file. (also, though i dont need this now, when(or if) you load the new script, can you pass all the vars to it?
Logged
Jeremysr
First Quarter
***
Posts: 215



WWW
« Reply #1 on: July 21, 2007, 12:13:37 AM »

Yes just use this function:

dofile( "file.lua" )

And I *think* it should run it as if the the code in that file was right inside the file you are running. So you should be able to use the same variables between the two files.
Logged
molster
Waxing Crescent
**
Posts: 19


« Reply #2 on: July 21, 2007, 01:45:00 AM »

Thanks! that will help keep my main file looking a lot cleaner.

(ps: your DSlua tutorial site is the best)
Logged
Pages: [1]
« previous next »
    Jump to: