Hello,
Here is raidSystem for tfs 1.0 which i made to the rl map server in github: https://github.com/PrinterLUA/FORGOTTENSERVER-ORTS
Enjoy
Here is raidSystem for tfs 1.0 which i made to the rl map server in github: https://github.com/PrinterLUA/FORGOTTENSERVER-ORTS
Code:
<globalevent name="RaidSystem" interval="10000" script="raids.lua"/>
Code:
local raids = {
-- Weekly
['Monday'] = {
['08:00'] = {raidName = 'RatsThais'},
['15:00'] = {raidName = 'Arachir the Ancient One'}
},
['Wednesday'] = {
['12:00'] = {raidName = 'OrcsThais'}
},
-- By date (Day/Month)
['31/10'] = {
['16:00'] = {raidName = 'Halloween Hare'}
}
}
function onThink(interval, lastExecution, thinkInterval)
local day, date = os.date('%A'), getRealDate()
local raidDays = {}
if raids[day] then
raidDays[#raidDays + 1] = raids[day]
end
if raids[date] then
raidDays[#raidDays + 1] = raids[date]
end
if #raidDays == 0 then
return true
end
for i = 1, #raidDays do
local settings = raidDays[i][getRealTime()]
if settings and not settings.alreadyExecuted then
Game.startRaid(settings.raidName)
settings.alreadyExecuted = true
end
end
return true
end
local function getRealTime()
local hours = tonumber(os.date("%H", os.time()))
local minutes = tonumber(os.date("%M", os.time()))
if hours < 10 then
hours = '0' .. hours
end
if minutes < 10 then
minutes = '0' .. minutes
end
return hours .. ':' .. minutes
end
local function getRealDate()
local month = tonumber(os.date("%m", os.time()))
local day = tonumber(os.date("%d", os.time()))
if month < 10 then
month = '0' .. month
end
if day < 10 then
day = '0' .. day
end
return day .. '/' .. month
end
Enjoy
Last edited: