External lua files and permAlias/Trigger/Timer

Post Reply
fxf
Posts: 10
Joined: Sat Jan 09, 2010 11:37 am

External lua files and permAlias/Trigger/Timer

Post by fxf »

Hello,
I don't want to hijack thread about external modules, but these things are definitely connected. I'm previous user of TinyFugue, and one thing where tf really shines is that all configuration and scripts are in (human-editable) text files.
I prefer to edit scripts in external editor and organize definitions to files rather than use Mudlet GUI for anything complex. This way I can have for example following structure:
  • profilea.lua for my cleric containing just:

    Code: Select all

    require("numpad")
    require("speedwalks")
    require("common_stuff")
    require("cleric_stuff")
    
  • profileb.lua for my mage containing just:

    Code: Select all

    require("numpad")
    require("speedwalks")
    require("common_stuff")
    require("mage_stuff")
    
Where numpad.lua, speedwalks.lua etc. are just another lua files.

I understand that this file based organization perhaps doesn't suit everyone, but for me it is really the best way allowing me to use external full-featured text editor, and to logically structure all definitions. Mudlet xml then just contains simple one-line script - 'require("profilea")'.

My problem is however that I have to use just temporary aliases and triggers that don't show in Mudlet GUI because permanent aliases are saved in the xml and next time I get multiple definitions (one from xml and one from lua script). Am I the only one who prefers this old fashioned way? Do you have any suggestions/ideas that would allow me to use this text-based config in more mudlet-friendly style?

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: External lua files and permAlias/Trigger/Timer

Post by Vadi »

Use the exists() function before defining again: http://dl.dropbox.com/u/84880/mudlet_do ... tml#exists

fxf
Posts: 10
Joined: Sat Jan 09, 2010 11:37 am

Re: External lua files and permAlias/Trigger/Timer

Post by fxf »

Vadi wrote:Use the exists() function before defining again: http://dl.dropbox.com/u/84880/mudlet_do ... tml#exists
Thanks a lot! That's exactly what I needed.

Post Reply