You can just compile the MML Library into a DLL no? Then load that DLL and GetProcAddress of every function in it. Have your bot use that stuff to access functions?
OR do what you're doing I guess and compile that stuff into your bot..
Example:
unit dtm;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, MufasaTypes;
You see the part that says uses? Under it is all the includes needed to use that file. Remember that other files might also have includes too so just make sure to grab those as well. When done, it should not be asking for anymore dependencies.
For example, one of my oldest plugins was:
library SSecurity;
{$mode objfpc}{$H+}
uses
Classes, SysUtils, DCPbase64, DCPconst, DCPcrypt2, DCPmd5, StringFuncs,
MufasaTypes, stringutil, Forms, Dialogs, LCLType, Controls, Interfaces, IniFiles, XTea;
{$R *.res}
type
TCharArray = array of Char;
Function StringToCharArray(TheStr: string): TCharArray; register;
var
i, l: Integer;
begin
l := Length(TheStr);
SetLength(Result, l + 1);
for i := l downto 1 do
Result[i - 1] := TheStr[i];
end;
Function CharArrayToString(TheStr: TCharArray): String; register;
var
i, l: Integer;
begin
l := Length(TheStr) - 1;
for i:= 0 To l do
Result := Result + TheStr[i];
end;
Function ToASCII(AChar: char): Integer; register;
begin
result:= ord(AChar);
end;
Function ToChar(AChar: Byte): Char; register;
begin
result:= chr(AChar);
end;
Function DecToBin(Num: Int64): Int64; register;
var
bin, pos: Cardinal;
begin
bin := 0;
pos := 1;
while (Num > 0) do
begin
bin := bin + (Num mod 2) * pos;
Num := Num Div 2;
pos := pos * 10;
end;
Result:= Bin;
end;
Function Encrypt(StrToEncrypt, Key: String): String; register;
begin
Result:= Trim(Base64Encode(XTeaCryptStr(Trim(StrToEncrypt), Key)));
end;
Function Decrypt(StrToDecrypt, Key: String): String; register;
begin
Result:= Trim(XTeaDecryptStr(Base64Decode(Trim(StrToDecrypt)), Key));
end;
Procedure WriteToFile(StrToWrite: String); register;
var
FS: TOpenDialog;
Buffer, FName: String;
F: TFileStream;
begin
FS := TOpenDialog.Create(nil);
FS.Options := [ofFileMustExist];
FS.Filter := ' Simba Scripts (*.simba;*.Simba)|*.simba;*.Simba|All files (*.*)|*.*|';
FS.FilterIndex := 1;
if FS.Execute then
begin
FName:= FS.FileName;
F:= TFileStream.Create(FName, fmOpenReadWrite);
try
F.Position:= 0;
SetLength(Buffer, F.Size);
F.ReadBuffer(Buffer, F.Size);
Finally
F.Free;
end;
F:= TFileStream.Create(FName, fmOpenReadWrite);
try
F.Position:= 0;
Buffer := StringReplace(Buffer, Between('Pass', ';', Buffer), StrToWrite, [rfReplaceAll, rfIgnoreCase]);
F.WriteBuffer(Buffer, Length(Buffer));
writeln(Buffer);
Finally
F.Free;
end;
FS.Free;
end;
end;
{ EXPORTS }
procedure SetPluginMemoryManager(MemMgr : TMemoryManager); stdcall; export;
begin
SetMemoryManager(MemMgr);
end;
{ EXPORT TYPES }
function GetTypeCount(): Integer; stdcall; export;
begin
Result := 1;
end;
function GetTypeInfo(x: Integer; var sType, sTypeDef: string): integer; stdcall;
begin
case x of
0: begin
sType := 'TCharArray';
sTypeDef := 'Array of Char;';
end;
else
Result := -1;
end;
end;
{ EXPORT FUNCS }
function GetFunctionCount(): Integer; stdcall; export;
begin
Result := 8;
end;
function GetFunctionCallingConv(x : Integer) : Integer; stdcall; export;
begin
Result := 0;
case x of
0..7 : Result := 1;
end;
end;
function GetFunctionInfo(x: Integer; var ProcAddr: Pointer; var ProcDef: PChar): Integer; stdcall; export;
begin
case x of
0:
begin
ProcAddr := @StringToCharArray;
StrPCopy(ProcDef, 'Function StringToCharArray(TheStr: string): TCharArray;');
end;
1:
begin
ProcAddr := @CharArrayToString;
StrPCopy(ProcDef, 'Function CharArrayToString(TheStr: TCharArray): String;');
end;
2:
begin
ProcAddr := @ToASCII;
StrPCopy(ProcDef, 'Function ToASCII(AChar: char): Integer;');
end;
3:
begin
ProcAddr := @ToChar;
StrPCopy(ProcDef, 'Function ToChar(AChar: Byte): Char;');
end;
4:
begin
ProcAddr := @DecToBin;
StrPCopy(ProcDef, 'Function DecToBin(Num: Int64): Int64;');
end;
5:
begin
ProcAddr := @Encrypt;
StrPCopy(ProcDef, 'Function Encrypt(StrToEncrypt, Key: String): String;');
end;
6:
begin
ProcAddr := @Decrypt;
StrPCopy(ProcDef, 'Function Decrypt(StrToDecrypt, Key: String): String;');
end;
7:
begin
ProcAddr := @WriteToFile;
StrPCopy(ProcDef, 'Procedure WriteToFile(StrToWrite: String);');
end;
else
x := -1;
end;
Result := x;
end;
//Exports
exports SetPluginMemoryManager;
//Types
exports GetTypeCount;
exports GetTypeInfo;
//Functions
exports GetFunctionCount;
exports GetFunctionInfo;
exports GetFunctionCallingConv;
begin
end.
Right where it says uses is everything I needed to include inorder to use some Simba functions.