Jump to content
×
×
  • Create New...

Auto Event Quest


MrLibya

Recommended Posts

  • Premium

note: for who ask about add new event
just add new line after this

{"Fri 14:00", "mount", "event", "Mount_Ring_Event", 1, " 4 hours ", "Fri 18:00", 0},

so it's like that

"Fri 14:00" begin time
"mount" event name
type ( unimplemented )
"Mount_Ring_Event" the event flag name
1 the event start flag
" 4 hours " event time
"Fri 18:00" event finish time
0 event finish flag

Edited by MrLibya

If you're going to do something, then do it right.

Link to comment

hallo all

i want public my auto even quest , it's very simple to understand i made it from some long time

 

quest auto_events begin
    state start begin
        when 20086.chat."auto event" with pc.is_gm() begin
            say_title(" Hallo "..pc.get_name())
            say(" state now "..game.get_event_flag("autoevent").." ")
            say(" ")
            local s = select(" active "," disable "," close ")
            if s == 1 then
                setskin(NOWINDOW)
                server_loop_timer("auto_event_timer", 1)
                game.set_event_flag("autoevent", 1)
            elseif s == 2 then
                setskin(NOWINDOW)
                clear_server_timer("auto_event_timer")
                game.set_event_flag("autoevent", 0)
            end
        end
        when auto_event_timer.server_timer begin
            local events_info = {
                {"Sat 14:00", "hair", "event", "hairup", 1, " 4 hours ", "Sat 18:00", 0},
                {"Sun 14:00", "6 Shabe Box", "event", "2006_drop", 1, " 4 hours ", "Sun 18:00", 0},
                {"Mon 13:00", "Gold ball", "event", "gold_bool", 1, " 4 hours ", "Mon 18:00", 0},
                {"Tue 14:00", "dressup box", "event", "dressup", 1, " 4 hours ", "Tue 18:00", 0},
                {"Wed 14:00", "fotball box", "event", "football_drop", 1, " 4 hours ", "Wed 18:00", 0},
                {"Thu 14:00", "moon box", "event", "drop_moon", 1, " 4 hours ", "Thu 18:00", 0},
                {"Fri 14:00", "mount", "event", "Mount_Ring_Event", 1, " 4 hours ", "Fri 18:00", 0},
            }
            local day_time = os.date("%a %H:%M")
            for i,v in ipairs(events_info) do
                if v[1] == day_time then
                    if game.get_event_flag(v[4]) != v[5] then
                        notice_all("notice: event  "..v[2].." actived for "..v[6].."  started from now! ")
                        game.set_event_flag(v[4], v[5])
                    end
                elseif v[7] == day_time then
                    if game.get_event_flag(v[4]) != v[8] then
                        notice_all(" notice: event "..v[2].." finish, see u with other events !! ")
                        game.set_event_flag(v[4], v[8])
                    end
                end
            end
        end
    end
end
 
 

thank u

Link to comment
  • 6 months later...
  • 1 year later...
  • 2 years later...
  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.