模块:ItemInfo:修订间差异

添加5,701字节 、​ 2024年6月8日 (星期六)
改善高开销解析器滥用
(增加可用参数)
(改善高开销解析器滥用)
第295行: 第295行:


function p.listArmorsInAt1()
function p.listArmorsInAt1()
     result = {}
     local html = mw.html.create('table'):addClass('wikitable')
 
    html:tag('tr')
        :tag('th'):wikitext('ID'):done()
        :tag('th'):wikitext('索引'):done()
        :tag('th'):wikitext('名称'):done()
        :tag('th'):wikitext('卖价'):done()
        :tag('th'):wikitext('配方'):done()
   
    local baseIndex = 19
     for i = 1, 29 do
     for i = 1, 29 do
         table.insert(result, p.at1ItemInfo('装备', '防具', i))
         local item = p.getItemInfoByIndex('AT1', '防具', i)
        local recipe = '-'
        if item.base.synthesisable ~= '0' then
            recipe = ci.getRecipeCardNameById(item.base.rc_id)
        end
        html:tag('tr')
            :tag('td'):wikitext(tostring(baseIndex + i)):done()
            :tag('td'):wikitext(tostring(i)):done()
            :tag('td'):wikitext('[[攻略:AT1/物品/' .. item.name .. '|' .. item.name .. ']]'):done()
            :tag('td'):wikitext(tostring(item.base.sell_price)):done()
            :tag('td'):wikitext(recipe):done()
     end
     end
     return table.concat(result, '\n')
     return tostring(html)
end
end


function p.listWeaponsInAt1()
function p.listWeaponsInAt1()
     result = {}
     local html = mw.html.create('table'):addClass('wikitable')
 
    html:tag('tr')
        :tag('th'):wikitext('ID'):done()
        :tag('th'):wikitext('索引'):done()
        :tag('th'):wikitext('名称'):done()
        :tag('th'):wikitext('卖价'):done()
        :tag('th'):wikitext('配方'):done()
   
    local baseIndex = 190
     for i = 1, 35 do
     for i = 1, 35 do
         table.insert(result, p.at1ItemInfo('装备', '武器', i))
         local item = p.getItemInfoByIndex('AT1', '武器', i)
        local recipe = '-'
        if item.base.synthesisable ~= '0' then
            recipe = ci.getRecipeCardNameById(item.base.rc_id)
        end
        html:tag('tr')
            :tag('td'):wikitext(tostring(baseIndex + i)):done()
            :tag('td'):wikitext(tostring(i)):done()
            :tag('td'):wikitext('[[攻略:AT1/物品/' .. item.name .. '|' .. item.name .. ']]'):done()
            :tag('td'):wikitext(tostring(item.base.sell_price)):done()
            :tag('td'):wikitext(recipe):done()
     end
     end
     return table.concat(result, '\n')
     return tostring(html)
end
end


function p.listAccessoriesInAt1()
function p.listAccessoriesInAt1()
     result = {}
     local html = mw.html.create('table'):addClass('wikitable')
 
    html:tag('tr')
        :tag('th'):wikitext('ID'):done()
        :tag('th'):wikitext('索引'):done()
        :tag('th'):wikitext('名称'):done()
        :tag('th'):wikitext('卖价'):done()
        :tag('th'):wikitext('配方'):done()
   
    local baseIndex = -1
     for i = 1, 20 do
     for i = 1, 20 do
         table.insert(result, p.at1ItemInfo('装备', '饰品', i))
         local item = p.getItemInfoByIndex('AT1', '饰品', i)
        local recipe = '-'
        if item.base.synthesisable ~= '0' then
            recipe = ci.getRecipeCardNameById(item.base.rc_id)
        end
        html:tag('tr')
            :tag('td'):wikitext(tostring(baseIndex + i)):done()
            :tag('td'):wikitext(tostring(i)):done()
            :tag('td'):wikitext('[[攻略:AT1/物品/' .. item.name .. '|' .. item.name .. ']]'):done()
            :tag('td'):wikitext(tostring(item.base.sell_price)):done()
            :tag('td'):wikitext(recipe):done()
     end
     end
     return table.concat(result, '\n')
     return tostring(html)
end
end


