We have had questions in the past about "including" standard scripts into a script file.
Lua provides a very simple function for doing that: dofile.
If you have some standard commands that you want to share, simply do this:
You might want to prepend a path, for example the MUSHclient executable or worlds path. For example:
In that case your include command may look like this:
There is also a "require" function that works similarly, but searches a path (which you can specify) and doesn't load the same file twice.
Lua provides a very simple function for doing that: dofile.
If you have some standard commands that you want to share, simply do this:
dofile "myfilename.lua"
You might want to prepend a path, for example the MUSHclient executable or worlds path. For example:
path = GetInfo (57) -- World files default path (directory)
In that case your include command may look like this:
dofile (GetInfo (57) .. "myfilename.lua")
There is also a "require" function that works similarly, but searches a path (which you can specify) and doesn't load the same file twice.