Jump to content

Recommended Posts

Spoiler

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

Credits to: Superisi

Link to comment
https://metin2.dev/topic/16469-auto-notice-every-2-hours/#findComment-91115
Share on other sites

1 hour ago, kimameixede said:
  Hide contents

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

Credits to: Superisi

Thank you! But i need to notice an already text, without input every time! ^^

Link to comment
https://metin2.dev/topic/16469-auto-notice-every-2-hours/#findComment-91117
Share on other sites

  • Premium
-- They are 3 notices, if you only want 1, just remove the others two, change the timer("timer1") to just timer("timer") and create a when timer.timer
quest auto_notice begin
	state start begin
		when login begin
			timer("timer1", 7200) -- 2h in seconds, they set the timer for the timer1.timer
			notice("Mário 123") -- Your notice when you login // this will happen always you relog, alt, etc. If you don't what that, just remove.
		end
		when timer1.timer begin
			timer("timer2", 7200) -- Set the time for the next timer (timer2.timer)
			notice("Mário 123") -- The notice when the timer1 finish
		end
		when timer2.timer begin
			timer("timer", 7200) -- ""
			notice("Mário 123") -- ""
		end
	end
end

 

  • Love 1
Link to comment
https://metin2.dev/topic/16469-auto-notice-every-2-hours/#findComment-91123
Share on other sites

On 31/7/2017 at 5:14 AM, Mário. said:

-- They are 3 notices, if you only want 1, just remove the others two, change the timer("timer1") to just timer("timer") and create a when timer.timer
quest auto_notice begin
	state start begin
		when login begin
			timer("timer1", 7200) -- 2h in seconds, they set the timer for the timer1.timer
			notice("Mário 123") -- Your notice when you login // this will happen always you relog, alt, etc. If you don't what that, just remove.
		end
		when timer1.timer begin
			timer("timer2", 7200) -- Set the time for the next timer (timer2.timer)
			notice("Mário 123") -- The notice when the timer1 finish
		end
		when timer2.timer begin
			timer("timer", 7200) -- ""
			notice("Mário 123") -- ""
		end
	end
end

 

Thank you, but i want it with notice_all

Link to comment
https://metin2.dev/topic/16469-auto-notice-every-2-hours/#findComment-91212
Share on other sites

1 hour ago, monarchis2 said:

Thank you, but i want it with notice_all

Just change notice to notice_all

quest auto_notice begin
	state start begin
		when login begin
			timer("timer1", 7200) -- 2h in seconds, they set the timer for the timer1.timer
			notice_all("Mário 123") -- Your notice when you login // this will happen always you relog, alt, etc. If you don't what that, just remove.
		end
		when timer1.timer begin
			timer("timer2", 7200) -- Set the time for the next timer (timer2.timer)
			notice_all("Mário 123") -- The notice when the timer1 finish
		end
		when timer2.timer begin
			timer("timer", 7200) -- ""
			notice_all("Mário 123") -- ""
		end
	end
end

 

  • Love 1
Link to comment
https://metin2.dev/topic/16469-auto-notice-every-2-hours/#findComment-91217
Share on other sites

3 hours ago, Anyone said:

Just change notice to notice_all


quest auto_notice begin
	state start begin
		when login begin
			timer("timer1", 7200) -- 2h in seconds, they set the timer for the timer1.timer
			notice_all("Mário 123") -- Your notice when you login // this will happen always you relog, alt, etc. If you don't what that, just remove.
		end
		when timer1.timer begin
			timer("timer2", 7200) -- Set the time for the next timer (timer2.timer)
			notice_all("Mário 123") -- The notice when the timer1 finish
		end
		when timer2.timer begin
			timer("timer", 7200) -- ""
			notice_all("Mário 123") -- ""
		end
	end
end

 

If you do this way you'll get a notice for every player log in :P  But thank you anyway :) 

Link to comment
https://metin2.dev/topic/16469-auto-notice-every-2-hours/#findComment-91229
Share on other sites

----------------------------------------------------
----    Quest:    Auto Notice                   ----
----    Server:    Metin2 TBX                   ----
----    Author:    [Fr3zy]                      ----
----------------------------------------------------

quest auto_msg begin
    state start begin
        when login begin
            timer("msq_auto", 900)
        end
        when msq_auto.timer begin
            local msg_randome = number(1,3)
            msg = io.open(string.format("locale/romania/quest/files/msg/msg_%d.txt", msg_randome))
            notice(""..msg:read().."")
            timer("msq_auto2", 3600)
        end
        when msq_auto2.timer begin
            local msg_randome = number(1,3)
            msg = io.open(string.format("locale/romania/quest/files/msg/msg_%d.txt", msg_randome))
            notice(""..msg:read().."")
            timer("msq_auto", 3600)
        end
    end
end

That is a simple quest with 2 timers  first at 15 minutes from login after that at 30 minutes. You will need to change at :

msg = io.open...bla bla and make 3 files msg_1.txt 2 and 3.

 

Link to comment
https://metin2.dev/topic/16469-auto-notice-every-2-hours/#findComment-91246
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

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.