<!-- 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! ]]--
return "Note: No start time given, may have already ran."
end
end
local eastern_offset = tzopage.rawOffset+tzopage.dstOffset -- Adds the offset information together (includes Daylight Savings)
function get_tz_offset(dateTime, offset)
return eastern_offset
end
local xyear, xmonth, xday = string.match(dateTime,"(%d+)%-(%d+)%-(%d+)")
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 xhour, xmin = string.match(dateTime,"%a(%d+):(%d+)")
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_from_Eastern = os.time({year = xyear, month = xmonth, day = xday, hour = xhour or 23, min = xmin or 59, sec = 0}) + (offset*3600)
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
local UTC_time, local_time = os.time(os.date("!*t")), os.time()
local time_zone = os.difftime(local_time, UTC_time)
return os.date("%A, %B %d %Y at %I:%M%p", (utc_event_time-localoffset)) -- Should return local time of the event
end
local converted_time = UTC_from_Eastern + time_zone
return converted_time
function date_note(dateTime)
if string.match(dateTime, "%a%d+:%d+") then
return ""
else
return "Note: No start time given, may have already ran."
end
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 string.match(epic_list, epic:lower()) then
if epic:lower() == "icefall" or epic:lower() == "if" then