SotaLore news

Discussion in 'Player Created Resources' started by Gravidy, Mar 11, 2023.

Thread Status:
Not open for further replies.
  1. Gravidy

    Gravidy Avatar

    Messages:
    257
    Likes Received:
    613
    Trophy Points:
    28
    Gender:
    Male
    Location:
    San Francisco, CA
    Hey All.

    I've made a few updates (hopefully improvements) to SotaLore, and specifically the farming section.

    In response to this wishlist thread, I have added an ability to either download or copy a link to the farming calculator. This will let you add a "calendar" to whatever calendar app you use, and setup alarms for the second and third waterings.

    https://www.sotalore.com/farming

    [​IMG]

    To be honest, I'm a little doubtful this is going to be very useful. It's a bit clunky to import this data in to your own calendar. Maybe there's a way to improve on that, and I'll keep looking for a way to do this.

    I'm also seriously considering setting up email notifications right from sotalore itself, although that will take quite a bit more work.

    Please feel free to provide any feedback into this thread. (even if it has nothing to do with the farming tools :))

    Thanks,
    Gravidy
     
  2. Tahru

    Tahru Avatar

    Messages:
    4,800
    Likes Received:
    12,170
    Trophy Points:
    165
    Gender:
    Male
    Location:
    Spite
    I will give it a go in the next cycle! Thanks!
     
  3. Warrior B'Patrick

    Warrior B'Patrick Avatar

    Messages:
    1,222
    Likes Received:
    2,409
    Trophy Points:
    113
    Gender:
    Male
    Location:
    Athens, Georgia, USA
    Greetings Gravidy
    Would it be possible to create a file as an .ics? I am not sure how data can be exported as a file to download. If it can be the user would just dbl click on the file and it would import into what ever calendar program they are using. If not it could output as text message so the user could copy and paste then save it as an ics file.

    Instructions copied from https://devguide.calconnect.org/Data-Model/Simple-Event/

    Creating Simple Events
    On this page we describe creating a simple non-recurring event. We will show the contents of an ics file that represents the event. An ics file is a representation of calendar events in the standard format with a filename that ends with “.ics”.

    An ics file contains a VCALENDAR object which contains one or more events.

    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//ABC Corporation//NONSGML My Product//EN
    events go here
    END:VCALENDAR

    Then BEGIN and END of the VCALENDAR object are required and there should be only one VCALENDAR object per file.

    The VERSION property is required and currently always has the value 2.0. The PRODID should have a value that identifies your organization.

    As an example we will create an event describing a period in time - a 1 hour lunch meeting. This event has the following properties:

    • start - the date, time and timezone identifier
    • duration
    • a uid
    • a summary - the title for the event
    We will add further properties later. For now this event added to the ics file will look like:

    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//ABC Corporation//NONSGML My Product//EN
    BEGIN:VEVENT
    SUMMARY:Lunchtime meeting
    UID:ff808181-1fd7389e-011f-d7389ef9-00000003
    DTSTART;TZID=America/New_York:20160420T120000
    DURATION:pT1H
    END:VEVENT

    END:VCALENDAR

    Note that the order of properties within a component is irrelevant.

    SUMMARY
    SUMMARY:Lunchtime meeting

    The summary property provides a title for the event. It should be brief but descriptive.

    UID
    UID:ff808181-1fd7389e-011f-d7389ef9-00000003

    This is a globally unique identifier for the event. It must not change if the event is altered or republished. This property is used by clients to identify the event. Events with a different UID are different events - even if they are at the same time.

    The value should be guaranteed to be unique and should follow the rules of RFC 4122 A Universally Unique Identifier (UUID) URN Namespace. A uuid generator can do this. (Some reference to a UID generator?)

    DTSTART
    DTSTART;TZID=America/New_York:20160420T120000

    This defines the start of the event. In this case it is shown as a local time of 12:00:00, that is midday. Additionally there is a timezone parameter which shows that the time must be interpreted as being in that timezone. (Need a reference to a place of identify timezone)

    The date and time part has the form

    date T time

    where

    date is year month day in numeric form with no delimiters
    time is hours minutes seconds in numeric form with no delimiters

    DURATION
    DURATION:pT1H

    The duration property takes a value which has the form

    P [days] [T [hours][minutes]]

    where

    days is a number
    hours is a number followed by "H"
    minutes is a number followed by "M"

    Going further - where?
    While the above is sufficient for many cases it may not be enough. Where are we having our lunch meeting? For this we have the LOCATION property.

    This property has a simple text value - make sure the value has enough information for all users of the event. For example, the value “Room 123” may not be enough for those who don’t know which building.

    For our example we assume it’s in a downtown establishment:

    LOCATION:Mo's bar - back room

    The full ics file now looks like:

    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//ABC Corporation//NONSGML My Product//EN
    BEGIN:VEVENT
    SUMMARY:Lunchtime meeting
    UID:ff808181-1fd7389e-011f-d7389ef9-00000003
    DTSTART;TZID=America/New_York:20160420T120000
    DURATION:pT1H
    LOCATION:Mo's bar - back room
    END:VEVENT
    END:VCALENDAR

    Going further - why?
    We know when the meeting takes place, and now we know where. But why are we meeting? For this we have the DESCRIPTION property. This property can take a (very) long description of the event. There are some rules that must be followed.

    • Line feeds MUST be represented as “\n”
    • Continuation lines MUST start with a space (true for any property)
    So the description might be something like:

    DESCRIPTION: We'll continue with the unfinished business from last time,\n
    in particular:\n
    Can names start with a number?\n
    What if they are all numeric?\n
    Reuse of names - is it valid\n
    I remind the attendees we have spent 3 months on these subjects. We need
    closure!!!

    So now our full ics file looks like:

    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//ABC Corporation//NONSGML My Product//EN
    BEGIN:VEVENT
    SUMMARY:Lunchtime meeting
    UID:ff808181-1fd7389e-011f-d7389ef9-00000003
    DTSTART;TZID=America/New_York:20160420T120000
    DURATION:pT1H
    DESCRIPTION: We'll continue with the unfinished business from last time,\n
    in particular:\n
    Can names start with a number?\n
    What if they are all numeric?\n
    Reuse of names - is it valid\n
    I remind the attendees we have spent 3 months on these subjects. We need
    closure!!!

    LOCATION:Mo's bar - back room
    END:VEVENT
    END:VCALENDAR
     
    Last edited: Mar 11, 2023
  4. Gravidy

    Gravidy Avatar

    Messages:
    257
    Likes Received:
    613
    Trophy Points:
    28
    Gender:
    Male
    Location:
    San Francisco, CA
    It does download as a ".ics" file. The response header for "content-disposition" looks like: "attachment; filename="SOTA Farm Watering.ics"; filename*=UTF-8''SOTA%20Farm%20Watering.ics"

    (note the filename starts with whatever is in the input field to the left of download)

    Is there something unexpected happening (or not happening)? I certainly may have missed some specific detail.
     
    Margaritte likes this.
  5. Tahru

    Tahru Avatar

    Messages:
    4,800
    Likes Received:
    12,170
    Trophy Points:
    165
    Gender:
    Male
    Location:
    Spite
    I just tested this feature out and it worked seamlessly. I downloaded it and dragged it to my online calendar, easy. :)

    A couple thoughts...

    Firstly, I use the calendar to get the email notifications for the events. The "Harvest" event is missing. It would be good to have a 30 min event for that.

    Second, and really not important, the events do not need to be the full window time because the goal is just to be notified by email. So 30 min would be fine. Plus that makes it easier for people to manage if they want to shift it around on their calendar to avoid notifications in the middle of the night or whatever. This is really not a big deal though.
     
  6. Isabel Ayin

    Isabel Ayin Avatar

    Messages:
    651
    Likes Received:
    1,685
    Trophy Points:
    105
    Gender:
    Female
    Location:
    Umbra
    In any case, the work is appreciated, SotALore is a great tool, both for agriculture and for many other aspects of the game.
    I've been using it for a long time to keep track of watering time and find out where seeds are sold and recently discovered that I can find out how much XP I need to level up skills.
    Thank you very much for developing this tool.
     
    Gravidy, Anpu and Tahru like this.
  7. Gravidy

    Gravidy Avatar

    Messages:
    257
    Likes Received:
    613
    Trophy Points:
    28
    Gender:
    Male
    Location:
    San Francisco, CA
    I've added an event (and alarm) for the Harvest.

    Good feedback. I've reduced the size of all events to 30 minutes, so they can be easily moved around in whatever calendar you use.

    I've also changed the calendar data to use UTC, instead of trying to figure out "local time". Hopefully this will work with most calendaring software.

    I did notice that google calendar works fine when importing the downloaded ICS file. However, it doesn't work very well when "subscribing" to the calendar URL. I'm not sure if a different data format is needed for that, but if it is a problem I can look into it.
     
  8. Tahru

    Tahru Avatar

    Messages:
    4,800
    Likes Received:
    12,170
    Trophy Points:
    165
    Gender:
    Male
    Location:
    Spite
    Thank you!
     
    Gravidy and FrostII like this.
  9. Tahru

    Tahru Avatar

    Messages:
    4,800
    Likes Received:
    12,170
    Trophy Points:
    165
    Gender:
    Male
    Location:
    Spite
    @Gravidy I used the latest calendar download just now and it is obsoletely perfect! Thank you!
     
    Gravidy and FrostII like this.
  10. FrostII

    FrostII Bug Hunter

    Messages:
    5,891
    Likes Received:
    11,040
    Trophy Points:
    153
    Gender:
    Male
    Location:
    Pacific Northwest
    Your work is amazing, @Gravidy !
    Thank you very much for sharing it with us :)
     
    Gravidy and Tahru like this.
Thread Status:
Not open for further replies.