Posted 24 January 2014 - 05:09 PM
Hello
I am making a game board, which shows the teams points countdown and all that stuff…
but im having trouble converting an "advanced" timesetting-string into seconds, or into another form.
the timesetting unconverted
the timesetting converted ( as I want it to be )
At the beginning i tried with:
I've tried with different string.gsub's but I find it really hard to find the matching patterns for this usage…
Any help is appreciated.
Thanks in Advance
I am making a game board, which shows the teams points countdown and all that stuff…
but im having trouble converting an "advanced" timesetting-string into seconds, or into another form.
the timesetting unconverted
"15m|30s"
the timesetting converted ( as I want it to be )
##--converted into seconds and then into a hour, minute, and a seconds variable:
hours=0
minutes=0
seconds=0
-- converting thingy here:
hours = convertedHours -- is now 0
minutes = convertedMinutes -- is now 15
seconds = convertedSeconds -- is now 30
At the beginning i tried with:
string.gsub(advancedtime,"|(.-)%a","")
I've tried with different string.gsub's but I find it really hard to find the matching patterns for this usage…
Any help is appreciated.
Thanks in Advance
Edited on 24 January 2014 - 05:04 PM