function p.listMaterialsInAt1()
function p.listMaterialsInAt1()
     result = {}
     local html = mw.html.create('table'):addClass('wikitable')
 
    html:tag('tr')
        :tag('th'):wikitext('ID'):done()
        :tag('th'):wikitext('索引'):done()
        :tag('th'):wikitext('名称'):done()
        :tag('th'):wikitext('卖价'):done()
        :tag('th'):wikitext('配方'):done()
   
    local baseIndex = 60
     for i = 1, 34 do
     for i = 1, 34 do
         table.insert(result, p.at1ItemInfo('材料', '采集', i))
         local item = p.getItemInfoByIndex('AT1', '材料物品', i)
        local recipe = '-'
        if item.base.synthesisable ~= '0' then
            recipe = ci.getRecipeCardNameById(item.base.rc_id)
        end
        html:tag('tr')
            :tag('td'):wikitext(tostring(baseIndex + i)):done()
            :tag('td'):wikitext(tostring(i)):done()
            :tag('td'):wikitext('[[攻略:AT1/物品/' .. item.name .. '|' .. item.name .. ']]'):done()
            :tag('td'):wikitext(tostring(item.base.sell_price)):done()
            :tag('td'):wikitext(recipe):done()
     end
     end
     return table.concat(result, '\n')
     return tostring(html)
end
end


function p.listMelcMaterialsInAt1()
function p.listMelcMaterialsInAt1()
     result = {}
     local html = mw.html.create('table'):addClass('wikitable')
 
    html:tag('tr')
        :tag('th'):wikitext('ID'):done()
        :tag('th'):wikitext('索引'):done()
        :tag('th'):wikitext('名称'):done()
        :tag('th'):wikitext('卖价'):done()
        :tag('th'):wikitext('配方'):done()
   
    local baseIndex = 94
     for i = 1, 24 do
     for i = 1, 24 do
         table.insert(result, p.at1ItemInfo('材料', '合成', i))
         local item = p.getItemInfoByIndex('AT1', '合成材料', i)
        local recipe = '-'
        if item.base.synthesisable ~= '0' then
            recipe = ci.getRecipeCardNameById(item.base.rc_id)
        end
        html:tag('tr')
            :tag('td'):wikitext(tostring(baseIndex + i)):done()
            :tag('td'):wikitext(tostring(i)):done()
            :tag('td'):wikitext('[[攻略:AT1/物品/' .. item.name .. '|' .. item.name .. ']]'):done()
            :tag('td'):wikitext(tostring(item.base.sell_price)):done()
            :tag('td'):wikitext(recipe):done()
     end
     end
     return table.concat(result, '\n')
     return tostring(html)
end
end


function p.listKeysInAt1()
function p.listKeysInAt1()
     result = {}
     local html = mw.html.create('table'):addClass('wikitable')
 
    html:tag('tr')
        :tag('th'):wikitext('ID'):done()
        :tag('th'):wikitext('索引'):done()
        :tag('th'):wikitext('名称'):done()
        :tag('th'):wikitext('卖价'):done()
        :tag('th'):wikitext('配方'):done()
   
    local baseIndex = 48
     for i = 1, 12 do
     for i = 1, 12 do
         table.insert(result, p.at1ItemInfo('重要', nil, i))
         local item = p.getItemInfoByIndex('AT1', '重要', i)
        local recipe = '-'
        if item.base.synthesisable ~= '0' then
            recipe = ci.getRecipeCardNameById(item.base.rc_id)
        end
        html:tag('tr')
            :tag('td'):wikitext(tostring(baseIndex + i)):done()
            :tag('td'):wikitext(tostring(i)):done()
            :tag('td'):wikitext('[[攻略:AT1/物品/' .. item.name .. '|' .. item.name .. ']]'):done()
            :tag('td'):wikitext(tostring(item.base.sell_price)):done()
            :tag('td'):wikitext(recipe):done()
     end
     end
     return table.concat(result, '\n')
     return tostring(html)
end
end


function p.listUseInAt1()
function p.listUseInAt1()
     result = {}
     local html = mw.html.create('table'):addClass('wikitable')
 
    html:tag('tr')
        :tag('th'):wikitext('ID'):done()
        :tag('th'):wikitext('索引'):done()
        :tag('th'):wikitext('名称'):done()
        :tag('th'):wikitext('卖价'):done()
        :tag('th'):wikitext('配方'):done()
   
    local baseIndex = 118
     for i = 1, 72 do
     for i = 1, 72 do
         table.insert(result, p.at1ItemInfo('使用', nil, i))
         local item = p.getItemInfoByIndex('AT1', '使用', i)
        local recipe = '-'
        if item.base.synthesisable ~= '0' then
            recipe = ci.getRecipeCardNameById(item.base.rc_id)
        end
        html:tag('tr')
            :tag('td'):wikitext(tostring(baseIndex + i)):done()
            :tag('td'):wikitext(tostring(i)):done()
            :tag('td'):wikitext('[[攻略:AT1/物品/' .. item.name .. '|' .. item.name .. ']]'):done()
            :tag('td'):wikitext(tostring(item.base.sell_price)):done()
            :tag('td'):wikitext(recipe):done()
     end
     end
     return table.concat(result, '\n')
     return tostring(html)
end
end


return p
return p
1,075

个编辑