The game I play gives uptime in this format:
Game has been up for 2d 10h 13m 49s.
If any of those numbers is zero, it's left out, such as:
Game has been up for 5h 13s.
I'm trying to break this down into seconds total, minus any full two-hour blocks. My understanding of Lua is practically nonexistent, though, so I'm not entirely sure how to proceed. My assumption is that I would use utils.split to get each figure into a table, check each value in the table for the associated letter, multiply the numeric part accordingly, add that to a variable, and loop until everything was done. Then I'd subtract 86400 from the variable in another loop until the variable was less than 86400. I just have no idea how to do any of these things. :( Any help would be appreciated.
Game has been up for 2d 10h 13m 49s.
If any of those numbers is zero, it's left out, such as:
Game has been up for 5h 13s.
I'm trying to break this down into seconds total, minus any full two-hour blocks. My understanding of Lua is practically nonexistent, though, so I'm not entirely sure how to proceed. My assumption is that I would use utils.split to get each figure into a table, check each value in the table for the associated letter, multiply the numeric part accordingly, add that to a variable, and loop until everything was done. Then I'd subtract 86400 from the variable in another loop until the variable was less than 86400. I just have no idea how to do any of these things. :( Any help would be appreciated.