You can get downgraded SPR/DAT files from here: https://github.com/EPuncker/1098extended
- Copy them to client directory.
- Download and compile pre-release 1.4.2 from here: https://github.com/Znote/forgottenserver/tree/1.4.2
-- Lua try / catch port | |
-- example: | |
--[[ | |
TryCatch( | |
-- try | |
function() | |
-- code to execute | |
-- throw a message | |
throw("some message") |
void LuaScriptInterface::getIntVector(lua_State* L, int32_t arg, std::vector<uint32_t>& vec) | |
{ | |
lua_pushnil(L); | |
while (lua_next(L, arg) != 0) { | |
if (lua_isnumber(L, -1)) { | |
vec.push_back(lua_tointeger(L, -1)); | |
} | |
lua_pop(L, 1); | |
} |
local files = {"door_locked.png", | |
"door_locked_small.png", | |
"door_normal.png", | |
"door_normal_small.png", | |
"door_magic.png", | |
"door_magic_small.png", | |
"door_quest.png", | |
"door_quest_small.png"} | |
function c() |
------------------------------ | |
-- Loader config | |
------------------------------ | |
local mapGeneratorDir = "data/map_generator/" | |
------------------------------ | |
-- loader | |
------------------------------ | |
dofile(mapGeneratorDir .. 'config.lua') | |
local prefix = ">> " |
You can get downgraded SPR/DAT files from here: https://github.com/EPuncker/1098extended
-- no need to redefine this in every script, just paste it to your libs | |
function Position:moveAll(newPos) | |
local tile = Tile(self) | |
if tile then | |
local tileStack = tile:getItems() | |
for _, tileItem in pairs(tileStack) do | |
local itemType = tileItem:getType() | |
if itemType:isMovable() then |
//requires fmt/color.h | |
std::vector<fmt::color> vect{ | |
fmt::color::alice_blue, fmt::color::antique_white, fmt::color::aqua, fmt::color::aquamarine, fmt::color::azure, fmt::color::beige, fmt::color::bisque, fmt::color::black, fmt::color::blanched_almond, fmt::color::blue, fmt::color::blue_violet, fmt::color::brown, fmt::color::burly_wood, fmt::color::cadet_blue, fmt::color::chartreuse, fmt::color::chocolate, fmt::color::coral, fmt::color::cornflower_blue, fmt::color::cornsilk, fmt::color::crimson, fmt::color::cyan, fmt::color::dark_blue, fmt::color::dark_cyan, fmt::color::dark_golden_rod, fmt::color::dark_gray, fmt::color::dark_green, fmt::color::dark_khaki, fmt::color::dark_magenta, fmt::color::dark_olive_green, fmt::color::dark_orange, fmt::color::dark_orchid, fmt::color::dark_red, fmt::color::dark_salmon, fmt::color::dark_sea_green, fmt::color::dark_slate_blue, fmt::color::dark_slate_gray, fmt::color::dark_turquoise, fmt::color::dark_violet, fmt::color::deep_pink, fmt::color::deep_sky_blue, fmt::color: |
function getValue(x) | |
local flipped = 0 | |
if x % 10 > 5 then | |
flipped = 1 | |
end | |
local f | |
if (x + flipped) % 2 == 1 then | |
f = math.floor | |
else |
-- module system | |
if not Game.modules then | |
-- load | |
Game.modules = { | |
moduleList = {}, | |
unLoadedModuleList = {} | |
} | |
else | |
-- reload | |
local newModuleList = {} |
<channel id="32" name="Lua" script="luachannel.lua" /> |