Editing Module:Infobox Skill

From Eco - English Wiki
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
-- Credit: Original Infobox (now known as Infobox_Item) created by Pradoxzon was then edited by Nesphit and TreeNuts0. Fyre (FishAus) and Scotty (ZeelNightwolf) further edited the Infobox_Item. They then duplicated and used as a base for Infobox_Skill, Infobox_Plant, and Infobox_Animal.
local p = {}
local p = {}


Line 47: Line 45:
     -- checks if skill  and assigns correct modules based on check
     -- checks if skill  and assigns correct modules based on check
     if check == 'skill' then
     if check == 'skill' then
         skillData = require( "Module:Skills" )
         skillData = require( "Module:TestSkills" )
         skillTable = skillData.skills[skills]
         skillTable = skillData.skills[skills]
     else
     else
Line 57: Line 55:
     if skillTable == {} then
     if skillTable == {} then
         if check == 'skill' then
         if check == 'skill' then
             return skills .. ' could not be found in Module:Skills.'
             return skills .. ' could not be found in Module:TestSkills.'
         else
         else
             return skills .. ' could not be found in Module:TalentData.'
             return skills .. ' could not be found in Module:TalentData.'
Line 70: Line 68:
    
    
     -- name of the skill/talent
     -- name of the skill/talent
   infobox = infobox .. '|- style=\"color: white; background-color: #1165AF; text-align: center;\"\n| colspan=\"2\" | \'\'\'<big>' .. skills .. '</big>\'\'\'\n'
   infobox = infobox .. '|- style=\"color: white; background-color: #1165AF; text-align: center;\"\n| colspan=\"2\" | \'\'\'<big>' .. skill .. '</big>\'\'\'\n'
   
   
       infobox = infobox .. '|- style=\"text-align: center;color: white; background-color: goldenrod;\"\n| colspan=\"2\"'
       infobox = infobox .. '|- style=\"text-align: center;color: white; background-color: goldenrod;\"\n| colspan=\"2\"'
Line 86: Line 84:
local checkImage = {'_Icon.png','_Icon.jpg'}
local checkImage = {'_Icon.png','_Icon.jpg'}
local image = ''  
local image = ''  
 
local skillsimagename = string.gsub(skills, ' ', '')
if skillTable.skillID ~= nil then
skillId = skillTable.skillID
skillEN = string.sub (skillId, 1, -6)
skillsimagename = string.gsub(skillEN, ' ', '')
elseif skillTable.untranslated ~= nil then
talentEN = skillTable.untranslated
skillsimagename = string.gsub(talentEN, ' ', '')
end
for i,v in ipairs(checkImage) do  
for i,v in ipairs(checkImage) do  
Line 103: Line 93:
if table.getn(checkImage) == i then
if table.getn(checkImage) == i then
image = 'NoImage.png'  
image = 'NoImage.png'  
if check == 'skill' then  
if check == 'Skill' then  
image = image .. '|link=https://wiki.play.eco/index.php?title=Special:Upload&wpDestFile=' .. skillsimagename .. '_Icon.png|[[Category:Pages_with_missing_skill_Icon]]'
image = image .. '|link=https://wiki.play.eco/index.php?title=Special:Upload&wpDestFile=' .. skillsimagename .. '_Icon.png|[[Category:Pages_with_missing_skill]]'
end
end
if check == 'talent' then  
if check == 'Talent' then  
image = image .. '|link=https://wiki.play.eco/index.php?title=Special:Upload&wpDestFile=' .. skillsimagename .. '_Icon.png|[[Category:Pages_with_missing_talent_Icon]]'
image = image .. '|link=https://wiki.play.eco/index.php?title=Special:Upload&wpDestFile=' .. skillsimagename .. '_Icon.png|[[Category:Pages_with_missing_talent]]'
end
end
end
end
end
end
 
if check == 'skill' then
infobox = infobox .. '|-\n| colspan=\"2\" style=\"padding: 10px;\" | [[File:' .. image .. '|center|border|250x250px]]\n'
infobox = infobox .. '|-\n| colspan=\"2\" style=\"padding: 10px;\" | <div class="iconContainer"><div class="iconStack">[[File:' .. image .. '|frameless|class=iconOrange]]</div><div class=iconBorder style=\"position:absolute;\"></div></div> \n'
elseif check == 'talent' then
infobox = infobox .. '|-\n| colspan=\"2\" style=\"padding: 10px;\" | <div class="iconContainer"><div class="iconStack">[[File:' .. image .. '|frameless|class=iconBrown]]</div><div class=iconBorder style=\"position:absolute;\"></div></div> \n'
else
infobox = infobox .. '|-\n| colspan=\"2\" style=\"padding: 10px;\" | <div class="iconContainer"><div class="iconStack">[[File:' .. image .. '|frameless|class=iconBlue]]</div><div class=iconBorder style=\"position:absolute;\"></div></div> \n'
end
   
   
   -- 'Description' section header
   -- 'Description' section header
Line 134: Line 117:
--SKILL
--SKILL
if check == 'skill' then
if check == 'skill' then
  -- 'Skill Information' section header
  -- 'Related Skills' section header
infobox = infobox .. '|- style=\"background-color: #4688C0; text-align: center;\"\n| colspan=\"2\" | \'\'\'Skill Information\'\'\'\n'
infobox = infobox .. '|- style=\"background-color: #4688C0; text-align: center;\"\n| colspan=\"2\" | \'\'\'Related Skills\'\'\'\n'
-- Professsion  .rootSkill
-- Professsion  .rootSkill
Line 153: Line 136:
-- Leads to  childSkills
-- Leads to  childSkills
        if skillTable.childSkills ~= nil then
