How to auto load lua scripts

From the wonderful RedGuides Wiki

Credit to hushed for providing this information relating to auto loading lua scripts.

Developers of Macroquest (MQ) scripts have the option of using the lua programming language to create scripts.

First time users must ensure the the plugin MQ2Lua is loaded, this is accomplished using the command;

/plugin MQ2Lua

(which will load/unload as appropriate.)

To load a specific lua script, you would use the code:

/lua run <lua name>

e.g /lua run lootly

If you want a specific, or number of lua scripts, to load every time any character enters the game, you will need to create a cfg file, in your config folder.

  • Create the file ingame.cfg in your config folder. You can do this with Notepad. This can be found in folder: \\VeryVanilla\MQNext\Release\config\
  • Add the code you want to automatically run when your character gets in game, for example; /lua run lootly
  • Save your new file.
  • Load up a character, and see it is now working!

Example ingame.cfg file;

/timed 50 /lua run lootly
/timed 100 /lua run alertmaster
/timed 150 /lua run somethingfancy

Note: If you add a lot of lua scrips, you should consider adding short delays, as per the example above.

There are many options when it comes to the MQ config files CFG. Details can be found <here>

For specific instructions on installing lua scripts please refer to individual lua wiki pages. Usually lua scripts are installed in the following folder; \VeryVanilla\MQNext\Release\lua\