UPDATE 02/20/2016 -- v1.3
--Split the AddEvent command into AddEvent and AddEventGM to simplify input and resolve issues with GM events not showing properly (per the recommendation of Jose P.)
UPDATE 11/18/2015 -- v1.2
---Fixed the bug where the events added on the last day of the month did not display properly.
---Fixed the bug where Public events were not added as Public when added using option 3 (add by days)
Thank you again to Gozer for catching them!
UPDATE 11/18/2015 -- v1.1
--Added functionality to be able to add events by days forward or back in addition to by a specific date.
--Fixed the bug where names with spaces caused part of the name to be included in confirmation message whispers (Thanks to Gozer the Gozeran for the catch!).
**All changes are reflected in the instructions below where appropriate**
ORIGINAL POST (with updated documentation for features)
I took a stab at some additions to Aaron's Mystara Calendar script (original script thread) for one of my upcoming campaigns and I thought I would share it.
Basically I am too lazy to write things down so I went this route :).
Below is documentation on the new functionality and a link to the code:
GitHub link:https://github.com/Cephalopd/Roll20ScriptsMASTER/b...
New Commands:
!cal AddEvent target name --- This command adds a PUBLIC event to the calendar.
example !cal AddEvent 11 12 1001 Harvest Festival
--target - 3 options
1) Today - adds event at on the current calendar day
example: !cal AddEvent Today Harvest Festival
2) Specific Date dd mm yyyy - adds an event at the specified date
example: !cal AddEvent 11 12 1001 Harvest Festival
3) A single numeric value which will add an event that number if days in the future (if positive) or past (if negative)
example: !cal AddEvent 10 Harvest Festival
--name - The name of the event. All text after the target and/or gm flag will be entered as the name of the event
!cal AddEventGM target name --- This command adds a GM event to the calendar.
!cal RemoveEvent name --- This command removes the first event it encounters with a matching name.
example !cal RemoveEvent Harvest Festival
--name - The name of the event to be removed. It is NOT case sensitive but must match exactly in other respects
!cal GetEvents tense range -- This command makes the script whisper a table of the events to the player who sent the command. It will only show Public events to players and all events to GMs
example !cal GetEvents Past 100
--tense - 3 Options
1) Past - Events from the current day backwards to the first event or range limit set
2) Present - Events for the current day only
3) Future - Events from the current day forward to the last event or range limit set
--range - An optional numeric value to limit the number of days in the future or past for which events will be listed
!cal DisplayEvents tense range -- This functions as !cal GetEvents except it sends a table into chat containing only public events specified
Changes to Existing Commands:
!cal today - Below the date text this command now also sends an event table into chat containing only public events. If there are GM only events it whispers a second table to the GM only.
!cal next - Same functionality as !cal today for the new date the calendar is set to
! cal prev - Same functionality as !cal today for the new date the calendar is set to
KNOWN ISSUES:
Currently if you have two events with the same name, only the first one will be shown if both are in the range you Get or Display. I am working on a work around or fix for this issue. For now, make sure your events are all uniquely named or that events with the same name won't be called up in the same table. My apologies for the invconvinience.
Caveats:
I absolutely built this script with my own needs and requirements in mind. I tried to make things a little more general use but if it is useful to some of you and there is additional functionality you could use please let me know and I will take a stab at it.
Additionally my formatting skills are still Level 1 so there isn't a great visual match with Aaron's original designs. I realize the roll templates are a bit jarring but its the best I could muster with my current skill set :)
I've done a fair bit of unit testing and think I have hammered out most of the bugs, but I inevitably missed some. When you find them let me know and I will be happy to try and fix them!
Please feel free to critique the script or let me know if there are things I can do to make it more useful for any of you!
--Split the AddEvent command into AddEvent and AddEventGM to simplify input and resolve issues with GM events not showing properly (per the recommendation of Jose P.)
UPDATE 11/18/2015 -- v1.2
---Fixed the bug where the events added on the last day of the month did not display properly.
---Fixed the bug where Public events were not added as Public when added using option 3 (add by days)
Thank you again to Gozer for catching them!
UPDATE 11/18/2015 -- v1.1
--Added functionality to be able to add events by days forward or back in addition to by a specific date.
--Fixed the bug where names with spaces caused part of the name to be included in confirmation message whispers (Thanks to Gozer the Gozeran for the catch!).
**All changes are reflected in the instructions below where appropriate**
ORIGINAL POST (with updated documentation for features)
I took a stab at some additions to Aaron's Mystara Calendar script (original script thread) for one of my upcoming campaigns and I thought I would share it.
Basically I am too lazy to write things down so I went this route :).
Below is documentation on the new functionality and a link to the code:
GitHub link:https://github.com/Cephalopd/Roll20ScriptsMASTER/b...
New Commands:
!cal AddEvent target name --- This command adds a PUBLIC event to the calendar.
example !cal AddEvent 11 12 1001 Harvest Festival
--target - 3 options
1) Today - adds event at on the current calendar day
example: !cal AddEvent Today Harvest Festival
2) Specific Date dd mm yyyy - adds an event at the specified date
example: !cal AddEvent 11 12 1001 Harvest Festival
3) A single numeric value which will add an event that number if days in the future (if positive) or past (if negative)
example: !cal AddEvent 10 Harvest Festival
--name - The name of the event. All text after the target and/or gm flag will be entered as the name of the event
!cal AddEventGM target name --- This command adds a GM event to the calendar.
The functionality of this command is the same as above except it adds an event visible only to the GM.
!cal RemoveEvent name --- This command removes the first event it encounters with a matching name.
example !cal RemoveEvent Harvest Festival
--name - The name of the event to be removed. It is NOT case sensitive but must match exactly in other respects
!cal GetEvents tense range -- This command makes the script whisper a table of the events to the player who sent the command. It will only show Public events to players and all events to GMs
example !cal GetEvents Past 100
--tense - 3 Options
1) Past - Events from the current day backwards to the first event or range limit set
2) Present - Events for the current day only
3) Future - Events from the current day forward to the last event or range limit set
--range - An optional numeric value to limit the number of days in the future or past for which events will be listed
!cal DisplayEvents tense range -- This functions as !cal GetEvents except it sends a table into chat containing only public events specified
Changes to Existing Commands:
!cal today - Below the date text this command now also sends an event table into chat containing only public events. If there are GM only events it whispers a second table to the GM only.
!cal next - Same functionality as !cal today for the new date the calendar is set to
! cal prev - Same functionality as !cal today for the new date the calendar is set to
KNOWN ISSUES:
Currently if you have two events with the same name, only the first one will be shown if both are in the range you Get or Display. I am working on a work around or fix for this issue. For now, make sure your events are all uniquely named or that events with the same name won't be called up in the same table. My apologies for the invconvinience.
Caveats:
I absolutely built this script with my own needs and requirements in mind. I tried to make things a little more general use but if it is useful to some of you and there is additional functionality you could use please let me know and I will take a stab at it.
Additionally my formatting skills are still Level 1 so there isn't a great visual match with Aaron's original designs. I realize the roll templates are a bit jarring but its the best I could muster with my current skill set :)
I've done a fair bit of unit testing and think I have hammered out most of the bugs, but I inevitably missed some. When you find them let me know and I will be happy to try and fix them!
Please feel free to critique the script or let me know if there are things I can do to make it more useful for any of you!