• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

GlobalEvent RaidSystem for tfs 1.0

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,782
Solutions
31
Reaction score
2,286
Location
Sweden?
Hello,

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:
Since i dont try to replicate rl tibia on everything.
 
@WibbenZ
You're one of the biggest troll on the community. Even tho i wrote "try" it doesn't mean that it will be 100% accurate. As long the scripts works and replicate close enough. I dont get paid for my scripts and even tho i got alot of pm that people want buy scripts, ive turned down the offer. Also belive me or not people wanted to donate to rl map project, but i told them to donate to otland.

Also, this is just a good base of raid system to start from, if you want to add own features go ahead.
 
Last edited:
@WibbenZ
You're one of the biggest troll on the community. Even tho i wrote "try" it doesn't mean that it will be 100% accurate. As long the scripts works and replicate close enough. I dont get paid for my scripts and even tho i got alot of pm that people want buy scripts, ive turned down the offer. Also belive me or not people wanted to donate to rl map project, but i told them to donate to otland.

Also, this is just a good base of raid system to start from, if you want to add own features go ahead.

Did not say that what you are doing is a good thing, and yes I guess im a troll, but I do what I like and I will continue to.
The thing that is "good" is that you are helping the 10yo'ds, trying to start there first server to gain money, dosen't matter if you wanna admit it or not.
And you don't think ive gotten offers? Ive gotten offers at 100-200 eurs for my server without even knowing what it contains, but I haven't sold it yet, and will probbly not do.

Im greatfull that you started the project, otherwise I would never have started with my server.
The thing that made me stop and not add all my scripts (Those who think ive done alot on the github project, well ive maybe posted 5-10% of what ive done, and that was in the begining and I wasen't that used to meta tags.) is that we had diffrent ides of where the project would go, I tought we should donate to some charity and sell licenses to the server to decrease the download and run servers but at the still time doing something good.

What I guess you diden't even notice was that 2 of your "major" scripters wanted to do the same thing, royalot and ninja, if those 2 would have left and something like that would have started you would have been stuck with yourself if you diden't wanna join us.

Ive never heard of anyone wanting to donate to the project, but I get that you diden't wanna make that public, but that is what I wanted, but not to the devs, a certin % to mark for giving us space both for the svn and for allowing users to download it.

Topic: I tought it was funny, since you we're the one writing what I quoted and still in another "post" or statment writes that you aren't trying to replicate cipsoft.

I do still check the github page, both to check if you have found bugs that I haven't found and im glad that the project found someone like this: https://github.com/PrinterLUA/FORGOTTENSERVER-ORTS/issues/498 that reports the bugs he finds, what I noticed was mainly that users downloaded the project and fixed the bugs they / there players found and what was rarely reported.
 
Nice system, trying to adapt it for use with a event planner, is there a way to call the next timed event randomly, like theres two events, EventA and EventB, When EventA activates, or gets called, it will tell you info about EventB, but without knowing the timestamp, or would i need to make a additional value on each event of the next events time?

http://otland.net/threads/looking-for-some-assistance-on-a-script.216303/
 
@Printer

Im just curious.
Would this event make my other raids not occur?
For example:
I have a raid that I want to be weekly.
Lets say, I want orshaabal im edron to be weekly.
But the others random like normal.
Then this would be working as I explained or?
 
@Printer

Im just curious.
Would this event make my other raids not occur?
For example:
I have a raid that I want to be weekly.
Lets say, I want orshaabal im edron to be weekly.
But the others random like normal.
Then this would be working as I explained or?
if you talking about the xml raids, they don't affect each other
 
Back
Top