Jump to content

Again.. is this possible?


Recommended Posts

  • 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

  • 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

  • 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

  • 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

  • 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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • 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.