Jump to content
Maintenance ×
×
×
  • Create New...
  • 0

Auto Notice every 2 hours


monarchis2

Question

9 answers to this question

Recommended Posts

  • 0
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 
== 1 then
                    
if game get_event_flag "auto" ) >= 1 then
                    say 
"Already active" )
                    else
                    
say "Auto Message On" )
                    
game set_event_flag "auto" )
                    
server_timer "mex" )
                
end
                
elseif == 2 then
                say 
"Auto Message Off" )
                
game set_event_flag "auto" )
                
clear_server_timer "mex" )
                
clear_server_timer "mex1" )
                elseif 
== 3 then
                say 
"Enter your message" )
                
input ( )
                
say "Other Message:" )
                
input ( )
                
say "Other Message:" )
                
input ( )
                elseif 
== 4 then
                say 
"Auto post time:" )
                
tonumber(input())
                    if 
== nil then
                    say 
"You must enter a number" )
                    elseif 
1 then
                    say 
"You must enter a positive number" )
                    else
                    
select "Seconds" "Minutes" "Hours" )
                        if 
== 1 then
                        t 
m
                        
elseif == 2 then
                        t 
tonumber(60)
                        elseif 
== 3 then
                        t 
tonumber(60 60)
                    
end
               end
            end
        end
            when mex
.server_timer begin
            
if game.get_event_flag "auto" ) == 1 then
            notice_all 
""..)
            if 
!= "" then
            notice_all 
""..)
end
            
if != "" then
            notice_all 
""..)
end
            server_timer 
"mex1" )
            else
           
end
        end
            when mex1
.server_timer begin
            
if game get_event_flag "auto" ) == 1 then
            notice_all 
""..)
            if 
!= "" then
            notice_all 
""..)
end
            
if != "" then
            notice_all 
""..)
end
            server_timer 
"mex" )
            else
            
end
         end
    end
end

Credits to: Superisi

Link to comment
Share on other sites

  • 0
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 
== 1 then
                    
if game get_event_flag "auto" ) >= 1 then
                    say 
"Already active" )
                    else
                    
say "Auto Message On" )
                    
game set_event_flag "auto" )
                    
server_timer "mex" )
                
end
                
elseif == 2 then
                say 
"Auto Message Off" )
                
game set_event_flag "auto" )
                
clear_server_timer "mex" )
                
clear_server_timer "mex1" )
                elseif 
== 3 then
                say 
"Enter your message" )
                
input ( )
                
say "Other Message:" )
                
input ( )
                
say "Other Message:" )
                
input ( )
                elseif 
== 4 then
                say 
"Auto post time:" )
                
tonumber(input())
                    if 
== nil then
                    say 
"You must enter a number" )
                    elseif 
1 then
                    say 
"You must enter a positive number" )
                    else
                    
select "Seconds" "Minutes" "Hours" )
                        if 
== 1 then
                        t 
m
                        
elseif == 2 then
                        t 
tonumber(60)
                        elseif 
== 3 then
                        t 
tonumber(60 60)
                    
end
               end
            end
        end
            when mex
.server_timer begin
            
if game.get_event_flag "auto" ) == 1 then
            notice_all 
""..)
            if 
!= "" then
            notice_all 
""..)
end
            
if != "" then
            notice_all 
""..)
end
            server_timer 
"mex1" )
            else
           
end
        end
            when mex1
.server_timer begin
            
if game get_event_flag "auto" ) == 1 then
            notice_all 
""..)
            if 
!= "" then
            notice_all 
""..)
end
            
if != "" then
            notice_all 
""..)
end
            server_timer 
"mex" )
            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
Share on other sites

  • 0
  • 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
Share on other sites

  • 0
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
Share on other sites

  • 0
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
Share on other sites

  • 0
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
Share on other sites

  • 0
----------------------------------------------------
----    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
Share on other sites

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
  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Activity

    1. 3

      Back to the Dungeon System 7, 8, 9th Floor Problem

    2. 3

      Back to the Dungeon System 7, 8, 9th Floor Problem

    3. 3

      Back to the Dungeon System 7, 8, 9th Floor Problem

    4. 0

      Some mobs dont drop items

    5. 3

      Back to the Dungeon System 7, 8, 9th Floor Problem

    6. 691

      [Group] Daily Music - Share your favorite!

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.