2018-09-06 05:04:07 +02:00
|
|
|
--
|
|
|
|
-- Minetest scriptblocks mod
|
|
|
|
--
|
2017-07-30 22:24:43 +02:00
|
|
|
|
2018-09-06 05:04:07 +02:00
|
|
|
-- Settings
|
|
|
|
scriptblocks = {
|
|
|
|
-- The maximum length of scriptblocks scripts.
|
|
|
|
max_length = 30,
|
|
|
|
|
|
|
|
-- The maximum amount of scriptblocks processed during a globalstep
|
|
|
|
max_per_step = 24,
|
2018-09-06 10:48:28 +02:00
|
|
|
|
|
|
|
-- The "tick" delay - How long to wait between processing scriptblocks
|
|
|
|
-- NOTE: If this is set too high, scriptblocks will appear unresponsive.
|
|
|
|
tick_delay = 0.1,
|
2018-09-06 05:04:07 +02:00
|
|
|
}
|
2017-08-03 16:26:34 +02:00
|
|
|
|
2018-09-06 05:04:07 +02:00
|
|
|
-- Get the mod path and storage
|
|
|
|
local modpath = minetest.get_modpath('scriptblocks')
|
|
|
|
scriptblocks.storage = minetest.get_mod_storage()
|
|
|
|
|
|
|
|
-- Load scriptblocks lua files
|
|
|
|
dofile(modpath .. '/core.lua')
|
|
|
|
dofile(modpath .. '/scriptblock.lua')
|
|
|
|
|
|
|
|
-- Load mesecons and digilines scriptblocks
|
|
|
|
if minetest.get_modpath('mesecons') then
|
|
|
|
dofile(modpath .. '/mesecons.lua')
|
2017-08-03 16:26:34 +02:00
|
|
|
end
|
2018-09-06 05:04:07 +02:00
|
|
|
|
|
|
|
if minetest.get_modpath('digilines') then
|
|
|
|
dofile(modpath .. '/digilines.lua')
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Override rmod scriptblock functions.
|
|
|
|
if minetest.get_modpath('rmod') then
|
|
|
|
rmod.scriptblock = scriptblocks
|
2017-08-03 16:26:34 +02:00
|
|
|
end
|