Changes

m
no edit summary
Line 34: Line 34:  
function numberKey(name, context, n, default)
 
function numberKey(name, context, n, default)
 
     return context and tonumber(context[name .. (n and tostring(n) or '')]) or default
 
     return context and tonumber(context[name .. (n and tostring(n) or '')]) or default
end
  −
  −
local function prefixEach(n)
  −
    return function(i)
  −
        return (i - 1) % n == 0 and string.format('!%d-%d', i, i - 1 + n)
  −
    end
   
end
 
end
   Line 45: Line 39:     
function Iterator.shipsByNo(context, n)
 
function Iterator.shipsByNo(context, n)
 +
    local function prefix(i)
 +
        if n == 2 then
 +
            i = i + 1300
 +
        end
 +
        return (i - 1) % 10 == 0 and string.format('!%d-%d', i, i - 1 + 10)
 +
    end
 
     local collection = require('Module:Collection/ShipsByNo' .. (n == 2 and 2 or 1))
 
     local collection = require('Module:Collection/ShipsByNo' .. (n == 2 and 2 or 1))
 
     local i = 0
 
     local i = 0
cssedit, gkautomate
7,064

edits