Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Auto Wiadomość ~~ Nowy Wymiar


Rekomendowane odpowiedzi

Opublikowano

 

http://www.elitepvpers.com/forum/metin2-pserver-guides-strategies/2607585-rls-auto-message-3-a.html

Spolszczone

 

 

quest automessage begin
    state start begin
        
        function lastmessage()
            local file,err = io.open("locale/germany/automessage.txt","rb")
            if(err) then
                return 1
            end
            for line in file:lines() do
                return line
            end
            if(line == "") then
                return 0
            end
        end
        
        function write(message)
            local file,err = io.open("locale/germany/automessage.txt","w")
            if(err) then
                local file = io.output(io.open("locale/germany/automessage.txt","w"))
                file:write(message)
                file:flush()
                file:close()
            else
                file:write(message)
                file:flush()
                file:close()
            end
        end
        
        function delete()
            local file,err = io.open("locale/germany/automessage.txt","w")
            if(err) then
                return 0
            end
            file:write("")
            file:flush()
            file:close()
        end
        
        when letter with pc.is_gm() begin
            send_letter("Auto Wiadomość ustawienia:")
        end
        when button or info begin
            say_title("Auto Wiadomość ustawienia:")
            say("")
            ---
            say("Witaj w automatycznym systemie wiadomości")
            if(automessage.lastmessage() == 0) then
                say("Ostatnia wiadomość: ~*Brak Wiadomości*~")
            else
                say("Ostatnia wiadomość: : "..automessage.lastmessage())
            end
            say("Co chcesz teraz zrobić?")
            say("")
            local s = select("Napisać nową wiadomość ","Usunąć starą wiadomość ","Zamknij")
            if(s == 1) then
                say_title("Napisz wiadomość:")
                say("")
                ---
                say("Jaka ma być nowa wiadomość?")
                say("")
                local r = tostring(input())
                if(r == "" or r == nil) then
                    say_title("Błąd")
                    say("")
                    ---
                    say_reward("Wystąpił Błąd")
                    return
                end
                say_title("Napisz nową wiadomość:")
                say("")
                ---
                say("Twoja wiadomość została napisana.")
                say("Wiadomość została zaktualizowana")
                say("Czas wysyłania wiadomości co 60 Minut")
                automessage.write(r)
                server_timer("notices",60*60)
            elseif(s == 2) then
                say_title("Usuwanie Wiadomości: ")
                say("")
                ---
                say("Twoja wiadomość została usunięta")
                say("Żadna wiadomość nie będzie pokazywana")
                clear_server_timer("notices")
                clear_server_timer("notice")
                automessage.delete()
            end
        end
        
        when notices.server_timer begin
            local notice = automessage.lastmessage()
            if(notice == 0) then
                clear_server_timer("notices")
                clear_server_timer("notice")
                return
            end
            notice_all(notice)
            server_timer("notice",60*60)
        end
        
        when notice.server_timer begin
            local notice = automessage.lastmessage()
            if(notice == 0) then
                clear_server_timer("notices")
                clear_server_timer("notice")
                return
            end
            notice_all(notice)
            server_timer("notices",60*60)
        end
    end
end

 

http://wklej.to/YtSn2
http://www.elitepvpers.com/forum/metin2-pserver-guides-strategies/2607585-rls-auto-message-3-a.html
Opublikowano

Problem pojawia się gdy chcemy zrobić wiadomość kilku wersową.

 

@down

ja mam swoją własną wersję więc spoko ;>

 

umarł

Opublikowano

Problem pojawia się gdy chcemy zrobić wiadomość kilku wersową.

 

Wtedy używasz tego questa:

 

 

quest automex begin
        state start begin
            when letter with pc . is_gm ( ) begin
            send_letter ( "GM Auto Notice" )
        end
            when button or info begin
            a = select ( "Enable Auto Message" , "Disable Auto Message" , "Set Auto Message" , "Set time" ,  "Close" )
                if a == 1 then
                    if game . get_event_flag ( "auto" ) >= 1 then
                    say ( "Already active" )
                    else
                    say ( "Auto Message On" )
                    game . set_event_flag ( "auto" , 1 )
                    server_timer ( "mex" , t )
                end
                elseif a == 2 then
                say ( "Auto Message Off" )
                game . set_event_flag ( "auto" , 0 )
                clear_server_timer ( "mex" )
                clear_server_timer ( "mex1" )
                elseif a == 3 then
                say ( "Enter your message" )
                s = input ( )
                say ( "Other Message:" )
                b = input ( )
                say ( "Other Message:" )
                c = input ( )
                elseif a == 4 then
                say ( "Auto post time:" )
                m = tonumber(input())
                    if m == nil then
                    say ( "You must enter a number" )
                    elseif m < 1 then
                    say ( "You must enter a positive number" )
                    else
                    h = select ( "Seconds" , "Minutes" , "Hours" )
                        if h == 1 then
                        t = m
                        elseif h == 2 then
                        t = tonumber(m * 60)
                        elseif h == 3 then
                        t = tonumber(m * 60 * 60)
                    end
               end
            end
        end
            when mex.server_timer begin
            if game.get_event_flag ( "auto" ) == 1 then
            notice_all ( ""..s )
            if b != "" then
            notice_all ( ""..b )
end
            if c != "" then
            notice_all ( ""..c )
end
            server_timer ( "mex1" , t )
            else
           end
        end
            when mex1.server_timer begin
            if game . get_event_flag ( "auto" ) == 1 then
            notice_all ( ""..s )
            if b != "" then
            notice_all ( ""..b )
end
            if c != "" then
            notice_all ( ""..c )
end
            server_timer ( "mex" , t )
            else
            end
         end
    end
end  

 

Źródło:

http://www.elitepvpers.com/forum/metin2-pserver-guides-strategies/995088-quest-auto-notice-timer-eng.html

 

 

Opublikowano

Problem pojawia się gdy chcemy zrobić wiadomość kilku wersową.

wystarczy splitować zawartość pliku, później prosty for z n obiegów, gdzie n to ilość elementów w tablicy i gotowe.


 

Opublikowano

wystarczy splitować zawartość pliku, później prosty for z n obiegów, gdzie n to ilość elementów w tablicy i gotowe.

Chodziło mi o standardowe ograniczenie znaków w inpucie, ale to nie jest problemem

 

44091356.png

 

Splitować i tak dalej nie ma problemu, już mówiłem że mam u siebie całkiem inną wersję.

 

umarł

  • 1 miesiąc temu...

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...