|
Loftaris |
Posted: Wed Aug 18, 2010 2:09 pm
Help turning a % into a time |
|
Loftaris Adept
Joined: 24 Aug 2004 Posts: 277
|
Posted: Sun Dec 18, 2011 12:01 am |
File: . Line: 6 Col: 9 Error: Invalid element name: "
|
|
|
|
Loftaris Adept
Joined: 24 Aug 2004 Posts: 277
|
Posted: Sun Dec 18, 2011 12:01 am |
oops sorry, unsure how to delete this one.. firefox froze.
File: . Line: 6 Col: 9 Error: Invalid element name: " |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sun Dec 18, 2011 12:27 am |
Oh, the reason why is because the forum changes the html entities into their > and < counterparts, which messes things up. I forgot about that. Instead, I'll just step you through it.
1. Create the trigger: Likelihood of Flux: (%f)~%
2. Change the language to Lua (top right corner, dropdown box).
3. Copy/paste the stuff below into the value box.
Code: |
local function addZero(n)
if n < 10 then
n = "0" .. n
end
return n
end
totalsecs = ((100-zs.param(1))/100)*3600
totalmins = math.floor(totalsecs/60)
remaindersecs = math.floor(totalsecs%60)
fluxtime = os.time()+totalsecs
fluxhour = os.date('*t',fluxtime).hour
fluxmin = os.date('*t',fluxtime).min
fluxsec = os.date('*t',fluxtime).sec
if fluxhour > 12 then
fluxhour = fluxhour - 12
fluxap = "p"
else
fluxap = "a"
end
zs.sayadd(" [ " .. totalmins .. "m " .. addZero(remaindersecs) .. "s (" .. fluxhour .. ":" .. addZero(fluxmin) .. "." .. addZero(fluxsec) .. fluxap .. ") ]") |
That should do what you need to do. |
|
|
|
Loftaris Adept
Joined: 24 Aug 2004 Posts: 277
|
Posted: Sun Dec 18, 2011 1:16 am |
You sir, are awesome.
I truly appreciate your patience, and thank you so very much!
Best holiday season to you, whichever you choose to celebrate! |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|