zbizu
Legendary OT User
A simple loader for libs. It brings data\lib folder functionality from 0.4
installation:
create folder: "data\lib\"
add to global.lua:
after:
it should look like this:
now you may put anything in lib folder and it will be loaded like in 0.4.
example lib:
04_compat.lua
Special thanks to @Limos for showing me how to do it.
installation:
create folder: "data\lib\"
add to global.lua:
Code:
for dir in io.popen([[dir "data\lib\" /b /aa]]):lines() do
dofile('data/lib/'..dir..'')
end
Code:
dofile('data/compat.lua')
it should look like this:
now you may put anything in lib folder and it will be loaded like in 0.4.
example lib:
04_compat.lua
Code:
getThingFromPos = getThingfromPos
getThingPosition = getThingPos
MESSAGE_LOOT = MESSAGE_INFO_DESCR
TALKTYPE_MONSTER = TALKTYPE_MONSTER_SAY
TALKTYPE_ORANGE_1 = TALKTYPE_MONSTER_SAY
TALKTYPE_ORANGE_2 = TALKTYPE_MONSTER_YELL
getCreatureStorage = getPlayerStorageValue
doCreatureSetStorage = setPlayerStorageValue
function getItemNameById(itemId) return ItemType(itemId):getName() end
string.explode = function (str, sep, limit)
if(type(sep) ~= 'string' or isInArray({tostring(str):len(), sep:len()}, 0)) then
return {}
end
Special thanks to @Limos for showing me how to do it.
Last edited: