<!-- Saved on Thursday, September 10, 2015, 11:08 PM -->
<!-- Saved on Monday, October 26, 2015, 12:46 PM -->
<!-- MuClient version 4.98 -->
<!-- Plugin "Epic_Calendar" generated by Plugin Wizard -->
<!-- Plugin "Epic_CalendarV2" generated by Plugin Wizard -->
<muclient>
<plugin
name="Epic_Calendar"
name="Epic_CalendarV2"
author="Arcidayne"
id="b14b904695ffa4f7c77ba823"
id="365b29d0ecd49b468c0c00f5"
language="Lua"
purpose="Shows upcoming Epic Runs"
purpose="Future Epic events shown right in the MUD!"
save_state="y"
date_written="2015-09-10 23:06:41"
date_written="2015-10-26 12:43:55"
requires="4.00"
version="1.0"
version="2.0"
>
</plugin>
@ -33,10 +33,10 @@
sequence="100"
>
<send>if "%1" == "" then
ColourNote("white","","======================== How To Use =======================\\n\\ngetcal <if/icefall|inferno|oc|all>\\n\\n===========================================================")
tzpage = "https://maps.googleapis.com/maps/api/timezone/json?location=28.4158,-81.2989×tamp=" .. time .. "&key=AIzaSyBv_QnejlevQTnNxF3sF-j0NxzkDLOv4fY" -- Gets offset data for Eastern Time Zone
-- [[Many thanks to Shaelynne for keeping everyone up-to-date with the Epic Calendars! ]]--
local eastern_offset = tzopage.rawOffset+tzopage.dstOffset -- Adds the offset information together (includes Daylight Savings)
return eastern_offset
end
function get_local_time(dateTime)
local xyear, xmonth, xday = string.match(dateTime, "(%d+)%-(%d+)%-(%d+)") -- Date format is displayed as yyyy-mm-dd
local xhour, xmin = string.match(dateTime, "%a(%d+):(%d+)") -- Time format is displayed as Thh:mm
local event_time = os.time({year = xyear, month = xmonth, day = xday, hour = xhour or 23, min = xmin or 59, sec = 0}) -- Gets epoch time for event time
local utc_event_time = event_time-get_eastern_offset(event_time) -- Sets UTC's time for the event
local utctime, localtime = os.date("!*t", utc_event_time), os.date("*t", utc_event_time) -- Sets table data for events based on UTC's time of the event
localtime.isdst = false
local localoffset = os.difftime(os.time(utctime), os.time(localtime)) -- Sets the time difference between UTC and local time at the time of the event UTC
return os.date("%A, %B %d %Y at %I:%M%p", (utc_event_time-localoffset)) -- Should return local time of the event
end
function date_note(dateTime)
@ -65,31 +87,14 @@ function date_note(dateTime)
end
end
function get_tz_offset(dateTime, offset)
local xyear, xmonth, xday = string.match(dateTime,"(%d+)%-(%d+)%-(%d+)")
local xhour, xmin = string.match(dateTime,"%a(%d+):(%d+)")
local UTC_from_Eastern = os.time({year = xyear, month = xmonth, day = xday, hour = xhour or 23, min = xmin or 59, sec = 0}) + (offset*3600)
local UTC_time, local_time = os.time(os.date("!*t")), os.time()
local time_zone = os.difftime(local_time, UTC_time)
local converted_time = UTC_from_Eastern + time_zone
return converted_time
end
function get_cal(epic)
async_ok, async = pcall (require, "async")
json = require 'json'
require('tprint')
local cal_output = {}
local epic_list, key, calid = "all if icefall inferno oc", "AIzaSyAHEnr8iiK42hzM21pXSbTrBIQ2ezEEUHA", ""
if string.match(epic_list, epic:lower()) then
if epic:lower() == "icefall" or epic:lower() == "if" then