if skillTable.childSkills ~= nil then
            for i,v in pairs(skillTable.childSkills) do
infobox = infobox .. '|-\n| Leads to:\n| style=\"text-align: right; padding: 3px;\" | ' .. skillTable.childSkills .. '\n'
infobox = infobox .. '|-\n| Leads to:\n| style=\"text-align: right; padding: 3px;\" | ' .. skillTable.childSkills[i] .. '</br>\n'
end 
            end
        end
-- Leads to  childSkills
if skillTable.childSkills ~= nil then
infobox = infobox .. '|-\n| Leads to:\n| style=\"text-align: right; padding: 3px;\" | ' .. skillTable.childSkills .. '\n'
end
  -- 'Skill Information' section header
infobox = infobox .. '|- style=\"background-color: #4688C0; text-align: center;\"\n| colspan=\"2\" | \'\'\'Skill Information\'\'\'\n'
-- maxlevel .maxLevel
-- maxlevel .maxLevel
if skillTable.maxLevel ~= nil then
if skillTable.maxLevel ~= nil then
Line 168: Line 158:
end
end
-- Related Talents
if skillTable.talents ~= nil then
local listTalents3 = ''
local listTalents6 = ''
local talent3 = skillTable.talents.level3
local talent6 = skillTable.talents.level6
-- for each item in the listTalents3 (b is position, c is value)
            if talent3 ~= nil then
for b,c in ipairs(talent3) do
--if not these tags listed here
if c ~='[[]]'  then
-- add the tag to the list
listTalents3 = listTalents3 .. c
end
-- if not the last item in the list
if (c ~= talent3[#talent3]) then
-- add a comma
listTalents3 = listTalents3 .. ', </br>'
end
end
            end
-- for each item in the listTalents6 (e is position, d is value)           
            if talent6 ~= nil then
for e,d in ipairs(talent6) do
--if not these tags listed here
if d ~='[[]]'  then
-- add the tag to the list
listTalents6 = listTalents6 .. d
end
-- if not the last item in the list
if (d ~= talent6[#talent6]) then
-- add a comma
listTalents6 = listTalents6 .. ', </br>'
end
end
            end
-- 'Talent Information' section header
infobox = infobox .. '|- style=\"background-color: #4688C0; text-align: center;\"\n| colspan=\"2\" | \'\'\'Talent Information\'\'\'\n'
infobox = infobox .. '|- style=\"border-bottom: solid #7BC2CE;\"\n| Level 3 Talents:\n| style=\"text-align: right; padding: 3px;\" | ' .. listTalents3 .. ' \n'
infobox = infobox .. '|-\n| Level 6 Talents:\n| style=\"text-align: right; padding: 3px;\" | ' .. listTalents6 .. ' \n'
end
-- 'IDs' section header
-- 'IDs' section header
infobox = infobox .. '|- style=\"background-color: #4688C0; text-align: center;\"\n| colspan=\"2\" | \'\'\'IDs\'\'\'\n'
infobox = infobox .. '|- style=\"background-color: #4688C0; text-align: center;\"\n| colspan=\"2\" | \'\'\'IDs\'\'\'\n'
Line 216: Line 163:
-- skill id (type)
-- skill id (type)
infobox = infobox .. '|- valign=\"center\"\n| Item ID:\n| style=\"text-align: right; padding: 3px;\" | ' .. skillTable.skillID .. '\n'
infobox = infobox .. '|- valign=\"center\"\n| Item ID:\n| style=\"text-align: right; padding: 3px;\" | ' .. skillTable.skillID .. '\n'
-- id number (type id)
infobox = infobox .. '|- valign=\"center\"\n| ID Number:\n| style=\"text-align: right; padding: 3px;\" | ' .. skillTable.skillIDNum .. '\n'
end
end
--TALENT
--TALENT
Line 224: Line 175:
-- Talent Type
-- Talent Type
if skillTable.talentType ~= nil then
if talentTable.talentType ~= nil then
infobox = infobox .. '|-\n| Talent Type:\n| style=\"text-align: right; padding: 3px;\" |[[' .. skillTable.talentType .. ']]\n'
infobox = infobox .. '|-\n| Talent Type:\n| style=\"text-align: right; padding: 3px;\" | ' .. talentTable.talentType .. '\n'
end
end
-- Skill Needed
-- Skill Needed
if skillTable.owningSkill ~= nil then
if talentTable.owningSkill ~= nil then
infobox = infobox .. '|-\n| Skill Needed:\n| style=\"text-align: right; padding: 3px;\" |[[' .. skillTable.owningSkill .. ']]\n'
infobox = infobox .. '|-\n| Skill Needed:\n| style=\"text-align: right; padding: 3px;\" | ' .. talentTable.owningSkill .. '\n'
end
end
-- Talents Active at Level
-- Talents Active at Level
if skillTable.activeLevel ~= nil then
if talentTable.activeLevel ~= nil then
infobox = infobox .. '|-\n| Active at Level:\n| style=\"text-align: right; padding: 3px;\" | ' .. skillTable.activeLevel .. '\n'
infobox = infobox .. '|-\n| Active at Level:\n| style=\"text-align: right; padding: 3px;\" | ' .. talentTable.activeLevel .. '\n'
end
end
end
end
     infobox = infobox .. '|}'
     infobox = infobox .. '|}'
     return infobox
     return infobox
end
end


return p
return p
Please note that all contributions to Eco - English Wiki are considered to be released under the CC BY-NC-SA 4.0 (see Eco:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)

Template used on this page: