Çözüldü Questte Hata var ama bulamadım?

Bu konu çözüme ulaştırılmıştır. Çözüm için konuya yazılan tüm yorumları okumayı unutmayın. Eğer konudaki yorumlar sorununuzu çözmediyse yeni bir konu açabilirsiniz.
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.

Yusty

Üye
Üye
Mesaj
98
Çözümler
5
Beğeni
38
Puan
676
Lua (Quest):
quest yd_oto_event begin
    state start begin
        when login with pc.is_gm() begin
            clear_server_timer("oto_event")
            server_loop_timer("oto_event",1)
        end
        when oto_event.server_timer begin
            local saat = tonumber(os.date("%H"))
            local time = os.date("%X")
            local gun = tostring(os.date("%A"))
            if gun == "Monday" then
                if time == "20:00:00" then
                    if game.get_event_flag("ayisigi") == 0 then
                        game.set_event_flag("ayisigi",1)
                        notice_all("Ayisigi Define Sandığı eventi 1 saat süreyle başlamıştır.")
                        notice_all("Seviyenize göre kestiğiniz bütün canavarlardan elde edebilirsiniz.")
                        notice_all("Etkinlik Süresi : 1 Saat")
                    end
                elseif time == "21:00:00" then
                    if game.get_event_flag("ayisigi") == 1 then
                        game.set_event_flag("ayisigi",0)
                        notice_all("Ayisigi Define Sandığı eventi sona ermiştir.")
                    end
                end
            end
            elseif gun == "Tuesday" then
                if time == "21:00:00" then
                    if game.get_event_flag("ayisigi") == 0 then
                        game.set_event_flag("ayisigi",1)
                        notice_all("Ayisigi Define Sandığı eventi 1 saat süreyle başlamıştır.")
                    end
                elseif time == "22:00:00" then
                    if game.get_event_flag("ayisigi") == 1 then
                        game.set_event_flag("ayisigi",0)
                        notice_all("Ayisigi Define Sandığı eventi sona ermiştir.")
                    end
                end
            elseif gun == "Thursday" then
                if time == "20:00:00" then
                    if game.get_event_flag("futboltopu") == 0 then
                        game.set_event_flag("futboltopu",1)
                        notice_all("Futbol Topu eventi 1 saat süreyle başlamıştır.")
                        notice_all("Seviyenize göre kestiğiniz bütün canavarlardan elde edebilirsiniz.")
                        notice_all("Futbol Topu eventi 1 saat süreyle başlamıştır.")
                    end
                    elseif time == "21:00:00" then
                    if game.get_event_flag("futboltopu") == 1 then
                        game.set_event_flag("futboltopu",0)
                        notice_all("Futbol Topu eventi sona ermiştir.")
                    end
                end   
        end
    end
end
Hata nerede bulamadım yardımcı olur musunuz?
 
Bu şekilde hatayı bulmak zor. Derlerken mi hata alıyorsunuz yoksa oyun içinde quest yüzünden kanallar çökerek mi?
 
Lua (Quest):
QUEST : yd_oto_event
STATE : start
WHEN  : login
        with pc . is_gm ( )
WHEN  : yd_oto_event.server_timer
local saat = tonumber ( os . date ( "%H" ) )
local time = os . date ( "%X" )
local gun = tostring ( os . date ( "%A" ) )
if gun == "Monday" then
if time == "20:00:00" then
if game . get_event_flag ( "ayisigi" ) == 0 then
game . set_event_flag ( "ayisigi" , 1 )
notice_all ( "Ayisigi Define Sandığı eventi 1 saat süreyle başlamıştır." )
notice_all ( "Seviyenize göre kestiğiniz bütün canavarlardan elde edebilirsiniz." )
notice_all ( "Etkinlik Süresi : 1 Saat" )
end
end
elseif time == "21:00:00" then
if game . get_event_flag ( "ayisigi" ) == 1 then
game . set_event_flag ( "ayisigi" , 0 )
notice_all ( "Ayisigi Define Sandığı eventi sona ermiştir." )
end
end
elseif gun == "Tuesday" then
if time == "21:00:00" then
if game . get_event_flag ( "ayisigi" ) == 0 then
game . set_event_flag ( "ayisigi" , 1 )
notice_all ( "Ayisigi Define Sandığı eventi 1 saat süreyle başlamıştır." )
end
elseif time == "22:00:00" then
if game . get_event_flag ( "ayisigi" ) == 1 then
game . set_event_flag ( "ayisigi" , 0 )
notice_all ( "Ayisigi Define Sandığı eventi sona ermiştir." )
end
end
elseif gun == "Thursday" then
if time == "20:00:00" then
if game . get_event_flag ( "futboltopu" ) == 0 then
game . set_event_flag ( "futboltopu" , 1 )
notice_all ( "Futbol Topu eventi 1 saat süreyle başlamıştır." )
notice_all ( "Seviyenize göre kestiğiniz bütün canavarlardan elde edebilirsiniz." )
notice_all ( "Futbol Topu eventi 1 saat süreyle başlamıştır." )
end
elseif time == "21:00:00" then
if game . get_event_flag ( "futboltopu" ) == 1 then
game . set_event_flag ( "futboltopu" , 0 )
notice_all ( "Futbol Topu eventi sona ermiştir." )
end
end

yd_oto_event.lua:52:syntax error : [string "start"]:19: <eof> expected near `elseif'
Abort (core dumped)
Hata şöyle.
 
Kısacası benim yapmak istediğim otomatik event, drop ve ox yarışması gibi questler gm oyunda olmasa da bu eventler otomatik yapılacak belirli saat ve günlerde.
 
26. satırdaki end kodunu silip 52. satırın altına geçip end ekler misiniz. Quest bu şekilde olması gerekli;
Lua (Quest):
quest yd_oto_event begin
    state start begin
        when login with pc.is_gm() begin
            clear_server_timer("oto_event")
            server_loop_timer("oto_event",1)
        end
       
        when oto_event.server_timer begin
            local saat = tonumber(os.date("%H"))
            local time = os.date("%X")
            local gun = tostring(os.date("%A"))
            if gun == "Monday" then
                if time == "20:00:00" then
                    if game.get_event_flag("ayisigi") == 0 then
                        game.set_event_flag("ayisigi",1)
                        notice_all("Ayisigi Define Sandığı eventi 1 saat süreyle başlamıştır.")
                        notice_all("Seviyenize göre kestiğiniz bütün canavarlardan elde edebilirsiniz.")
                        notice_all("Etkinlik Süresi : 1 Saat")
                    end
                elseif time == "21:00:00" then
                    if game.get_event_flag("ayisigi") == 1 then
                        game.set_event_flag("ayisigi",0)
                        notice_all("Ayisigi Define Sandığı eventi sona ermiştir.")
                    end
                end
            elseif gun == "Tuesday" then
                if time == "21:00:00" then
                    if game.get_event_flag("ayisigi") == 0 then
                        game.set_event_flag("ayisigi",1)
                        notice_all("Ayisigi Define Sandığı eventi 1 saat süreyle başlamıştır.")
                    end
                elseif time == "22:00:00" then
                    if game.get_event_flag("ayisigi") == 1 then
                        game.set_event_flag("ayisigi",0)
                        notice_all("Ayisigi Define Sandığı eventi sona ermiştir.")
                    end
                end
            elseif gun == "Thursday" then
                if time == "20:00:00" then
                    if game.get_event_flag("futboltopu") == 0 then
                        game.set_event_flag("futboltopu",1)
                        notice_all("Futbol Topu eventi 1 saat süreyle başlamıştır.")
                        notice_all("Seviyenize göre kestiğiniz bütün canavarlardan elde edebilirsiniz.")
                        notice_all("Futbol Topu eventi 1 saat süreyle başlamıştır.")
                    end
                elseif time == "21:00:00" then
                    if game.get_event_flag("futboltopu") == 1 then
                        game.set_event_flag("futboltopu",0)
                        notice_all("Futbol Topu eventi sona ermiştir.")
                    end
                end
            end
        end
    end
end

Lua dilinde koşul ifadelerini kullanırken end kelimesi koşulun en sonuna eklenir. Mesela;
Lua (Quest):
if sayi == 1 then
           
elseif sayi == 2 then

elseif sayi == 3 then
           
end

Sizin kodlarda ise şuna benzer bir hata buldum.
Lua (Quest):
if sayi == 1 then
           
elseif sayi == 2 then

end
elseif sayi == 3 then
           
end
 
Quest doğru iyi hoş güzel fakat otomatik event kısmına gelince zamana bağlı olarak çalışmıyor ne yapmam gerek en basitinden şu kod bile saat gelince çalışmadı fakat questi eklerken hatasız eklendi oyunda da /reload q da dedim.
Lua (Quest):
quest yd_duyuru begin
    state start begin
        when login begin
            local saat = tonumber(os.date("%H"))
            local time = os.date("%X")
            local gun = tostring(os.date("%A"))
            if gun == "Sunday" then
                if time == "23:35:00" then
                    if game.get_event_flag("ayisigi") == 0 then
                    game.set_event_flag("ayisigi",1)
                    notice_all("Ayışığı etkinliği başladı!")
                    notice_all("Seviyenize göre kestiğiniz bütün canavarlardan elde edebilirsiniz.")
                    notice_all("Etkinlik Süresi : 1 Saat")
                    end
                end
            end
        end
    end
end
İmkanınız varsa deniyebilir misiniz?
 
Hatırladığım kadarıyla reload q çekice timerlar sıfırlanıyor. Tekrardan açmak gerekiyor. Bunun içinde queste kontrol eklemeniz gerekli.
 
Timerlar şöyle mi açılıyor acaba?
Lua (Quest):
when login with pc.is_gm() begin
            clear_server_timer("yd_duyuru")
            server_loop_timer("yd_duyuru",1)
end
 
Son düzenleme:
Şu kodda hata yok ama çalışmıyor eğer kontrol edebilirseniz çok güzel olur.
Lua (Quest):
quest oto_event begin
    state start begin
        when login with pc.is_gm() begin
            clear_server_timer("oto_event")
            server_loop_timer("oto_event",1)
        end
        when oto_event.server_timer begin
            local saat = tonumber(os.date("%H"))
            local time = os.date("%X")
            local gun = tostring(os.date("%A"))
            if gun == "Monday" then
                if time == "09:50:00" then
                    if game.get_event_flag("ayisigi") == 0 then
                        game.set_event_flag("ayisigi",1)
                        notice_all("Ayisigi Define Sandığı eventi 1 saat süreyle başlamıştır.")
                    end
                elseif time == "21:00:00" then
                    if game.get_event_flag("ayisigi") == 1 then
                        game.set_event_flag("ayisigi",0)
                        notice_all("Ayisigi Define Sandığı eventi sona ermiştir.")
                    end
                end
            elseif gun == "Tuesday" then
                if time == "21:00:00" then
                    if game.get_event_flag("event_altigen_drop") == 0 then
                        game.set_event_flag("event_altigen_drop",1)
                        notice_all("Altıgen Hediye Paketş eventi 2 saat süreyle başlamıştır.")
                    end
                elseif time == "23:00:00" then
                    if game.get_event_flag("event_altigen_drop") == 1 then
                        game.set_event_flag("event_altigen_drop",0)
                        notice_all("Altıgen Hediye Paketi eventi sona ermiştir.")
                    end
                end
            elseif gun == "Wednesday" then
                if time == "18:59:50" then
                    if game.get_event_flag("sertifika_drop") == 0 then
                        game.set_event_flag("sertifika_drop",1)
                        notice_all("Sertifika eventi 2,5 saat süreyle başlamıştır.")
                    end
                elseif time == "21:29:50" then
                    if game.get_event_flag("sertifika_drop") == 1 then
                        game.set_event_flag("sertifika_drop",0)
                        notice_all("Sertifika eventi sona ermiştir.")
                    end
                end
            elseif gun == "Thursday" then
                if time == "21:00:00" then
                    if game.get_event_flag("col_firtinasi_drop") == 0 then
                        game.set_event_flag("col_firtinasi_drop",1)
                        notice_all("Çöl Fırtınası eventi 1 saat süreyle başlamıştır.")
                    end
                elseif time == "22:00:00" then
                    if game.get_event_flag("col_firtinasi_drop") == 1 then
                        game.set_event_flag("col_firtinasi_drop",0)
                        notice_all("Çöl Fırtınası eventi sona ermiştir.")
                    end
                end
            elseif gun == "Friday" then
                if time == "20:00:00" then
                    if game.get_event_flag("football_drop") == 0 then
                        game.set_event_flag("football_drop",1)
                        game.set_event_flag("new_football_2014_event",1)
                        notice_all("Dünya Kupası eventi 3 saat süreyle başlamıştır.")
                    end
                elseif time == "23:00:00" then
                    if game.get_event_flag("football_drop") == 1 then
                        game.set_event_flag("football_drop",0)
                        game.set_event_flag("new_football_2014_event",0)
                        notice_all("Dünya Kupası eventi sona ermiştir.")
                    end
                end
            elseif gun == "Saturday" then
                if time == "21:00:00" then
                    if game.get_event_flag("sonsuz_kis_drop") == 0 then
                        game.set_event_flag("sonsuz_kis_drop",1)
                        notice_all("Sonsuz Kış Sandığı eventi 1 saat süreyle başlamıştır.")
                    end
                elseif time == "22:00:00" then
                    if game.get_event_flag("sonsuz_kis_drop") == 1 then
                        game.set_event_flag("sonsuz_kis_drop",0)
                        notice_all("Sonsuz Kış Sandığı eventi sona ermiştir.")
                    end
                end
            elseif gun == "Sunday" then
                if time == "19:00:00" then
                    if game.get_event_flag("cards_event") == 0 then
                        game.set_event_flag("cards_event",1)
                        notice_all("Okey Kart eventi 4 saat süreyle başlamıştır.")
                    end
                elseif time == "23:00:00" then
                    if game.get_event_flag("cards_event") == 1 then
                        game.set_event_flag("cards_event",0)
                        notice_all("Okey Kart eventi sona ermiştir.")
                    end
                end
            end
        end
    end
end
 
Şuan evde değilim eve geçince bi questinizi inceleyim.
Bu questi nereden edindiniz?
 
Sitemizde paylaşılan oto etkinlik questi vardı sanırsam. Ona baktınız mı?
 
Baktım fakat şuradaki mantığı anlamadım öyle doğru mu eklemem yada çıkartmam gereken birşey var mı bilmiyorum event ismi geçiyor ama üstteki top_ac yada top_kapa 'nın mantığı nedir?
Lua (Quest):
elseif gun == "Tuesday" then
                if saat == 15 then
                    if game.get_event_flag("top_ac") == 0 then
                        game.set_event_flag("top_ac",1)
                        game.set_event_flag("top_kapa",0)
                        game.set_event_flag("futboltopu",1)
                        notice_all("Futbol Topu eventi 2 saat süreyle başlamıştır.")
                    end
                elseif saat == 16 then
                    if game.get_event_flag("top_kapa") == 0 then
                        game.set_event_flag("top_ac",0)
                        game.set_event_flag("top_kapa",1)
                        game.set_event_flag("futboltopu",0)
                        notice_all("Futbol Topu eventi bitmiştir.")
                    end
                end
 
Futbol topu eventi için yazılmış. O kısmı kendi futbol topu etkinliğinizin flaglarına göre değiştirebilirsiniz. :)
 
Bende eventler tek questte ve npc'ye bağlı aşağıdaki gibi. flag ise sadece futboltopu. Buna göre o top_ac ve top_kapa'yı kaldırsam kod bloklarından çalışır mı yoksa eklemem gereken birşey var mı? Bir de anlamadığım bunun adı neden "futboltopu" ben onun adını sadece "top" yapmak istesem nasıl yapacağım bu dosya nerede?
Lua (Quest):
when 20092.chat."Futbol Topu Eventi " with pc.is_gm() begin
            say("Eventi başlatmak istiyor musun? ")
            local baslat = select(" Evet ", " Bitir ", "Hayır ")
            if baslat == 1 then
                game.set_event_flag("futboltopu",1)
                notice_all("Futbol Topu etkinliği başladı!")
                notice_all("Seviyenize göre kestiğiniz bütün canavarlardan elde edebilirsiniz.")
                notice_all("Etkinlik Süresi : 1 Saat")
            end
            if baslat == 2 then
                game.set_event_flag("futboltopu",0)
                notice_all("Futbol Topu etkinliği sona erdi.")
            end
        end
Konuya sizin kadar hakim olmadığım için öğrenmek amaçlı çok soru soruyorum maalesef.:(
 
Son düzenleme:
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.
Geri
Üst