Active Member Exygo 1091 Posted December 26, 2014 Active Member Share Posted December 26, 2014 Hey, i want to ask some quest masters something 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# https://www.youtube.com/channel/UCQ8mAeda9TWq6SsTzB53emw/videos Link to comment Share on other sites More sharing options...
Premium Necro 78 Posted December 26, 2014 Premium Share Posted December 26, 2014 Might be use function - get_time(), but i am not sure which time format for that is correct. Link to comment Share on other sites More sharing options...
Active Member Exygo 1091 Posted December 26, 2014 Author Active Member Share Posted December 26, 2014 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 https://www.youtube.com/channel/UCQ8mAeda9TWq6SsTzB53emw/videos Link to comment Share on other sites More sharing options...
Denis 1474 Posted December 26, 2014 Share Posted December 26, 2014 You can try this: when login with os.date("%A") == "Friday" begin --do stuff end Link to comment Share on other sites More sharing options...
Active Member Exygo 1091 Posted December 26, 2014 Author Active Member Share Posted December 26, 2014 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 https://www.youtube.com/channel/UCQ8mAeda9TWq6SsTzB53emw/videos Link to comment Share on other sites More sharing options...
Ken 904 Posted December 26, 2014 Share Posted December 26, 2014 (edited) 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 December 26, 2014 by Zerelth™ 1 Do not be sorry, be better. Link to comment Share on other sites More sharing options...
RachadoPT 26 Posted December 26, 2014 Share Posted December 26, 2014 If you use this os.date, people can easily break that system... They only need to change the date to the one where the event starts and then... idk... try to use a server_timer as Zerelth said... Link to comment Share on other sites More sharing options...
lolor2 73 Posted December 26, 2014 Share Posted December 26, 2014 If you use this os.date, people can easily break that system wrong os.date is always server time lua runs only on the server^^ 3 Link to comment Share on other sites More sharing options...
RachadoPT 26 Posted December 26, 2014 Share Posted December 26, 2014 If you use this os.date, people can easily break that system wrong os.date is always server time lua runs only on the server^^ That's true... My bad, sorry >< Link to comment Share on other sites More sharing options...
Active Member Exygo 1091 Posted December 27, 2014 Author Active Member Share Posted December 27, 2014 I'm trying to not use server_timer becouse it's not what i need, i'm searching something to check constantly if os.date..etc etc https://www.youtube.com/channel/UCQ8mAeda9TWq6SsTzB53emw/videos Link to comment Share on other sites More sharing options...
Minion 74 Posted December 27, 2014 Share Posted December 27, 2014 And when os.date do not? Link to comment Share on other sites More sharing options...
Active Member Exygo 1091 Posted December 27, 2014 Author Active Member Share Posted December 27, 2014 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 ] https://www.youtube.com/channel/UCQ8mAeda9TWq6SsTzB53emw/videos Link to comment Share on other sites More sharing options...
Active Member Exygo 1091 Posted December 30, 2014 Author Active Member Share Posted December 30, 2014 Any ideas? https://www.youtube.com/channel/UCQ8mAeda9TWq6SsTzB53emw/videos Link to comment Share on other sites More sharing options...
lolor2 73 Posted December 30, 2014 Share Posted December 30, 2014 well u could check the time and the server eventflag so that it only gets triggered one time but those are shitty ways use c++^^ Link to comment Share on other sites More sharing options...
Active Member Exygo 1091 Posted December 30, 2014 Author Active Member Share Posted December 30, 2014 There must be another way, i saw some people with game 2089.. and succed to make the automatic events https://www.youtube.com/channel/UCQ8mAeda9TWq6SsTzB53emw/videos Link to comment Share on other sites More sharing options...
Saud bin abdullah 7 Posted December 31, 2014 Share Posted December 31, 2014 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 More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now