Skip to content

IS4Code/YALP-MTA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YALP-MTA v0.1

This plugin is an extension of YALP allowing import of MTA modules for use from within Lua.

Since MTA uses Lua 5.1 while YALP uses Lua 5.3, you'll also need something like this to actually load any MTA module.

Installation

Download the latest release for your platform to the "plugins/lua" directory and add "lua/YALP-MTA" (or "lua/YALP-MTA.so" on Linux) to the plugins line in server.cfg after YALP.

YALP must be at least version 1.1 in order to use this plugin!

Building

Use Visual Studio to build the project on Windows, or make on Linux.

Usage

Simply call require "YALP-MTA", which will modify the package loader table to allow importing modules from the "plugins/mta" directory. Global require function must be present and unmodified.

This example uses the SHA module:

require "YALP-MTA"
local sha = require "sha" -- will check plugins/mta/

for k, v in pairs(sha) do
  print(k, v)
end

print(sha.sha256("abc"))

In case the package table is accessible, package.mpath can be modified to change the directory where the modules are located.

About

Module for YALP to allow loading MTA modules

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages