Content deleted Content added
No edit summary |
No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 50:
-- Whether to use tiebreak
local
local do_tiebr = false
if yesno(use_tiebr_val) then do_tiebr = true end
-- Ties and OTL
local use_tieOTL_val = Args['use_ties'] or 'no'
local do_ties = false
if yesno(use_tieOTL_val) then do_ties = true end
-- Initialize
Line 67 ⟶ 74:
tt = p_sub.colhead(tt,32,'<abbr title="Won">W</abbr>') -- Win col
tt = p_sub.colhead(tt,32,'<abbr title="Lost">L</abbr>') -- Loss col
if do_ties then
tt = p_sub.colhead(tt,32,'<abbr title="Ties">T</abbr>') -- Ties
end
tt = p_sub.colhead(tt,32,OTloss_head_text)
if
tt = p_sub.colhead(tt,32,tiebr_head_text)
end
Line 99 ⟶ 109:
local loss_points = tonumber(Args['losspoints']) or 0
local OTloss_points = tonumber(Args['OTlosspoints']) or 1
local ties_points = tonumber(Args['tiepoints']) or 1
-- Get some input
Line 104 ⟶ 115:
local losses = tonumber(Args['loss_'..team_code_ii]) or 0
local OTlosses = tonumber(Args['OTloss_'..team_code_ii]) or 0
local ties = tonumber(Args['ties_'..team_code_ii]) or 0
local tiebr_val = tonumber(Args['tiebr_'..team_code_ii]) or 0
local gfor = tonumber(Args['gf_'..team_code_ii]) or tonumber(Args['pf_'..team_code_ii]) or 0
Line 110 ⟶ 122:
local hth_local = Args['hth_'..team_code_ii] or nil
-- Then calculate some values
local matches = wins + losses + OTlosses + ties
local points = win_points*wins + loss_points*losses + OTloss_points*OTlosses + s_pts + ties_points*ties
-- Comparison of for against
Line 137 ⟶ 149:
-- Whether to use tiebreak
local
local do_tiebr = false
if yesno(use_tiebr_val) then do_tiebr = true end
-- Ties and OTL
local use_tieOTL_val = Args['use_ties'] or 'no'
local do_ties = false
if yesno(use_tieOTL_val) then do_ties = true end
-- Some local vars
Line 151 ⟶ 170:
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..wins..'\n') -- Won
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..losses..'\n') -- Lost
if do_ties then
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..ties..'\n') -- Ties
end
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..OTlosses..'\n') -- Lost in OT
if
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..tiebr_val..'\n') -- Tiebreaker value
end
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..gfor..'\n') -- GF
|