Difference between revisions of "Module:Apt"
CommanderC (talk | contribs) (Created page with "local p = {} function p.aptitude(frame) local data = mw.loadData('Module:Table of aptitudes') return data[frame.args[1]][frame.args[2]] end return p") |
CommanderC (talk | contribs) |
||
| Line 5: | Line 5: | ||
return data[frame.args[1]][frame.args[2]] | return data[frame.args[1]][frame.args[2]] | ||
end | end | ||
| − | + | ||
| + | function p.skill_table(frame) | ||
| + | local data = mw.loadData('Module:Table of aptitudes') | ||
| + | local skill = frame.args[1] | ||
| + | local species = {'Human', 'Centaur', 'Demigod', 'Demonspawn', | ||
| + | 'Base Draconian', 'Deep Dwarf', 'Deep Elf', 'High Elf', 'Felid', | ||
| + | 'Sludge Elf', 'Ghoul', 'Halfling', 'Kobold', 'Merfolk', | ||
| + | 'Minotaur', 'Mummy', 'Naga', 'Octopode', 'Ogre', 'Hill Orc', | ||
| + | 'Spriggan', 'Tengu', 'Troll', 'Vampire'} | ||
| + | local result = [=[ | ||
| + | {| class="wikitable" border="1" | ||
| + | |- | ||
| + | |'''[[Human|Hu]]''' | ||
| + | |'''[[Centaur|Ce]]''' | ||
| + | |'''[[Demigod|Dg]]''' | ||
| + | |'''[[Demonspawn|Ds]]''' | ||
| + | |'''[[Draconian|Dr]]''' | ||
| + | |'''[[Deep Dwarf|DD]] | ||
| + | |'''[[Deep Elf|DE]]''' | ||
| + | |'''[[High Elf|HE]]''' | ||
| + | |'''[[Sludge Elf|SE]]''' | ||
| + | |'''[[Felid|Fe]]''' | ||
| + | |'''[[Ghoul|Gh]]''' | ||
| + | |'''[[Halfling|Ha]]''' | ||
| + | |'''[[Kobold|Ko]]''' | ||
| + | |'''[[Merfolk|Mf]]''' | ||
| + | |'''[[Minotaur|Mi]]''' | ||
| + | |'''[[Mummy|Mu]]''' | ||
| + | |'''[[Naga|Na]]''' | ||
| + | |'''[[Octopode|Op]]''' | ||
| + | |'''[[Ogre|Og]]''' | ||
| + | |'''[[Hill Orc|HO]]''' | ||
| + | |'''[[Spriggan|Sp]]''' | ||
| + | |'''[[Tengu|Te]]''' | ||
| + | |'''[[Troll|Tr]]''' | ||
| + | |'''[[Vampire|Vp]] | ||
| + | |-]=] | ||
| + | for _, sp in ipairs(species) do | ||
| + | result = result .. "|" .. data[sp][skill] | ||
| + | end | ||
| + | result = result .. "|}" | ||
| + | return result | ||
| + | end | ||
| + | |||
return p | return p | ||
Revision as of 18:54, 16 August 2013
Documentation for this module may be created at Module:Apt/doc
local p = {}
function p.aptitude(frame)
local data = mw.loadData('Module:Table of aptitudes')
return data[frame.args[1]][frame.args[2]]
end
function p.skill_table(frame)
local data = mw.loadData('Module:Table of aptitudes')
local skill = frame.args[1]
local species = {'Human', 'Centaur', 'Demigod', 'Demonspawn',
'Base Draconian', 'Deep Dwarf', 'Deep Elf', 'High Elf', 'Felid',
'Sludge Elf', 'Ghoul', 'Halfling', 'Kobold', 'Merfolk',
'Minotaur', 'Mummy', 'Naga', 'Octopode', 'Ogre', 'Hill Orc',
'Spriggan', 'Tengu', 'Troll', 'Vampire'}
local result = [=[
{| class="wikitable" border="1"
|-
|'''[[Human|Hu]]'''
|'''[[Centaur|Ce]]'''
|'''[[Demigod|Dg]]'''
|'''[[Demonspawn|Ds]]'''
|'''[[Draconian|Dr]]'''
|'''[[Deep Dwarf|DD]]
|'''[[Deep Elf|DE]]'''
|'''[[High Elf|HE]]'''
|'''[[Sludge Elf|SE]]'''
|'''[[Felid|Fe]]'''
|'''[[Ghoul|Gh]]'''
|'''[[Halfling|Ha]]'''
|'''[[Kobold|Ko]]'''
|'''[[Merfolk|Mf]]'''
|'''[[Minotaur|Mi]]'''
|'''[[Mummy|Mu]]'''
|'''[[Naga|Na]]'''
|'''[[Octopode|Op]]'''
|'''[[Ogre|Og]]'''
|'''[[Hill Orc|HO]]'''
|'''[[Spriggan|Sp]]'''
|'''[[Tengu|Te]]'''
|'''[[Troll|Tr]]'''
|'''[[Vampire|Vp]]
|-]=]
for _, sp in ipairs(species) do
result = result .. "|" .. data[sp][skill]
end
result = result .. "|}"
return result
end
return p