Working libs

This commit is contained in:
Cooldude2606
2017-11-30 18:42:39 +00:00
parent cf8697adff
commit 95ff205e2a
10 changed files with 586 additions and 96 deletions

View File

@@ -8,10 +8,25 @@ Discord: https://discord.gg/r6dC2uK
]]
--Please Only Edit Below This Line-----------------------------------------------------------
-- replaces the base error function
_error = error
error = function(err)
if _G.discord_emit then
local color = _G.Color and Color.to_hex(defines.text_color.bg) or '0x0'
discord_emit{title='SCRIPT ERROR',color=color,description=err}
elseif _G.game then
if Game.print_all(err) == 0 then
_error(err)
end
else
_error(err)
end
end
-- loads the stdlib and allows Core Game and Event
local StdLib = require '/locale/StdLib/load'
local Core, Game, Event = StdLib.Core, StdLib.Game, StdLib.Event
-- loads the ExpLib, functions are plased into the lua global
local ExpLib = require 'ExpLib'
ExpLib._load_to_G(ExpLib)
ExpLib._load_to_G(ExpLib)