Hallo,
Ich habe folgende Autoevent Quest.
Jedoch wird das Event einfach nicht gestartet, compilen geht.
Wäre nett wenn jemand helfen kann.
Python
- quest auto_events begin
- state start begin
- when 20381.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 = {
- {"Mo 14:10", "Mondlicht-Schatztruhen", "event", "mondi_drop", 1, " 24 Stunden ", "Mo 14:08", 0},
- {"Mo 13:10", "Truhe der Verzauberung", "event", "drop_vzks", 1, " 24 Stunden ", "Mo 13:12", 0},
- {"Mo 15:10", "Truhe der Verzauberung2", "event", "drop_vzks", 1, " 24 Stunden ", "Mo 13:12", 0},
- {"Tue 23:59", "Mondlicht-Schatztruhen", "event", "mondi_drop", 1, " 24 Stunden ", "Wed 23:59", 0},
- {"Fri 23:59", "Truhe der Verzauberung", "event", "drop_vzks", 1, " 48 Stunden ", "Sun 23:59", 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("Das "..v[2].." Event ist nun aktiv für "..v[6].." !!")
- 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("Das "..v[2].." Event wurde beendet !! ")
- game.set_event_flag(v[4], v[8])
- end
- end
- end
- end
- end
- end