Jump to content
  • 0

Again.. is this possible?


Exygo

Question

  • Bronze

Hey, i want to ask some quest masters something :D

 

I can do something like this in quest? (doesn't work but you understand the purspose of the function) 

 

when (os.date("%A %H %M %S") == "Friday 19 05 01") begin

 

automatic event start code#

 

 

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0
  • Bronze

Might be use function - get_time(), but i am not sure which time format for that is correct.

 

I need to be global.. like server_timer but server timer is not a wise choose for what i need, if i restart the server i need to activate again and again, and if i /reload q timer dissapear

Link to comment
Share on other sites

  • 0
  • Bronze

 

You can try this:

when login with os.date("%A") == "Friday" begin
	--do stuff
end

It's not ok.. i have timers what call other timers what call respawn in a specific map... so with that every player will activate the timer again and again and again

Link to comment
Share on other sites

  • 0
  • Bronze

function isMyDay(dayname,hour,minute,second)
	if(dayname == "" or daynumber == "" or hour == "" or minute == "") then
		return 0
	elseif(tostring(dayname) == nil or tonumber(daynumber) == nil or tonumber(hour) == nil or tonumber(minute) == nil) then
		return 0
	end
	local dayName,iHour,iMinute,iSecond = os.date("%A"),os.date("%H"),os.date("%M"),os.date("%S")
	if(dayName == dayname and iHour == hour and iMinute == minute and iSecond == second) then
		return true
	else
		return false
	end
end
You can make automatic quest event system via lua but you should check this in 1 second. You can use server_timer for this.

 

Use this if you don't have any idea about lua. Test yourself codes via this service.

 

Kind Regards

Zerelth ~ Ellie

Edited by Zerelth™
  • Love 1

Do not be sorry, be better.

Link to comment
Share on other sites

  • 0
  • Bronze

So any idea to replace the usage of server_timer with other function :?

 

 

And when os.date do not?

 

 

I want to use os.date to make events on a specific hour, i'm trying to make it automatic, something like Tanaka event every 48h, but actually this structure 

 

when (os.date("%A %H %M %S") == "Friday 19 05 01") begin

 

doesn't work so i need something to check constantly instead of server_timer becouse it's not efficient

 

And when i say server_timer i mean this:

 

when auto_event.server_timer begin

if (os.date("%A %H %M %S") == "Friday 19 05 01") then

 

again i need something to work like this:

 

when (os.date("%A %H %M %S") == "Friday 19 05 01") begin [ This actually doesn't work ] 

Link to comment
Share on other sites

  • 0

when xx.chat."auto events" begin

s=select("A",D",E")

if s==1 then

server_loop_timer("auto_events_start", 1)

server_loop_timer("auto_events_end", 1)

syschat("A")

elseif s == 2 then

clear_server_timer("auto_events_start")

clear_server_timer("auto_events_end")

syschat("D")

end

when auto_events_start.server_timer begin

 

events_time_begin = os.date("%H")

if events_time == 19 then

game.set_event_flag("xx", x )

end

 

when auto_events_end begin

 

events_time_end = os.date("%H")

if events_time == 22 then

game.set_event_flag("xx", x )

notice_all("")

end

or table for all events will be better

events = {

[1] = {x, x,................}

[2] = {x, x,................ } put what you need

[3] = {x, x,................}

}

as well make sure you make flag check so as don't repeat activation

that's all

I hope this is what you ask for

^

all of this is example only

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


  • Activity

    1. 11

      When Uninstalling Gaya System

    2. 11

      When Uninstalling Gaya System

    3. 11

      When Uninstalling Gaya System

    4. 11

      When Uninstalling Gaya System

    5. 11

      When Uninstalling Gaya System

    6. 11

      When Uninstalling Gaya System

    7. 11

      When Uninstalling Gaya System

    8. 11

      When Uninstalling Gaya System

    9. 8

      Use Items with the Effect of Use

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.