 |
Larkin Wizard

Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Wed Jun 04, 2008 4:11 pm
Lua-related request |
(If this exists, someone please clue me in.)
What I would love is a place, or a method, for putting global Lua functions and variables into packages/sessions for other Lua code to use. I rather liked being able to define a whole mess of things in one script file in MUSHclient and then just calling those functions or referencing those variables from my aliases, triggers, etc. |
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Jun 04, 2008 5:39 pm |
You should be able to do this in your onLoad event (or in some Lua script alias that you call from onLoad). In fact, any Lua function/variable that you create in one script should still be accessible to other scripts. CMUD doesn't clear the Lua data space before executing scripts.
|
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Wed Jun 04, 2008 6:29 pm |
Mmm, CMUD only uses one namespace for Lua, so any functions you create will be visible anywhere. I personally prefer OnConnect to OnLoad, but as long as something somewhere defines the function before something somewhere else tries to use it, it'll work.
|
|
|
|
 |
Larkin Wizard

Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Wed Jun 04, 2008 8:58 pm |
Okay. I'll try that then! Thanks for the advice.
|
|
|
|
 |
|
|
|