Modul:X: Unterschied zwischen den Versionen

Aus How to be a Hero
Zur Navigation springen Zur Suche springen
Murmelgrumpf (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
Murmelgrumpf (Diskussion | Beiträge)
Keine Bearbeitungszusammenfassung
 
(94 dazwischenliegende Versionen derselben Benutzerin werden nicht angezeigt)
Zeile 1: Zeile 1:
local p = {} --local p = {} -- p steht für Paket (engl. package)
local p = {} --local p = {} -- p steht für Paket (engl. package)


function split (inputstr, sep)
require( "Module:Xfunc" )
 
function p.cutblock ( frame )
    if sep == nil then
text = frame.args[3]-- "Die Schmiede"
        sep = "%s"
width = tonumber(frame.args[2]) -- 4
    end
height = tonumber(frame.args[1]) -- 12
    local t={}
block = ""
    for str in string.gmatch(string.gsub(inputstr,sep, "\0"),"%Z+") do
textlen = string.len(text) -- 12
        table.insert(t, str)
tempsplit = {}
    end
    return t
end
while (height>0 and textlen>=width) do -- 12>0 and 12>=4|11>0 and 11>=4
 
tempsplit = split(cut(width, text), "%%%@%%") -- ("Die", "Schmiede")| (
function splait (inputstr, sep)
block = block..tempsplit[1].." " -- "Die "
 
text = tempsplit[2] -- "Schmiede"
    if sep == nil then
height = height-1 -- 11
        sep = "%s"
if (text==nil) then
    end
text = ""
    local t={}
    for str in string.gmatch(string.gsub(inputstr,sep, "\0"),"%Z+") do
        table.insert(t, str)
    end
    return t
end
 
function spalait (inputstr, sep)
 
    if sep == nil then
        sep = "%s"
    end
    local t={}
    for str in string.gmatch(string.gsub(inputstr,sep, "\0"),"%Z+") do
        table.insert(t, str)
    end
    return t
end
 
function copy(obj, seen)
  if type(obj) ~= 'table' then return obj end
  if seen and seen[obj] then return seen[obj] end
  local s = seen or {}
  local res = setmetatable({}, getmetatable(obj))
  s[obj] = res
  for k, v in pairs(obj) do res[copy(k, s)] = copy(v, s) end
  return res
end
 
function cosdfpy(obj, seen)
  if type(obj) ~= 'table' then return obj end
  if seen and seen[obj] then return seen[obj] end
  local s = seen or {}
  local res = setmetatable({}, getmetatable(obj))
  s[obj] = res
  for k, v in pairs(obj) do res[copy(k, s)] = copy(v, s) end
  return res
end
function tabContains(tableasd, keaaay)
solution = nil --"key: "..keaaay.."\n\n"
    for numgasbr,crreasdnt in pairs(tableasd) do
if (tableasd[numgasbr] == keaaay) then
solution = numgasbr
end
end
--solution = solution..numgasbr..": "..crreasdnt[numgasbr].."\n\n"
textlen = string.len(text) -- 8
end
if (height>0) then
block = block.." "..text
text = ""
end
end
return solution
end
result = block.."%@%"..text
function tablelength(T)
result = string.gsub(result, "%§", " ")
  local count = 0
return result
  if (T==nil or T[1]==nil) then
 
return 0
  end
  for _ in pairs(T) do count = count + 1 end
  return count
end


function tabcontainstab(tableoneooop, tabletwoooop)
seanwsrer = true
if (tabletwoooop[1]~=nil) then
for numberindexthingiu, currenttableslothi in pairs(tabletwoooop) do
if (tabContains(tableoneooop,currenttableslothi) == nil) then
seanwsrer = false
end
end
end
return seanwsrer
end
end


function displaytablevert(taable)
function p.cut( frame )
endresutl=""
testtext = ""
if (taable==nil or taable[1]==nil) then
realtext = frame.args[2] --Die Schmiede
return endresutl
realtext = removespaceinlink(realtext) --Die Schmiede
end
srealtext = split(realtext, " ") --Die|Schmiede(list)
for nnnn,entri in pairs(taable) do
i = 2; --2
endresutl=endresutl..entri.."\n"
testtext = testtext.."<br \>"..i..": "
end
limit = tonumber(frame.args[1]) --4
return endresutl
text = display(removespaceinlink(realtext)) --Die Schmiede
end
stext = split(text, " ") --Die|Schmiede(list)
 
function displaytablehor(taaable)
endresutal=""
if (taaable==nil or taaable[1]==nil) then
return endresutal
end
for nn,entria in pairs(taaable) do
endresutal=endresutal..entria.." - "
end
return endresutal
end
 
function displaytabletwo(taaaable)
endresutaal=""
if (taaaable==nil or taaaable[1]==nil) then
return endresutaal
end
for nnn,entriaa in pairs(taaaable) do
endresutaal=endresutaal..displaytablehor(entriaa).."\n\n"
end
return endresutaal
end
 
 
function gmatchtable(text, pattern)
ztable={}
for word in string.gmatch(text, pattern) do
if(table.getn(stext)==1) then
table.insert(ztable,word)  
if(string.len(stext[1])>limit) then
return "%@%"..text
else
return text.."%@%"
end
end
end
return ztable
cuttext = stext[1] --Die
end
realcuttext = srealtext[1] --Die
nextwo = stext[2] --Schmiede
realnextwo = srealtext[2] --Schmiede
nextlen = string.len(nextwo)--8
textlen = string.len(text)--12
cuttextlen = string.len(cuttext)--3
set = true;
testtext = testtext.."<br \>"..i..": "..realcuttext
if(limit>=textlen)then --4>=12
return realtext.."%@%"
elseif(cuttextlen>limit) then--3>4
return "%@%"..realtext


 
else
 
while (cuttextlen+nextlen+1<=textlen+2) do --8+3+1<=12+2(12<=14)|14+3+1<=12+2(18<=14)
function getindexformat()
title = mw.title.new( "Indexformat", "Yggdrasil" )
if(cuttextlen+nextlen+1>limit and set) then --8+3+1>4(12>4)|
content = title:getContent()
set = false
content = string.gsub(content, "</pre>.-<pre>" , "!!!")
cuttext = cuttext.."%@%" --"Die %@%"
content = string.gsub(content, "</pre>.*" , "")
realcuttext = realcuttext.."%@%" --"Die %@%"
content = string.gsub(content, ".*<pre>" , "")
content = string.gsub(content, "|" , "\n|")
else
content = split(content,"!!!")
cuttext = cuttext.." " --
return content
realcuttext = realcuttext.." " --
 
end
end
 
-- testtext = testtext..tostring(i)..": "..realcuttext.."<br />"
 
i = i + 1 --3
function getheader( title, namespace )
title = mw.title.new( title, namespace )
cuttext = cuttext..nextwo -- "Die%@%Schmiede"
content = title:getContent()
realcuttext = realcuttext..realnextwo -- "Die%@%Schmiede"
content = string.gsub(content, "%=%=+", "§§§")
content = split("hallo"..content, "§§§")
nextwo = stext[i]-- nil
iiii = 2
realnextwo = srealtext[i]-- nil
iiiii = 1
length = tablelength(content)
if (nextwo ~= nil) then
finaltext={}
nextlen = string.len(nextwo) -- 5
while (iiii<=length) do
end
finaltext[iiiii] = content[iiii]
cuttextlen = string.len(cuttext) -- 14
iiii = iiii + 2
testtext = testtext.."<br \>"..i..": "..realcuttext
iiiii = iiiii + 1
end
end
return finaltext
realnextwo = srealtext[i]
end
if (realnextwo ~= nil) then
 
realcuttext = realcuttext.." "..realnextwo
function getheaderlimit( title, namespace )
end
limiit = tonumber(string.sub(title, string.len(title)))
title = string.sub(title, 1, string.len(title)-2)
title = mw.title.new( title, namespace )
content = title:getContent()
curhead=""
while (0<=limiit) do
curhead = curhead.."%="
limiit = limiit-1
end
end
curhead = curhead.."+"
testtext = testtext.."<br \>"..(i+1)..": "..realcuttext
content = string.gsub(content, curhead, "no")
return realcuttext
content = string.gsub(content, "%=%=+", "§§§")
content = split("hallo"..content, "§§§")
iiii = 2
iiiii = 1
length = tablelength(content)
endtext={}
while (iiii<=length) do
endtext[iiiii] = content[iiii]
iiii = iiii + 2
iiiii = iiiii + 1
end
return endtext
end
end


 
function p.display ( frame )
 
text = frame.args[1]
 
text = text:gsub("'", "")
 
lend = string.len(text)
function cut( limit, realtext )
i=1
testtext = ""
auf = {}
zu = {}
currentauf = string.find(text, "%[%[")
while (currentauf ~= nil) do
auf[i] = currentauf;
if (string.find(string.sub(text,currentauf+2), "%[%[")~=nil)then
currentauf = currentauf+1+string.find(string.sub(text,currentauf+2), "%[%[")
else
currentauf = nil
end
i=i+1
end
realtext = removespaceinlink(realtext) --Die Schmiede
i=1
srealtext = split(realtext, " ") --Die|Schmiede(list)
currentzu = string.find(text, "%|")
i = 2; --2
while (currentzu ~= nil) do
testtext = testtext.."<br \>"..i..": "
zu[i] = currentzu;
if (string.find(string.sub(text,currentzu+2), "%|")~=nil)then
text = display(removespaceinlink(realtext)) --Die Schmiede
currentzu = currentzu+1+string.find(string.sub(text,currentzu+2), "%|")
stext = split(text, " ") --Die|Schmiede(list)
if(table.getn(stext)==1) then
if(string.len(stext[1])>limit) then
return "%@%"..text
else
else
return text.."%@%"
currentzu = nil
end
end
i=i+1
end
end
cuttext = stext[1] --Die
offset = 0
realcuttext = srealtext[1] --Die
nextwo = stext[2] --Schmiede
realnextwo = srealtext[2] --Schmiede
nextlen = string.len(nextwo)--8
textlen = string.len(text)--12
cuttextlen = string.len(cuttext)--3
set = true;
testtext = testtext.."<br \>"..i..": "..realcuttext
if(limit>=textlen)then --4>=12
return realtext.."%@%"
elseif(cuttextlen>limit) then--3>4
return "%@%"..realtext
if(table.getn(auf) == table.getn(zu))then
i=1
while (table.getn(auf)>=i) do
anfang = auf[i]
ende = zu[i]
tt, uu = string.find(string.sub(text, 1, anfang-offset+1), "%[%[(.+)%|")
text = string.gsub(string.sub(text, 1, anfang-offset+1), "%[%[(.+)%|", "")..string.sub(text,anfang-offset+2,string.len(text))
-- text = string.sub(text,1,anfang-offset+1)..string.sub(text,ende+1-offset,string.len(text))
if (tt ~= nil) and (uu ~= nil) then
offset = offset+uu-tt
end
i=i+1
end
text = string.gsub(text, "%[%[(.+)%|", "")
end
-- text = text:gsub("%[", "")
-- text = text:gsub("%|", "")
text = text:gsub("%]", "")
return text
end


else
function p.split ( frame )
while (cuttextlen+nextlen+1<=textlen+2) do --8+3+1<=12+2(12<=14)|14+3+1<=12+2(18<=14)
spl = split(frame.args[1],frame.args[2])
i=1
if(cuttextlen+nextlen+1>limit and set) then --8+3+1>4(12>4)|
t=""
set = false
while(i<=tablelength(spl)) do
cuttext = cuttext.."%@%" --"Die %@%"
t = t..spl[i].."\n\n"
realcuttext = realcuttext.."%@%" --"Die %@%"
i=i+1
end
else
 
cuttext = cuttext.." " --
    return t
realcuttext = realcuttext.." " --
end
 
end
function p.removespaceinlink(frame)
-- testtext = testtext..tostring(i)..": "..realcuttext.."<br />"
text = frame.args[1]
i = i + 1 --3
i=1
auf = {}
cuttext = cuttext..nextwo -- "Die%@%Schmiede"
zu = {}
realcuttext = realcuttext..realnextwo -- "Die%@%Schmiede"
currentauf = string.find(text, "%[%[")
while (currentauf ~= nil) do
nextwo = stext[i]-- nil
auf[i] = currentauf;
realnextwo = srealtext[i]-- nil
if (string.find(string.sub(text,currentauf+2), "%[%[")~=nil)then
currentauf = currentauf+1+string.find(string.sub(text,currentauf+2), "%[%[")
if (nextwo ~= nil) then
else
nextlen = string.len(nextwo) -- 5
currentauf = nil
end
cuttextlen = string.len(cuttext) -- 14
testtext = testtext.."<br \>"..i..": "..realcuttext
end
end
realnextwo = srealtext[i]
if (realnextwo ~= nil) then
i=i+1
realcuttext = realcuttext.." "..realnextwo
end
i=1
currentzu = string.find(text, "%]%]")
while (currentzu ~= nil) do
zu[i] = currentzu;
if (string.find(string.sub(text,currentzu+2), "%]%]")~=nil)then
currentzu = currentzu+1+string.find(string.sub(text,currentzu+2), "%]%]")
else
currentzu = nil
end
end
i=i+1
end
end
testtext = testtext.."<br \>"..(i+1)..": "..realcuttext
if(table.getn(auf) == table.getn(zu))then
return realcuttext
i=1
end
while (table.getn(auf)>=i) do
anfang = auf[i]
ende = zu[i]
text = string.sub(text,1,anfang-1)..string.gsub(string.sub(text,anfang,ende)," ","§")..string.sub(text,ende+1,string.len(text))


function headertotablelimit(title, namespace)
i=i+1
limiiiit = tonumber(string.sub(title, string.len(title)))-1
title = string.sub(title, 1, string.len(title)-2)
title = mw.title.new( title, namespace )
content = title.getContent(title)
original = headertotable(content)
neworiginal = {}
for nnnnn,entriii in ipairs(original) do
if (tablelength(entriii)<=limiiiit) then
neworiginal[nnnnn] = entriii
end
end
end
end
return neworiginal
return text
end
end


function display ( text )
text = text:gsub("'", "")
lend = string.len(text)
ii=1
auf = {}
zu = {}
currentauf = string.find(text, "%[%[")
while (currentauf ~= nil) do
auf[ii] = currentauf;
if (string.find(string.sub(text,currentauf+2), "%[%[")~=nil)then
currentauf = currentauf+1+string.find(string.sub(text,currentauf+2), "%[%[")
else
currentauf = nil
end
ii=ii+1
end
ii=1
currentzu = string.find(text, "%|")
while (currentzu ~= nil) do
zu[ii] = currentzu;
if (string.find(string.sub(text,currentzu+2), "%|")~=nil)then
currentzu = currentzu+1+string.find(string.sub(text,currentzu+2), "%|")
else
currentzu = nil
end
ii=ii+1
end
offset = 0
if(table.getn(auf) == table.getn(zu))then
ii=1
while (table.getn(auf)>=ii) do
anfang = auf[ii]
ende = zu[ii]
tt, uu = string.find(string.sub(text, 1, anfang-offset+1), "%[%[(.+)%|")
text = string.gsub(string.sub(text, 1, anfang-offset+1), "%[%[(.+)%|", "")..string.sub(text,anfang-offset+2,string.len(text))
-- text = string.sub(text,1,anfang-offset+1)..string.sub(text,ende+1-offset,string.len(text))
if (tt ~= nil) and (uu ~= nil) then
offset = offset+uu-tt
end
ii=ii+1
end
text = string.gsub(text, "%[%[(.+)%|", "")
end
-- text = text:gsub("%[", "")
-- text = text:gsub("%|", "")
text = text:gsub("%]", "")


return text
 
 
 
 
function p.size ( frame )
text = frame.args[1]
return textSize(text)
end
 
 
 
 
 
function p.size ( frame )
text = frame.args[1]
return textSize(text)
end
 
function p.findg( frame )
text = frame.args[1]
d,s,r = string.find(text, "g")
return d,s,r
 
end
end


function removespaceinlink(text)
function p.indexold
iii=1
( frame )
auf = {}
text = frame.args[1]
zu = {}
stext = split (text, "§§§")
currentauf = string.find(text, "%[%[")
currentpage = ""
while (currentauf ~= nil) do
currentheaders= nil
auf[iii] = currentauf;
finish = ""
if (string.find(string.sub(text,currentauf+2), "%[%[")~=nil)then
i = 1
currentauf = currentauf+1+string.find(string.sub(text,currentauf+2), "%[%[")
inde = 1
else
while (i<=tablelength(stext)) do
currentauf = nil
currentpage = stext[i]
currentheaders = getheaderlimit(currentpage, "Yggdrasil")
currentpage = string.sub(currentpage, 1, string.len(currentpage)-2)
headlen = tablelength(currentheaders)
inde = 1
while (inde<=headlen) do
finish = finish.."|[[Yggdrasil:"..currentpage.."#"..currentheaders[inde].."|"..currentheaders[inde].."]]\n|[[Yggdrasil:"..currentpage.."|"..currentpage.."]]\n|-\n"
inde=inde+1
end
end
iii=iii+1
i=i+1
end
end
iii=1
--text = frame.args[1]
currentzu = string.find(text, "%]%]")
--stext = split (text, "\n")
while (currentzu ~= nil) do
--ending = ""
zu[iii] = currentzu;
if (string.find(string.sub(text,currentzu+2), "%]%]")~=nil)then
--for i = 1,tablelength(stext),1 do
currentzu = currentzu+1+string.find(string.sub(text,currentzu+2), "%]%]")
-- currentsplit = split (stext[i], "%>")
else
-- leng = tablelength(currentsplit)
currentzu = nil
-- ending = ending.."|[[Yggdrasil:"..currentsplit[2].."#"..currentsplit[1].."|"..currentsplit[1].."]]\n|[[Yggdrasil:"..currentsplit[2].."|"..currentsplit[2].."]]\n|-\n"
end
--end
iii=iii+1
end
if(table.getn(auf) == table.getn(zu))then
iii=1
while (table.getn(auf)>=iii) do
anfang = auf[iii]
ende = zu[iii]
text = string.sub(text,1,anfang-1)..string.gsub(string.sub(text,anfang,ende)," ","§")..string.sub(text,ende+1,string.len(text))
 
iii=iii+1
end
end
return text
return finish
end
end


function gethighest( tabhle )
 
highest = tabhle[1]
function p.yggrassen( frame )
for numgbr,crregnt in ipairs(tabhle) do
text = frame.args[1]
if (highest<tabhle[numgbr]) then
stext = split (text, "\n")
highest=tabhle[numgbr]
haupttext = split (text, "'''Nebenrassen'''")[1]
end
nebentext = split (text, "'''Nebenrassen'''")[2]
end
shaupttext = split (haupttext, "\n")
return highest
snebentext = split (nebentext, "\n")
end
ending = "!<big>Hauptrassen</big>\n|-\n"
 
function duptable( tabhdhle )
for i = 2,tablelength(stext),1 do  
dupe = {}
if (stext[i]=="'''Nebenrassen'''") then
nothertab = {}
ending = ending.."!<big>Nebenrassen</big>\n|-\n"
for nuamgbr,craregnt in pairs(tabhdhle) do
reallycontains  = tabContains(nothertab,craregnt)
if (reallycontains==nil) then
nothertab[nuamgbr] = craregnt
else
else
tempdupetable = {reallycontains,nuamgbr}
ending = ending.."|<big>'''[[#"..stext[i].."|"..stext[i].."]]'''</big>\n|-\n"
table.insert(dupe,tempdupetable)
end
end
end
end
return dupe
 
return ending
 
end
end


function schlagwortliste()
tiasdtasdfle = mw.title.new( "Schlagwortliste", "Yggdrasil" )
contegfgdfndasdat = tiasdtasdfle:getContent()
schlagworttable = {}
for thingis in string.gmatch(contegfgdfndasdat, "%{%{o%|.-%|") do
iuadiuh = string.sub(thingis,5,string.len(thingis)-1)
if (iuadiuh~="Name") then
table.insert(schlagworttable,iuadiuh)
end
end
return schlagworttable


end


function gegvorapi()
function p.yggtab( frame )
listxy = {}
text = frame.args[1]
gegtitle = mw.title.new( "Gegenstände", "Yggdrasil" )
img = frame.args[2]
gegcontent = gegtitle:getContent()
stext = split (text, "§§§")
tabbbb = headertotable(gegcontent)
exist = true
headerewnds = {}
imgtext = ''
tempzwweites = {}
if (img~=nil and img~='' and img~='{{{img}}}') then
tempzudreites = 0
imgtext='<div id="yggimg">[[Datei:'..img..']]</div>\n'
tempzudreitasdafsaes = 0
for eiwnes,zwwweites in pairs(tabbbb) do
if (tablelength(zwwweites) == 3) then
tempzwweites = copy(zwwweites)
x,tempzudreites = string.find(gegcontent,"===="..tempzwweites[3].."====")
tempzudreitasdafsaes,x = string.find(gegcontent,"\n=", tempzudreites)
if (tempzudreitasdafsaes==nil) then
tempzudreitasdafsaes = string.len(gegcontent)
end
tempzwweites[4] = string.gsub(string.sub(gegcontent,tempzudreites+1,tempzudreitasdafsaes-1),"<.->","")
table.insert(listxy,tempzwweites)
end
end
end
i=1
rettext='{|class="wikitable" style="width: 32%; float:right; margin-top: 0; margin-bottom: 0px;"\n|-\n'
return listxy -- 1:Category 2: Subcategory 3: Name 4:content
while (stext[i+1]~=nil) do
end
rettext=rettext..'!style="width:32%; padding: 10px;" |'..string.sub(stext[i],2,string.len(stext[i]))..'\n'
 
i=i+1
function zeros(intedhfgjdgkztger)
if (stext[i+1]~=nil and stext[i]~='-') then
    resdgsgst = ""
rettext=rettext..'|style="width:68%; padding: 10px;" |'
    while (intedhfgjdgkztger>0) do
end
        resdgsgst=resdgsgst.."0"
        intedhfgjdgkztger=intedhfgjdgkztger-1
while (stext[i+1]~=nil and stext[i]~='-') do
end
if(string.sub(stext[i],1,1)=='/') then
    return resdgsgst
rettext=rettext..string.sub(stext[i],2)
end
elseif(string.find(stext[i],'#')~=nil) then
 
found=string.find(stext[i],'#')
function ones(intedhfgjdfasgkztger)
rettext=rettext..'[[Yggdrasil:'..string.sub(stext[i],1,found-1)..'#'..string.sub(stext[i],found+1,string.len(stext[i]))..'|'..string.sub(stext[i],found+1,string.len(stext[i]))..']]'
    resdgsasdgst = ""
    while (intedhfgjdfasgkztger>0) do
else
        resdgsasdgst=resdgsasdgst.."1"
rettext=rettext..'[[#'..stext[i]..'|'..stext[i]..']]'
        intedhfgjdfasgkztger=intedhfgjdfasgkztger-1
end
    return resdgsasdgst
end
 
function gegapi()
catlist = {}
nosortlist = {}
unforlist = gegvorapi()
temptable = {}
temprest = ""
tempsplittable = {}
nothertempsplittable = {}
tempimg = nil
for numd, keyd in pairs(unforlist) do
temptable = {}
if (catlist[keyd[1]] == nil) then
catlist[keyd[1]] = {}
end
if (catlist[keyd[1]][keyd[2]] == nil) then
catlist[keyd[1]][keyd[2]] = {}
end
if (catlist[keyd[1]][keyd[2]][numd] == nil) then
catlist[keyd[1]][keyd[2]][numd] = {}
end
temptable["Category"] = keyd[1]
temptable["Subcategory"] = keyd[2]
temptable["Name"] = keyd[3]
catlist[keyd[1]][keyd[2]][numd]["Name"] = keyd[3]
temptable["Text"] =  string.gsub(string.gsub(split(keyd[4], "\n%|\n")[2],"%}%}",""),"\n\n","")
catlist[keyd[1]][keyd[2]][numd]["Text"] = temptable["Text"]
temprest = split(keyd[4], "\n%|\n")[1]
tempimg = string.match(temprest,"img=.-\n")
anothertemp = ""
if (tempimg~= nil) then
temptable["Img"] = string.sub(tempimg,5)
catlist[keyd[1]][keyd[2]][numd]["Img"] = temptable["Img"]
end
temprest = string.gsub(string.gsub(temprest,"\n",""), "{{YggTab.-|!", "")
temprest = string.gsub(temprest, "{{YggTab|!", "|-|!")
temprest = split(temprest,"|%-|!")
for tri,asdf in pairs(temprest) do
tempsplittable = split(asdf,"|")
intindex = 2
nothertempsplittable = {}
while (intindex<=tablelength(tempsplittable)) do
anothertemp = tempsplittable[intindex]
if (string.find(anothertemp,"/")==1) then
anothertemp = string.sub(anothertemp,2)
elseif (string.find(anothertemp,":")~=nil) then
anothertemp = "[[Yggdrasil:"..split(anothertemp,":")[1].."|"..split(anothertemp,":")[2].."]]"
end
table.insert(nothertempsplittable,anothertemp)
intindex = intindex + 1
end
temptable[tempsplittable[1]] = copy(nothertempsplittable)
catlist[keyd[1]][keyd[2]][numd][tempsplittable[1]] = temptable[tempsplittable[1]]
if (tempsplittable[1]=="Schlagwörter") then
temptable[tempsplittable[1]] = split(temptable[tempsplittable[1]][1],", ")
catlist[keyd[1]][keyd[2]][numd][tempsplittable[1]] = temptable[tempsplittable[1]]
end
end
rettext=rettext..'\n\n'
i=i+1
end
end
table.insert(nosortlist,temptable)
end
return nosortlist, catlist
end


function changebin(binaasdasfgggary, integeeer)
rettext=rettext..'|-\n'
binaaasdfhry = binaasdasfgggary
i=i+1
tochange = string.sub(binaaasdfhry, integeeer, integeeer)
if(tochange == "1") then
        binaaasdfhry = string.sub(binaaasdfhry,1,integeeer-1).."0"..string.sub(binaaasdfhry,integeeer+1)
    elseif(tochange == "0") then
        binaaasdfhry = string.sub(binaaasdfhry,1,integeeer-1).."1"..string.sub(binaaasdfhry,integeeer+1)
end
end
return binaaasdfhry
rettext=rettext..'|}'..stext[i-1]..'\n|style="width:20%; padding: 0; vertical-align:top;"|'..imgtext
return '{|style="width:100%;"\n|style="width:80%; padding: 0; vertical-align:top;"|\n'..rettext..'\n|}'
end
end


function multchangebin(binaaghdfghsdgggary, integeeerstart, integeeerend)  
function p.getpage( frame )
while (integeeerstart<=integeeerend) do
title = mw.title.new( frame.args[1], frame.args[2] )
binaaghdfghsdgggary = changebin(binaaghdfghsdgggary,integeeerstart)
content = title:getContent()
integeeerstart = integeeerstart+1
return content
end
return binaaghdfghsdgggary
end
end


function multset(binaafgdhjhsdgggary, numbertoset, integerstart, integerend)  
function p.getheader( frame )
if (numbertoset == "1") then
title = mw.title.new( frame.args[1], frame.args[2] )
binaafgdhjhsdgggary = string.sub(binaafgdhjhsdgggary, 0, integerstart-1)..ones(integerend-integerstart+1)..string.sub(binaafgdhjhsdgggary, integerend+1)
content = title:getContent()
elseif(numbertoset == "0") then
--content = string.gsub(content, "([$$$]+)", "DIESER CHARACTER WIRD NICHT UNTERSTÜTZT")
binaafgdhjhsdgggary = string.sub(binaafgdhjhsdgggary, 0, integerstart-1)..zeros(integerend-integerstart+1)..string.sub(binaafgdhjhsdgggary, integerend+1)
content = string.gsub(content, "%=%=+", "§§§")
content = split("hallo"..content, "§§§")
i = 2
length = tablelength(content)
finaltext=""
while (i<=length) do
if (string.match(content[i], "[^[(%s)(%d)(%a)]]")==nil) then
finaltext = finaltext..content[i].."\n\n"
end
i = i + 2
end
end
return binaafgdhjhsdgggary
return finaltext
end
end


function multchangebinall(binaasdgggary, integerstart, integerend)
izgovouv = string.sub(binaasdgggary, integerstart, integerend)
if (izgovouv~=ones(integerend-integerstart+1)) then
binaasdgggary = multset(binaasdgggary, "1",integerstart, integerend)
else
binaasdgggary = multset(binaasdgggary, "0",integerstart, integerend)
end
return binaasdgggary
end


function tran(integedasfr)
 
    integerotut = integedasfr
function p.index( frame )
    if (integedasfr=="1") then
--content = displaytablevert(getindexformat())
        integerotut = "tagselected"
text = frame.args[1]
    elseif (integedasfr=="0") then
stext = split (text, "§§§")
        integerotut = "tagunselected"
currentpage = ""
end
currentheaders= nil
    return integerotut
finish = ""
end
tempfinish =""
 
i = 1
function trancat(integdfghedasfr)
inde = 1
    integerdfghotut = integdfghedasfr
while (i<=tablelength(stext)) do
    if (integdfghedasfr=="1") then
currentpage = stext[i]
        integerdfghotut = "catselected"
currentheaders = headertotablelimit(currentpage, "Yggdrasil")
    elseif (integdfghedasfr=="0") then
currentpage = string.sub(currentpage, 1, string.len(currentpage)-2)
        integerdfghotut = "catunselected"
headlen = tablelength(currentheaders)
end
inde = 1
    return integerdfghotut
while (inde<=headlen) do
end
if (tablelength(currentheaders[inde])==1) then
 
tempfinish = getindexformat()[1]
function tranlinkopen(integasdedasfr)
tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1])
    integerasdotut = integasdedasfr
    if (integasdedasfr=="1") then
tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]")
        integerasdotut = '<span class="linkwhite">'
    elseif (integasdedasfr=="0") then
elseif(tablelength(currentheaders[inde])==2) then
        integerasdotut = '<span class="linkred">'
tempfinish = getindexformat()[2]
end
tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1])
    return integerasdotut
tempfinish = string.gsub(tempfinish, "{{{h2}}}", currentheaders[inde][2])
end
 
tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]")
function multtran(intedfgsdggedasfr)
tempfinish = string.gsub(tempfinish, "{{{h2 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][2].."|"..currentheaders[inde][2].."]]")
    integerodfghdfghtut = intedfgsdggedasfr
    if (intedfgsdggedasfr==ones(string.len(intedfgsdggedasfr))) then
elseif(tablelength(currentheaders[inde])==3) then
        integerodfghdfghtut = "tagselected"
tempfinish = getindexformat()[3]
    else
tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1])
        integerodfghdfghtut = "tagunselected"
tempfinish = string.gsub(tempfinish, "{{{h2}}}", currentheaders[inde][2])
end
tempfinish = string.gsub(tempfinish, "{{{h3}}}", currentheaders[inde][3])
    return integerodfghdfghtut
end
tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]")
 
tempfinish = string.gsub(tempfinish, "{{{h2 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][2].."|"..currentheaders[inde][2].."]]")
function multtranlinkopen(intedsdfgsdfgfgsdggedasfr)
tempfinish = string.gsub(tempfinish, "{{{h3 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][3].."|"..currentheaders[inde][3].."]]")
    asdfintegerodfghdfghtut = intedsdfgsdfgfgsdggedasfr
    if (intedsdfgsdfgfgsdggedasfr==ones(string.len(intedsdfgsdfgfgsdggedasfr))) then
        asdfintegerodfghdfghtut = '<span class="linkwhite">'
    else
        asdfintegerodfghdfghtut = '<span class="linkred">'
end
    return asdfintegerodfghdfghtut
end
 
function getint(binnnarry, ineetger)
return string.sub(binnnarry,ineetger,ineetger)
end
 
function getmultint(binnnarry, ineetgerstarti, inteegerendi)
return string.sub(binnnarry,ineetgerstarti,inteegerendi)
end
 
function numtran(binsnnafsffarry, ineeggsdgtger)
return tran(getint(binsnnafsffarry, ineeggsdgtger))
end
 
function numtrancat(binsnsdfnafsffarry, ineegfdfggsdgtger)
return trancat(getint(binsnsdfnafsffarry, ineegfdfggsdgtger))
end
 
function numtranlinkopen(binhfghsnnarry, ineegdfsdhgtger)
return tranlinkopen(getint(binhfghsnnarry, ineegdfsdhgtger))
end
 
function nummulttran(binsnwrtzeghnarry, ineegsgdfsdhftgereins, ineegsgdfsdhftgerzwei)
return multtran(getmultint(binsnwrtzeghnarry, ineegsgdfsdhftgereins, ineegsgdfsdhftgerzwei))
end
 
function nummulttranlinkopen(binsnnarry, ineegtgereins, ineegtgerzwei)
return multtranlinkopen(getmultint(binsnnarry, ineegtgereins, ineegtgerzwei))
end
 
function categorylist()
gegasdtitle = mw.title.new( "Gegenstände", "Yggdrasil" )
gegconfsatent = gegasdtitle:getContent()
tabbfghbb = headertotable(gegconfsatent)
lastlist = {}
for eiwnes,zwwweites in pairs(tabbfghbb) do
if (tablelength(zwwweites) == 1) then
lastlist[zwwweites[1]] = {}
end
if (tablelength(zwwweites) == 2) then
table.insert(lastlist[zwwweites[1]],zwwweites[2])
end
end
return lastlist --Kategorie-->stringlist:subcategories
end
 
function doubletablelength(taaabaaabaal)
seendlength = 0
for iaubgs,aousbd in pairs(taaabaaabaal) do
seendlength = seendlength+tablelength(aousbd)
end
 
return seendlength
end
 
 
function markheaders(content)
content = content.."\npuffercontent\n"
content = string.gsub(content, "=\n", "=\npuffercontent\n")
content = string.gsub(content, "\n=%s*([^%=]+)%s*=\n", "\n")
content = string.gsub(content, "\n==%s*([^%=]+)%s*==\n", "\n!Anfang2!%1!2Ende!\n")
content = string.gsub(content, "\n===%s*([^%=]+)%s*===\n", "\n!Anfang3!%1!3Ende!\n")
content = string.gsub(content, "\n====%s*([^%=]+)%s*====\n", "\n!Anfang4!%1!4Ende!\n")
content = string.gsub(content, "\n=====%s*([^%=]+)%s*=====\n", "\n!Anfang5!%1!5Ende!\n")
content = string.gsub(content, "\n======%s*([^%=]+)%s*======\n", "\n!Anfang6!%1!6Ende!\n")
return content
end
 
function onllyheaders(content)
content = markheaders(content)
content = string.gsub(content,"!.Ende!\n.-\n!Anfang", "\n\n")
content = string.gsub(content,".*!Anfang", "")
content = string.gsub(content,"!.Ende!.*", "")
return content
end
 
function headertotable(content)
testvar=""
content = onllyheaders(content)
firsthead=1
if (string.find(content, "1!")== nil) then
firsthead=firsthead+1
if (string.find(content, "2!")== nil) then
firsthead=firsthead+1
if (string.find(content, "3!")== nil) then
firsthead=firsthead+1
if (string.find(content, "4!")== nil) then
firsthead=firsthead+1
if (string.find(content, "5!")== nil) then
firsthead=firsthead+1
end
end
end
end
end
iiiiii={1,2,2,2,2,1}
content="puffer\n"..content.."\n\n2!Puffer"
iall=0
headersplit={}
headersplit[1] = split(content,tostring(firsthead).."!")
currenthead={}
finaltable={}
while (iiiiii[1]<tablelength(headersplit[1])-1) do--tablelength(headersplit[1])
iall=iall+1
currenthead[1] = string.gsub(gmatchtable(headersplit[1][iiiiii[1]+1], ".-\n")[1],"\n","")
finaltable[iall]={currenthead[1]..testvar}
headersplit[2] = split(headersplit[1][iiiiii[1]+1],tostring(firsthead+1).."!")
while (iiiiii[2]<=tablelength(headersplit[2])) do
iall=iall+1
currenthead[2] = string.gsub(gmatchtable(headersplit[2][iiiiii[2]], ".-\n")[1],"\n","")
finaltable[iall]={currenthead[1],currenthead[2]}
headersplit[3] = split(headersplit[2][iiiiii[2]],tostring(firsthead+2).."!")
while (iiiiii[3]<=tablelength(headersplit[3])) do
iall=iall+1
currenthead[3] = string.gsub(gmatchtable(headersplit[3][iiiiii[3]], ".-\n")[1],"\n","")
finaltable[iall]={currenthead[1],currenthead[2],currenthead[3]}
headersplit[4] = split(headersplit[3][iiiiii[3]],tostring(firsthead+3).."!")
elseif(tablelength(currentheaders[inde])==4) then
while (iiiiii[4]<=tablelength(headersplit[4])) do
tempfinish = getindexformat()[4]
iall=iall+1
tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1])
currenthead[4] = string.gsub(gmatchtable(headersplit[4][iiiiii[4]], ".-\n")[1],"\n","")
tempfinish = string.gsub(tempfinish, "{{{h2}}}", currentheaders[inde][2])
finaltable[iall]={currenthead[1],currenthead[2],currenthead[3],currenthead[4]}
tempfinish = string.gsub(tempfinish, "{{{h3}}}", currentheaders[inde][3])
tempfinish = string.gsub(tempfinish, "{{{h4}}}", currentheaders[inde][4])
headersplit[5] = split(headersplit[4][iiiiii[4]],tostring(firsthead+4).."!")
while (iiiiii[5]<=tablelength(headersplit[5])) do
iall=iall+1
currenthead[5] = string.gsub(gmatchtable(headersplit[5][iiiiii[5]], ".-\n")[1],"\n","")
finaltable[iall]={currenthead[1],currenthead[2],currenthead[3],currenthead[4],currenthead[5]}
iiiiii[5]=iiiiii[5]+1
end
iiiiii[5]=2
iiiiii[4]=iiiiii[4]+1
end
iiiiii[4]=2
tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]")
tempfinish = string.gsub(tempfinish, "{{{h2 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][2].."|"..currentheaders[inde][2].."]]")
tempfinish = string.gsub(tempfinish, "{{{h3 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][3].."|"..currentheaders[inde][3].."]]")
tempfinish = string.gsub(tempfinish, "{{{h4 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][4].."|"..currentheaders[inde][4].."]]")
iiiiii[3]=iiiiii[3]+1
elseif(tablelength(currentheaders[inde])==5) then
end
tempfinish = getindexformat()[5]
tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1])
tempfinish = string.gsub(tempfinish, "{{{h2}}}", currentheaders[inde][2])
iiiiii[3]=2
tempfinish = string.gsub(tempfinish, "{{{h3}}}", currentheaders[inde][3])
iiiiii[2]=iiiiii[2]+1
tempfinish = string.gsub(tempfinish, "{{{h4}}}", currentheaders[inde][4])
end
tempfinish = string.gsub(tempfinish, "{{{h5}}}", currentheaders[inde][5])
iiiiii[2]=2
iiiiii[1]=iiiiii[1]+1
tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]")
end
tempfinish = string.gsub(tempfinish, "{{{h2 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][2].."|"..currentheaders[inde][2].."]]")
tempfinish = string.gsub(tempfinish, "{{{h3 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][3].."|"..currentheaders[inde][3].."]]")
return finaltable
tempfinish = string.gsub(tempfinish, "{{{h4 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][4].."|"..currentheaders[inde][4].."]]")
 
tempfinish = string.gsub(tempfinish, "{{{h5 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][5].."|"..currentheaders[inde][5].."]]")
end
 
elseif(tablelength(currentheaders[inde])==6) then
function turnstring (stringtoturn)
tempfinish = getindexformat()[6]
turnedstring = ""
tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1])
while (string.len(stringtoturn)>0) do
tempfinish = string.gsub(tempfinish, "{{{h2}}}", currentheaders[inde][2])
turnedstring = string.sub(stringtoturn,1,1)..turnedstring
tempfinish = string.gsub(tempfinish, "{{{h3}}}", currentheaders[inde][3])
stringtoturn = string.sub(stringtoturn,2)
tempfinish = string.gsub(tempfinish, "{{{h4}}}", currentheaders[inde][4])
end
tempfinish = string.gsub(tempfinish, "{{{h5}}}", currentheaders[inde][5])
 
tempfinish = string.gsub(tempfinish, "{{{h6}}}", currentheaders[inde][6])
return turnedstring
end
tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]")
function turntable (tabletoturn)
tempfinish = string.gsub(tempfinish, "{{{h2 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][2].."|"..currentheaders[inde][2].."]]")
turnedtable = {}
tempfinish = string.gsub(tempfinish, "{{{h3 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][3].."|"..currentheaders[inde][3].."]]")
intexi = tablelength(tabletoturn)
tempfinish = string.gsub(tempfinish, "{{{h4 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][4].."|"..currentheaders[inde][4].."]]")
intexinnorm = 1
tempfinish = string.gsub(tempfinish, "{{{h5 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][5].."|"..currentheaders[inde][5].."]]")
while (intexi>0) do
tempfinish = string.gsub(tempfinish, "{{{h6 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][6].."|"..currentheaders[inde][6].."]]")
turnedtable[intexi] = tabletoturn[intexinnorm]
intexi = intexi-1
intexinnorm = intexinnorm+1
end
end
if(tablelength(currentheaders[inde])~=0) then
return turnedtable
if (currentpage=="Religion") then
end
currentpagedis = "Religion/Äscher"
 
elseif(currentpage=="Religion2") then
 
currentpagedis = "Religion/Lacerta"
function relevanttags( tttagstate )
elseif(currentpage=="Religion2") then
aaltags = schlagwortliste()
currentpagedis = "Religion/Lichtalben"
endtags = {}
elseif(currentpage=="Religion2") then
iindexii = 1
currentpagedis = "Religion/Dunkelalben"
realiindexii = 1
elseif(currentpage=="Religion2") then
while (iindexii<=string.len(tttagstate)) do
currentpagedis = "Religion/Dweorgo"
if (string.sub(tttagstate,iindexii,iindexii)=="1") then
elseif(currentpage=="Religion2") then
endtags[realiindexii] = aaltags[iindexii]
currentpagedis = "Religion/Andere"
realiindexii = realiindexii+1
else
end
currentpagedis = currentpage
iindexii = iindexii+1
end
end
return endtags
tempfinish = "|"..string.gsub(string.gsub(tempfinish, "{{{page}}}", currentpagedis),"\n", "",1)
end
tempfinish = string.gsub(tempfinish, "{{{page link}}}", "[[Yggdrasil:"..currentpage.."|"..currentpagedis.."]]")
 
finish = finish..tempfinish.."\n|-\n"
function relevantcats( cccatstate )
end
-- cccatstate = turnstring(cccatstate)
inde=inde+1
aallcats = categorylist()
endcats = {}
endcats["log"] = ""
iiindexiii = string.len(cccatstate)
for scatname, ssubcatnames in pairs(aallcats) do
endcats["log"] = endcats["log"]..scatname..": \n\n"
for subcatindex, ssubcatname in pairs(turntable(ssubcatnames)) do
if (string.sub(cccatstate,iiindexiii,iiindexiii)=="1") then
if (endcats[scatname] == nil) then
endcats[scatname] = {}
end
table.insert(endcats[scatname], ssubcatname)
endcats["log"] = endcats["log"]..ssubcatname.." "..string.sub(cccatstate,iiindexiii,iiindexiii).."\n\n"
end
iiindexiii = iiindexiii-1
end
cccatstate = string.sub(cccatstate,1, iiindexiii)
iiindexiii = string.len(cccatstate)
end
return endcats
end
 
 
function getpartapi(ttagstate, ccatstate)
nosorttlist, cattlist = getapi()
 
 
 
end
 
--##################################################################################################################################################################
--##################################################################################################################################################################
--##################################################################################################################################################################
--##################################################################################################################################################################
--##################################################################################################################################################################
--##################################################################################################################################################################
 
 
function p.cutblock ( frame )
text = frame.args[3]-- "Die Schmiede"
width = tonumber(frame.args[2]) -- 4
height = tonumber(frame.args[1]) -- 12
block = ""
textlen = string.len(text) -- 12
tempsplit = {}
while (height>0 and textlen>=width) do -- 12>0 and 12>=4|11>0 and 11>=4
tempsplit = split(cut(width, text), "%%%@%%") -- ("Die", "Schmiede")| (
block = block..tempsplit[1].." " -- "Die "
text = tempsplit[2] -- "Schmiede"
height = height-1 -- 11
if (text==nil) then
text = ""
end
end
textlen = string.len(text) -- 8
end
i=i+1
if (height>0) then
block = block.." "..text
text = ""
end
end
result = block.."%@%"..text
return finish
result = string.gsub(result, "%§", " ")
return result


--<h2>


end
end


function p.cut( frame )
function p.religion( frame )
testtext = ""
ull = ""
realtext = frame.args[2] --Die Schmiede
if (frame.args[1]=="1") then
realtext = removespaceinlink(realtext) --Die Schmiede
ull = '{{YggRegister|!Religion:Äscher|Religion2:Lacerta|Religion3:Lichtalben|Religion4:Dubkelalben|Religion5:Dweorgo|Religion6:Andere}}'
srealtext = split(realtext, " ") --Die|Schmiede(list)
elseif (frame.args[1]=="2") then
i = 2; --2
ull = '{{YggRegister|Religion:Äscher|!Religion2:Lacerta|Religion3:Lichtalben|Religion4:Dubkelalben|Religion5:Dweorgo|Religion6:Andere}}'
testtext = testtext.."<br \>"..i..": "
elseif (frame.args[1]=="3") then
limit = tonumber(frame.args[1]) --4
ull = '{{YggRegister|Religion:Äscher|Religion2:Lacerta|!Religion3:Lichtalben|Religion4:Dubkelalben|Religion5:Dweorgo|Religion6:Andere}}'
text = display(removespaceinlink(realtext)) --Die Schmiede
elseif (frame.args[1]=="4") then
stext = split(text, " ") --Die|Schmiede(list)
ull = '{{YggRegister|Religion:Äscher|Religion2:Lacerta|Religion3:Lichtalben|!Religion4:Dubkelalben|Religion5:Dweorgo|Religion6:Andere}}'
elseif (frame.args[1]=="5") then
if(table.getn(stext)==1) then
ull = '{{YggRegister|Religion:Äscher|Religion2:Lacerta|Religion3:Lichtalben|Religion4:Dubkelalben|!Religion5:Dweorgo|Religion6:Andere}}'
if(string.len(stext[1])>limit) then
elseif (frame.args[1]=="6") then
return "%@%"..text
ull = '{{YggRegister|Religion:Äscher|Religion2:Lacerta|Religion3:Lichtalben|Religion4:Dubkelalben|Religion5:Dweorgo|!Religion6:Andere}}'
else
end
return text.."%@%"
return ull
end
end
 
 
function p.test( frame )
dieter, dieter2 = gegapi()
dieter2 = dieter2["Kampfutensilien"]["Nahkampfwaffen"][1]
leresti = "Dinge:\n"
    for zahl,dingsi in  pairs(dieter2) do
        leresti = leresti.."*"..zahl..":"
if (dingsi[1]~=nil) then
for zahfgsal,didfsdhngsi in  pairs(dingsi) do
leresti = leresti.." - "..didfsdhngsi
end
else
leresti = leresti.." "..dingsi
end
leresti = leresti.."\n"
end
end
cuttext = stext[1] --Die
realcuttext = srealtext[1] --Die
nextwo = stext[2] --Schmiede
realnextwo = srealtext[2] --Schmiede
nextlen = string.len(nextwo)--8
textlen = string.len(text)--12
cuttextlen = string.len(cuttext)--3
set = true;
testtext = testtext.."<br \>"..i..": "..realcuttext
if(limit>=textlen)then --4>=12
return realtext.."%@%"
elseif(cuttextlen>limit) then--3>4
return "%@%"..realtext
return leresti


else
end
while (cuttextlen+nextlen+1<=textlen+2) do --8+3+1<=12+2(12<=14)|14+3+1<=12+2(18<=14)
 
function p.options( frame )
if(cuttextlen+nextlen+1>limit and set) then --8+3+1>4(12>4)|
stext = split (frame.args[1], "§§§")
set = false
lengthi = tablelength(stext)
cuttext = cuttext.."%@%" --"Die %@%"
finalthing = ""
realcuttext = realcuttext.."%@%" --"Die %@%"
tempeins = stext[1]
tempzwei = stext[2]
else
tempdrei = stext[3]
cuttext = cuttext.." " --
tempvier = stext[4]
realcuttext = realcuttext.." " --
tempfunf = stext[5]
tempsech = stext[6]
end
tempsieb = stext[7]
-- testtext = testtext..tostring(i)..": "..realcuttext.."<br />"
tempacht = stext[8]
i = i + 1 --3
tempneun = stext[9]
if (lengthi==2) then
cuttext = cuttext..nextwo -- "Die%@%Schmiede"
if (string.sub(stext[1],1,1)~="/") then
realcuttext = realcuttext..realnextwo -- "Die%@%Schmiede"
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
else
nextwo = stext[i]-- nil
tempeins = string.sub(tempeins,2)
realnextwo = srealtext[i]-- nil
end
if (string.sub(stext[2],1,1)~="/") then
if (nextwo ~= nil) then
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
nextlen = string.len(nextwo) -- 5
else
end
tempzwei = string.sub(tempzwei,2)
cuttextlen = string.len(cuttext) -- 14
testtext = testtext.."<br \>"..i..": "..realcuttext
end
end
realnextwo = srealtext[i]
finalthing = "*"..tempeins.." (bei 1-50)\n*"..tempzwei.." (bei 51-100)"
if (realnextwo ~= nil) then
elseif(lengthi==3) then
realcuttext = realcuttext.." "..realnextwo
if (string.sub(stext[1],1,1)~="/") then
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
else
tempeins = string.sub(tempeins,2)
end
end
end
if (string.sub(stext[2],1,1)~="/") then
testtext = testtext.."<br \>"..(i+1)..": "..realcuttext
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
return realcuttext
else
end
tempzwei = string.sub(tempzwei,2)
 
end
function p.display ( frame )
if (string.sub(stext[3],1,1)~="/") then
text = frame.args[1]
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
text = text:gsub("'", "")
lend = string.len(text)
i=1
auf = {}
zu = {}
currentauf = string.find(text, "%[%[")
while (currentauf ~= nil) do
auf[i] = currentauf;
if (string.find(string.sub(text,currentauf+2), "%[%[")~=nil)then
currentauf = currentauf+1+string.find(string.sub(text,currentauf+2), "%[%[")
else
else
currentauf = nil
tempdrei = string.sub(tempdrei,2)
end
end
finalthing = "*"..tempeins.." (Bei 1-33)\n*"..tempzwei.." (Bei 34-66)\n*"..tempdrei.." (Bei 67-99)\n*Bei 100: Reroll"
i=i+1
elseif(lengthi==4) then
end
if (string.sub(stext[1],1,1)~="/") then
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
i=1
else
currentzu = string.find(text, "%|")
tempeins = string.sub(tempeins,2)
while (currentzu ~= nil) do
end
zu[i] = currentzu;
if (string.sub(stext[2],1,1)~="/") then
if (string.find(string.sub(text,currentzu+2), "%|")~=nil)then
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
currentzu = currentzu+1+string.find(string.sub(text,currentzu+2), "%|")
else
else
currentzu = nil
tempzwei = string.sub(tempzwei,2)
end
end
i=i+1
if (string.sub(stext[3],1,1)~="/") then
end
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
else
offset = 0
tempdrei = string.sub(tempdrei,2)
end
if(table.getn(auf) == table.getn(zu))then
if (string.sub(stext[4],1,1)~="/") then
tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
i=1
else
while (table.getn(auf)>=i) do
tempvier = string.sub(tempvier,2)
anfang = auf[i]
end
ende = zu[i]
finalthing = "*"..tempeins.." (Bei 1-25)\n*"..tempzwei.." (Bei 26-50)\n*"..tempdrei.." (Bei 51-75)\n*"..tempvier.." (Bei 76-100)"
tt, uu = string.find(string.sub(text, 1, anfang-offset+1), "%[%[(.+)%|")
elseif(lengthi==5) then
text = string.gsub(string.sub(text, 1, anfang-offset+1), "%[%[(.+)%|", "")..string.sub(text,anfang-offset+2,string.len(text))
if (string.sub(stext[1],1,1)~="/") then
-- text = string.sub(text,1,anfang-offset+1)..string.sub(text,ende+1-offset,string.len(text))
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
if (tt ~= nil) and (uu ~= nil) then
else
offset = offset+uu-tt
tempeins = string.sub(tempeins,2)
end
end
i=i+1
if (string.sub(stext[2],1,1)~="/") then
end
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
text = string.gsub(text, "%[%[(.+)%|", "")
else
end
tempzwei = string.sub(tempzwei,2)
end
-- text = text:gsub("%[", "")
if (string.sub(stext[3],1,1)~="/") then
-- text = text:gsub("%|", "")
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
text = text:gsub("%]", "")
else
 
tempdrei = string.sub(tempdrei,2)
 
end
return text
if (string.sub(stext[4],1,1)~="/") then
end
tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
 
 
 
function p.split ( frame )
spl = split(frame.args[1],frame.args[2])
i=1
t=""
while(i<=tablelength(spl)) do
t = t..spl[i].."\n\n"
i=i+1
end
 
    return t
end
 
function p.removespaceinlink(frame)
text = frame.args[1]
i=1
auf = {}
zu = {}
currentauf = string.find(text, "%[%[")
while (currentauf ~= nil) do
auf[i] = currentauf;
if (string.find(string.sub(text,currentauf+2), "%[%[")~=nil)then
currentauf = currentauf+1+string.find(string.sub(text,currentauf+2), "%[%[")
else
else
currentauf = nil
tempvier = string.sub(tempvier,2)
end
end
if (string.sub(stext[5],1,1)~="/") then
i=i+1
tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
end
i=1
currentzu = string.find(text, "%]%]")
while (currentzu ~= nil) do
zu[i] = currentzu;
if (string.find(string.sub(text,currentzu+2), "%]%]")~=nil)then
currentzu = currentzu+1+string.find(string.sub(text,currentzu+2), "%]%]")
else
else
currentzu = nil
tempfunf = string.sub(tempfunf,2)
end
end
i=i+1
finalthing = "*"..tempeins.." (Bei 1-20)\n*"..tempzwei.." (Bei 21-40)\n*"..tempdrei.." (Bei 41-60)\n*"..tempvier.." (Bei 61-80)\n*"..tempfunf.." (Bei 81-100)"
end
elseif(lengthi==6) then
if(table.getn(auf) == table.getn(zu))then
if (string.sub(stext[1],1,1)~="/") then
i=1
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
while (table.getn(auf)>=i) do
else
anfang = auf[i]
tempeins = string.sub(tempeins,2)
ende = zu[i]
text = string.sub(text,1,anfang-1)..string.gsub(string.sub(text,anfang,ende)," ","§")..string.sub(text,ende+1,string.len(text))
 
i=i+1
end
end
end
if (string.sub(stext[2],1,1)~="/") then
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
return text
else
end
tempzwei = string.sub(tempzwei,2)
 
end
 
if (string.sub(stext[3],1,1)~="/") then
 
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
 
else
 
tempdrei = string.sub(tempdrei,2)
 
end
function p.size ( frame )
if (string.sub(stext[4],1,1)~="/") then
text = frame.args[1]
tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
return textSize(text)
else
end
tempvier = string.sub(tempvier,2)
 
end
 
if (string.sub(stext[5],1,1)~="/") then
 
tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
 
else
 
tempfunf = string.sub(tempfunf,2)
function p.size ( frame )
end
text = frame.args[1]
if (string.sub(stext[6],1,1)~="/") then
return textSize(text)
tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
end
else
 
tempsech = string.sub(tempsech,2)
function p.findg( frame )
end
text = frame.args[1]
finalthing = "*"..tempeins.." (Bei 1-16)\n*"..tempzwei.." (Bei 17-32)\n*"..tempdrei.." (Bei 33-48)\n*"..tempvier.." (Bei 49-64)\n*"..tempfunf.." (Bei 65-80)\n*"..tempsech.." (Bei 81-96)\n*Bei 97-100: Reroll"
d,s,r = string.find(text, "g")
elseif(lengthi==7) then
return d,s,r
if (string.sub(stext[1],1,1)~="/") then
 
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
end
else
 
tempeins = string.sub(tempeins,2)
function p.indexold
end
( frame )
if (string.sub(stext[2],1,1)~="/") then
text = frame.args[1]
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
stext = split (text, "§§§")
else
currentpage = ""
tempzwei = string.sub(tempzwei,2)
currentheaders= nil
end
finish = ""
if (string.sub(stext[3],1,1)~="/") then
i = 1
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
inde = 1
else
while (i<=tablelength(stext)) do
tempdrei = string.sub(tempdrei,2)
currentpage = stext[i]
end
currentheaders = getheaderlimit(currentpage, "Yggdrasil")
if (string.sub(stext[4],1,1)~="/") then
currentpage = string.sub(currentpage, 1, string.len(currentpage)-2)
tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
headlen = tablelength(currentheaders)
else
inde = 1
tempvier = string.sub(tempvier,2)
while (inde<=headlen) do
finish = finish.."|[[Yggdrasil:"..currentpage.."#"..currentheaders[inde].."|"..currentheaders[inde].."]]\n|[[Yggdrasil:"..currentpage.."|"..currentpage.."]]\n|-\n"
inde=inde+1
end
end
if (string.sub(stext[5],1,1)~="/") then
i=i+1
tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
end
--text = frame.args[1]
--stext = split (text, "\n")
--ending = ""
--for i = 1,tablelength(stext),1 do
-- currentsplit = split (stext[i], "%>")
-- leng = tablelength(currentsplit)
-- ending = ending.."|[[Yggdrasil:"..currentsplit[2].."#"..currentsplit[1].."|"..currentsplit[1].."]]\n|[[Yggdrasil:"..currentsplit[2].."|"..currentsplit[2].."]]\n|-\n"
--end
return finish
end
 
 
function p.yggrassen( frame )
text = frame.args[1]
stext = split (text, "\n")
haupttext = split (text, "'''Nebenrassen'''")[1]
nebentext = split (text, "'''Nebenrassen'''")[2]
shaupttext = split (haupttext, "\n")
snebentext = split (nebentext, "\n")
ending = "!<big>Hauptrassen</big>\n|-\n"
for i = 2,tablelength(stext),1 do
if (stext[i]=="'''Nebenrassen'''") then
ending = ending.."!<big>Nebenrassen</big>\n|-\n"
else
else
ending = ending.."|<big>'''[[#"..stext[i].."|"..stext[i].."]]'''</big>\n|-\n"
tempfunf = string.sub(tempfunf,2)
end
end
end
if (string.sub(stext[6],1,1)~="/") then
tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
else
tempsech = string.sub(tempsech,2)
 
end
return ending
if (string.sub(stext[7],1,1)~="/") then
 
tempsieb = "[[#"..tempsieb.."|"..tempsieb.."]]"
end
else
 
tempsieb = string.sub(tempsieb,2)
 
end
 
finalthing = "*"..tempeins.." (Bei 1-14)\n*"..tempzwei.." (Bei 15-28)\n*"..tempdrei.." (Bei 29-42)\n*"..tempvier.." (Bei 43-56)\n*"..tempfunf.." (Bei 57-70)\n*"..tempsech.." (Bei 71-84)\n*"..tempsieb.." (Bei 85-98)\n*Bei 99-100: Reroll"
function p.yggtab( frame )
elseif(lengthi==8) then
text = frame.args[1]
if (string.sub(stext[1],1,1)~="/") then
img = frame.args[2]
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
stext = split (text, "§§§")
else
exist = true
tempeins = string.sub(tempeins,2)
imgtext = ''
if (img~=nil and img~='' and img~='{{{img}}}') then
imgtext='<div id="yggimg">[[Datei:'..img..']]</div>\n'
end
i=1
rettext='{|class="wikitable" style="width: 32%; float:right; margin-top: 0; margin-bottom: 0px;"\n|-\n'
while (stext[i+1]~=nil) do
rettext=rettext..'!style="width:32%; padding: 10px;" |'..string.sub(stext[i],2,string.len(stext[i]))..'\n'
i=i+1
if (stext[i+1]~=nil and stext[i]~='-') then
rettext=rettext..'|style="width:68%; padding: 10px;" |'
end
end
if (string.sub(stext[2],1,1)~="/") then
while (stext[i+1]~=nil and stext[i]~='-') do
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
if(string.sub(stext[i],1,1)=='/') then
else
rettext=rettext..string.sub(stext[i],2)
tempzwei = string.sub(tempzwei,2)
elseif(string.find(stext[i],'#')~=nil) then
end
found=string.find(stext[i],'#')
if (string.sub(stext[3],1,1)~="/") then
rettext=rettext..'[[Yggdrasil:'..string.sub(stext[i],1,found-1)..'#'..string.sub(stext[i],found+1,string.len(stext[i]))..'|'..string.sub(stext[i],found+1,string.len(stext[i]))..']]'
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
else
else
tempdrei = string.sub(tempdrei,2)
rettext=rettext..'[[#'..stext[i]..'|'..stext[i]..']]'
end
rettext=rettext..'\n\n'
i=i+1
end
end
 
if (string.sub(stext[4],1,1)~="/") then
rettext=rettext..'|-\n'
tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
i=i+1
else
tempvier = string.sub(tempvier,2)
end
rettext=rettext..'|}'..stext[i-1]..'\n|style="width:20%; padding: 0; vertical-align:top;"|'..imgtext
return '{|style="width:100%;"\n|style="width:80%; padding: 0; vertical-align:top;"|\n'..rettext..'\n|}'
end
 
function p.getpage( frame )
title = mw.title.new( frame.args[1], frame.args[2] )
content = title:getContent()
return content
end
 
function p.getheader( frame )
title = mw.title.new( frame.args[1], frame.args[2] )
content = title:getContent()
--content = string.gsub(content, "([$$$]+)", "DIESER CHARACTER WIRD NICHT UNTERSTÜTZT")
content = string.gsub(content, "%=%=+", "§§§")
content = split("hallo"..content, "§§§")
i = 2
length = tablelength(content)
finaltext=""
while (i<=length) do
if (string.match(content[i], "[^[(%s)(%d)(%a)]]")==nil) then
finaltext = finaltext..content[i].."\n\n"
end
end
i = i + 2
if (string.sub(stext[5],1,1)~="/") then
end
tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
return finaltext
else
end
tempfunf = string.sub(tempfunf,2)
 
end
 
if (string.sub(stext[6],1,1)~="/") then
 
tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
function p.index( frame )
else
--content = displaytablevert(getindexformat())
tempsech = string.sub(tempsech,2)
text = frame.args[1]
end
stext = split (text, "§§§")
if (string.sub(stext[7],1,1)~="/") then
currentpage = ""
tempsieb = "[[#"..tempsieb.."|"..tempsieb.."]]"
currentheaders= nil
else
finish = ""
tempsieb = string.sub(tempsieb,2)
tempfinish =""
end
i = 1
if (string.sub(stext[8],1,1)~="/") then
inde = 1
tempacht = "[[#"..tempacht.."|"..tempacht.."]]"
while (i<=tablelength(stext)) do
else
currentpage = stext[i]
tempacht = string.sub(tempacht,2)
currentheaders = headertotablelimit(currentpage, "Yggdrasil")
end
currentpage = string.sub(currentpage, 1, string.len(currentpage)-2)
finalthing = "*"..tempeins.." (Bei 1-12)\n*"..tempzwei.." (Bei 13-24)\n*"..tempdrei.." (Bei 25-36)\n*"..tempvier.." (Bei 37-48)\n*"..tempfunf.." (Bei 49-60)\n*"..tempsech.." (Bei 61-72)\n*"..tempsieb.." (Bei 73-84)\n*"..tempacht.." (Bei 85-96)\n*Bei 97-100: Reroll"
headlen = tablelength(currentheaders)
elseif(lengthi==9) then
inde = 1
if (string.sub(stext[1],1,1)~="/") then
while (inde<=headlen) do
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
if (tablelength(currentheaders[inde])==1) then
else
tempfinish = getindexformat()[1]
tempeins = string.sub(tempeins,2)
tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1])
end
if (string.sub(stext[2],1,1)~="/") then
tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]")
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
else
elseif(tablelength(currentheaders[inde])==2) then
tempzwei = string.sub(tempzwei,2)
tempfinish = getindexformat()[2]
end
tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1])
if (string.sub(stext[3],1,1)~="/") then
tempfinish = string.gsub(tempfinish, "{{{h2}}}", currentheaders[inde][2])
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
else
tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]")
tempdrei = string.sub(tempdrei,2)
tempfinish = string.gsub(tempfinish, "{{{h2 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][2].."|"..currentheaders[inde][2].."]]")
end
if (string.sub(stext[4],1,1)~="/") then
elseif(tablelength(currentheaders[inde])==3) then
tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
tempfinish = getindexformat()[3]
else
tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1])
tempvier = string.sub(tempvier,2)
tempfinish = string.gsub(tempfinish, "{{{h2}}}", currentheaders[inde][2])
end
tempfinish = string.gsub(tempfinish, "{{{h3}}}", currentheaders[inde][3])
if (string.sub(stext[5],1,1)~="/") then
tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]")
else
tempfinish = string.gsub(tempfinish, "{{{h2 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][2].."|"..currentheaders[inde][2].."]]")
tempfunf = string.sub(tempfunf,2)
tempfinish = string.gsub(tempfinish, "{{{h3 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][3].."|"..currentheaders[inde][3].."]]")
end
if (string.sub(stext[6],1,1)~="/") then
elseif(tablelength(currentheaders[inde])==4) then
tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
tempfinish = getindexformat()[4]
else
tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1])
tempsech = string.sub(tempsech,2)
tempfinish = string.gsub(tempfinish, "{{{h2}}}", currentheaders[inde][2])
end
tempfinish = string.gsub(tempfinish, "{{{h3}}}", currentheaders[inde][3])
if (string.sub(stext[7],1,1)~="/") then
tempfinish = string.gsub(tempfinish, "{{{h4}}}", currentheaders[inde][4])
tempsieb = "[[#"..tempsieb.."|"..tempsieb.."]]"
else
tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]")
tempsieb = string.sub(tempsieb,2)
tempfinish = string.gsub(tempfinish, "{{{h2 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][2].."|"..currentheaders[inde][2].."]]")
end
tempfinish = string.gsub(tempfinish, "{{{h3 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][3].."|"..currentheaders[inde][3].."]]")
if (string.sub(stext[8],1,1)~="/") then
tempfinish = string.gsub(tempfinish, "{{{h4 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][4].."|"..currentheaders[inde][4].."]]")
tempacht = "[[#"..tempacht.."|"..tempacht.."]]"
else
elseif(tablelength(currentheaders[inde])==5) then
tempacht = string.sub(tempacht,2)
tempfinish = getindexformat()[5]
end
tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1])
if (string.sub(stext[9],1,1)~="/") then
tempfinish = string.gsub(tempfinish, "{{{h2}}}", currentheaders[inde][2])
tempneun = "[[#"..tempneun.."|"..tempneun.."]]"
tempfinish = string.gsub(tempfinish, "{{{h3}}}", currentheaders[inde][3])
else
tempfinish = string.gsub(tempfinish, "{{{h4}}}", currentheaders[inde][4])
tempneun = string.sub(tempneun,2)
tempfinish = string.gsub(tempfinish, "{{{h5}}}", currentheaders[inde][5])
end
finalthing = "*"..tempeins.." (Bei 1-11)\n*"..tempzwei.." (Bei 12-22)\n*"..tempdrei.." (Bei 23-33)\n*"..tempvier.." (Bei 34-44)\n*"..tempfunf.." (Bei 45-55)\n*"..tempsech.." (Bei 56-66)\n*"..tempsieb.." (Bei 67-77)\n*"..tempacht.." (Bei 78-88)\n*"..tempneun.." (Bei 89-99)\n*Bei 100: Reroll"
tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]")
else
tempfinish = string.gsub(tempfinish, "{{{h2 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][2].."|"..currentheaders[inde][2].."]]")
finalthing = "Die Anzahl an ausgewählten Optionen wird nicht unterstützt. Erkundige dich, dass du alles richtig geschrieben hast. Falls dir das Maximum von 9 Optionen nicht reicht wende dich bitte an [[Benutzerin:Murmelgrumpf]]"
tempfinish = string.gsub(tempfinish, "{{{h3 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][3].."|"..currentheaders[inde][3].."]]")
end
tempfinish = string.gsub(tempfinish, "{{{h4 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][4].."|"..currentheaders[inde][4].."]]")
return finalthing
tempfinish = string.gsub(tempfinish, "{{{h5 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][5].."|"..currentheaders[inde][5].."]]")
end
elseif(tablelength(currentheaders[inde])==6) then
function p.optionsnodice( frame )
tempfinish = getindexformat()[6]
stext = split (frame.args[1], "§§§")
tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1])
lengthi = tablelength(stext)
tempfinish = string.gsub(tempfinish, "{{{h2}}}", currentheaders[inde][2])
finalthing = ""
tempfinish = string.gsub(tempfinish, "{{{h3}}}", currentheaders[inde][3])
tempeins = stext[1]
tempfinish = string.gsub(tempfinish, "{{{h4}}}", currentheaders[inde][4])
tempzwei = stext[2]
tempfinish = string.gsub(tempfinish, "{{{h5}}}", currentheaders[inde][5])
tempdrei = stext[3]
tempfinish = string.gsub(tempfinish, "{{{h6}}}", currentheaders[inde][6])
tempvier = stext[4]
tempfunf = stext[5]
tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]")
tempsech = stext[6]
tempfinish = string.gsub(tempfinish, "{{{h2 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][2].."|"..currentheaders[inde][2].."]]")
tempsieb = stext[7]
tempfinish = string.gsub(tempfinish, "{{{h3 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][3].."|"..currentheaders[inde][3].."]]")
tempacht = stext[8]
tempfinish = string.gsub(tempfinish, "{{{h4 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][4].."|"..currentheaders[inde][4].."]]")
tempneun = stext[9]
tempfinish = string.gsub(tempfinish, "{{{h5 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][5].."|"..currentheaders[inde][5].."]]")
if (lengthi==2) then
tempfinish = string.gsub(tempfinish, "{{{h6 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][6].."|"..currentheaders[inde][6].."]]")
if (string.sub(stext[1],1,1)~="/") then
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
else
tempeins = string.sub(tempeins,2)
end
end
if(tablelength(currentheaders[inde])~=0) then
if (string.sub(stext[2],1,1)~="/") then
if (currentpage=="Religion") then
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
currentpagedis = "Religion/Äscher"
else
elseif(currentpage=="Religion2") then
tempzwei = string.sub(tempzwei,2)
currentpagedis = "Religion/Lacerta"
elseif(currentpage=="Religion2") then
currentpagedis = "Religion/Lichtalben"
elseif(currentpage=="Religion2") then
currentpagedis = "Religion/Dunkelalben"
elseif(currentpage=="Religion2") then
currentpagedis = "Religion/Dweorgo"
elseif(currentpage=="Religion2") then
currentpagedis = "Religion/Andere"
else
currentpagedis = currentpage
end
tempfinish = "|"..string.gsub(string.gsub(tempfinish, "{{{page}}}", currentpagedis),"\n", "",1)
tempfinish = string.gsub(tempfinish, "{{{page link}}}", "[[Yggdrasil:"..currentpage.."|"..currentpagedis.."]]")
finish = finish..tempfinish.."\n|-\n"
end
inde=inde+1
end
end
finalthing = "*"..tempeins.."\n*"..tempzwei
i=i+1
elseif(lengthi==3) then
end
if (string.sub(stext[1],1,1)~="/") then
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
return finish
else
 
tempeins = string.sub(tempeins,2)
--<h2>
end
 
if (string.sub(stext[2],1,1)~="/") then
end
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
 
else
function p.religion( frame )
tempzwei = string.sub(tempzwei,2)
ull = ""
end
if (frame.args[1]=="1") then
if (string.sub(stext[3],1,1)~="/") then
ull = '{{YggRegister|!Religion:Äscher|Religion2:Lacerta|Religion3:Lichtalben|Religion4:Dubkelalben|Religion5:Dweorgo|Religion6:Andere}}'
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
elseif (frame.args[1]=="2") then
else
ull = '{{YggRegister|Religion:Äscher|!Religion2:Lacerta|Religion3:Lichtalben|Religion4:Dubkelalben|Religion5:Dweorgo|Religion6:Andere}}'
tempdrei = string.sub(tempdrei,2)
elseif (frame.args[1]=="3") then
end
ull = '{{YggRegister|Religion:Äscher|Religion2:Lacerta|!Religion3:Lichtalben|Religion4:Dubkelalben|Religion5:Dweorgo|Religion6:Andere}}'
finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei
elseif (frame.args[1]=="4") then
elseif(lengthi==4) then
ull = '{{YggRegister|Religion:Äscher|Religion2:Lacerta|Religion3:Lichtalben|!Religion4:Dubkelalben|Religion5:Dweorgo|Religion6:Andere}}'
if (string.sub(stext[1],1,1)~="/") then
elseif (frame.args[1]=="5") then
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
ull = '{{YggRegister|Religion:Äscher|Religion2:Lacerta|Religion3:Lichtalben|Religion4:Dubkelalben|!Religion5:Dweorgo|Religion6:Andere}}'
else
elseif (frame.args[1]=="6") then
tempeins = string.sub(tempeins,2)
ull = '{{YggRegister|Religion:Äscher|Religion2:Lacerta|Religion3:Lichtalben|Religion4:Dubkelalben|Religion5:Dweorgo|!Religion6:Andere}}'
end
end
if (string.sub(stext[2],1,1)~="/") then
return ull
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
end
else
 
tempzwei = string.sub(tempzwei,2)
 
end
function p.test( frame )
if (string.sub(stext[3],1,1)~="/") then
dieter, dieter2 = gegapi()
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
dieter2 = dieter2["Kampfutensilien"]["Nahkampfwaffen"][1]
else
leresti = "Dinge:\n"
tempdrei = string.sub(tempdrei,2)
    for zahl,dingsi in  pairs(dieter2) do
end
        leresti = leresti.."*"..zahl..":"
if (string.sub(stext[4],1,1)~="/") then
if (dingsi[1]~=nil) then
tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
for zahfgsal,didfsdhngsi in  pairs(dingsi) do
leresti = leresti.." - "..didfsdhngsi
end
else
else
leresti = leresti.." "..dingsi
tempvier = string.sub(tempvier,2)
end
end
leresti = leresti.."\n"
finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei.."\n*"..tempvier
end
elseif(lengthi==5) then
return leresti
 
end
 
function p.options( frame )
stext = split (frame.args[1], "§§§")
lengthi = tablelength(stext)
finalthing = ""
tempeins = stext[1]
tempzwei = stext[2]
tempdrei = stext[3]
tempvier = stext[4]
tempfunf = stext[5]
tempsech = stext[6]
tempsieb = stext[7]
tempacht = stext[8]
tempneun = stext[9]
if (lengthi==2) then
if (string.sub(stext[1],1,1)~="/") then
if (string.sub(stext[1],1,1)~="/") then
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
Zeile 1.428: Zeile 873:
tempzwei = string.sub(tempzwei,2)
tempzwei = string.sub(tempzwei,2)
end
end
finalthing = "*"..tempeins.." (Bei 1-50)\n*"..tempzwei.." (Bei 51-100)"
if (string.sub(stext[3],1,1)~="/") then
elseif(lengthi==3) then
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
if (string.sub(stext[1],1,1)~="/") then
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
else
else
tempeins = string.sub(tempeins,2)
tempdrei = string.sub(tempdrei,2)
end
end
if (string.sub(stext[2],1,1)~="/") then
if (string.sub(stext[4],1,1)~="/") then
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
else
else
tempzwei = string.sub(tempzwei,2)
tempvier = string.sub(tempvier,2)
end
end
if (string.sub(stext[3],1,1)~="/") then
if (string.sub(stext[5],1,1)~="/") then
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
else
else
tempdrei = string.sub(tempdrei,2)
tempfunf = string.sub(tempfunf,2)
end
end
finalthing = "*"..tempeins.." (Bei 1-33)\n*"..tempzwei.." (Bei 34-66)\n*"..tempdrei.." (Bei 67-99)\n*Bei 100: Reroll"
finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei.."\n*"..tempvier.."\n*"..tempfunf
elseif(lengthi==4) then
elseif(lengthi==6) then
if (string.sub(stext[1],1,1)~="/") then
if (string.sub(stext[1],1,1)~="/") then
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
Zeile 1.467: Zeile 910:
tempvier = string.sub(tempvier,2)
tempvier = string.sub(tempvier,2)
end
end
finalthing = "*"..tempeins.." (Bei 1-25)\n*"..tempzwei.." (Bei 26-50)\n*"..tempdrei.." (Bei 51-75)\n*"..tempvier.." (Bei 76-100)"
if (string.sub(stext[5],1,1)~="/") then
elseif(lengthi==5) then
tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
if (string.sub(stext[1],1,1)~="/") then
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
else
else
tempeins = string.sub(tempeins,2)
tempfunf = string.sub(tempfunf,2)
end
if (string.sub(stext[6],1,1)~="/") then
tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
else
tempsech = string.sub(tempsech,2)
end
finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei.."\n*"..tempvier.."\n*"..tempfunf.."\n*"..tempsech
elseif(lengthi==7) then
if (string.sub(stext[1],1,1)~="/") then
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
else
tempeins = string.sub(tempeins,2)
end
end
if (string.sub(stext[2],1,1)~="/") then
if (string.sub(stext[2],1,1)~="/") then
Zeile 1.494: Zeile 947:
tempfunf = string.sub(tempfunf,2)
tempfunf = string.sub(tempfunf,2)
end
end
finalthing = "*"..tempeins.." (Bei 1-20)\n*"..tempzwei.." (Bei 21-40)\n*"..tempdrei.." (Bei 41-60)\n*"..tempvier.." (Bei 61-80)\n*"..tempfunf.." (Bei 81-100)"
if (string.sub(stext[6],1,1)~="/") then
elseif(lengthi==6) then
tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
else
tempsech = string.sub(tempsech,2)
end
if (string.sub(stext[7],1,1)~="/") then
tempsieb = "[[#"..tempsieb.."|"..tempsieb.."]]"
else
tempsieb = string.sub(tempsieb,2)
end
finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei.."\n*"..tempvier.."\n*"..tempfunf.."\n*"..tempsech.."\n*"..tempsieb
elseif(lengthi==8) then
if (string.sub(stext[1],1,1)~="/") then
if (string.sub(stext[1],1,1)~="/") then
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
Zeile 1.526: Zeile 989:
tempsech = string.sub(tempsech,2)
tempsech = string.sub(tempsech,2)
end
end
finalthing = "*"..tempeins.." (Bei 1-16)\n*"..tempzwei.." (Bei 17-32)\n*"..tempdrei.." (Bei 33-48)\n*"..tempvier.." (Bei 49-64)\n*"..tempfunf.." (Bei 65-80)\n*"..tempsech.." (Bei 81-96)\n*Bei 97-100: Reroll"
if (string.sub(stext[7],1,1)~="/") then
elseif(lengthi==7) then
tempsieb = "[[#"..tempsieb.."|"..tempsieb.."]]"
else
tempsieb = string.sub(tempsieb,2)
end
if (string.sub(stext[8],1,1)~="/") then
tempacht = "[[#"..tempacht.."|"..tempacht.."]]"
else
tempacht = string.sub(tempacht,2)
end
finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei.."\n*"..tempvier.."\n*"..tempfunf.."\n*"..tempsech.."\n*"..tempsieb.."\n*"..tempacht
elseif(lengthi==9) then
if (string.sub(stext[1],1,1)~="/") then
if (string.sub(stext[1],1,1)~="/") then
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
Zeile 1.563: Zeile 1.036:
tempsieb = string.sub(tempsieb,2)
tempsieb = string.sub(tempsieb,2)
end
end
finalthing = "*"..tempeins.." (Bei 1-14)\n*"..tempzwei.." (Bei 15-28)\n*"..tempdrei.." (Bei 29-42)\n*"..tempvier.." (Bei 43-56)\n*"..tempfunf.." (Bei 57-70)\n*"..tempsech.." (Bei 71-84)\n*"..tempsieb.." (Bei 85-98)\n*Bei 99-100: Reroll"
if (string.sub(stext[8],1,1)~="/") then
elseif(lengthi==8) then
tempacht = "[[#"..tempacht.."|"..tempacht.."]]"
if (string.sub(stext[1],1,1)~="/") then
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
else
else
tempeins = string.sub(tempeins,2)
tempacht = string.sub(tempacht,2)
end
end
if (string.sub(stext[2],1,1)~="/") then
if (string.sub(stext[9],1,1)~="/") then
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
tempneun = "[[#"..tempneun.."|"..tempneun.."]]"
else
else
tempzwei = string.sub(tempzwei,2)
tempneun = string.sub(tempneun,2)
end
end
if (string.sub(stext[3],1,1)~="/") then
finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei.."\n*"..tempvier.."\n*"..tempfunf.."\n*"..tempsech.."\n*"..tempsieb.."\n*"..tempacht.."\n*"..tempneun
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
else
else
finalthing = "Die Anzahl an ausgewählten Optionen wird nicht unterstützt. Erkundige dich, dass du alles richtig geschrieben hast. Falls dir das Maximum von 9 Optionen nicht reicht wende dich bitte an [[Benutzerin:Murmelgrumpf]]"
tempdrei = string.sub(tempdrei,2)
end
end
return finalthing
if (string.sub(stext[4],1,1)~="/") then
tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
end
else
function p.kampf( frame )
tempvier = string.sub(tempvier,2)
    stext = split (frame.args[1], "§§§")
end
lengthi = tablelength(stext)
if (string.sub(stext[5],1,1)~="/") then
curthing = ""
tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
eendrest = ""
else
for nudmbr,crdrent in ipairs(stext) do
tempfunf = string.sub(tempfunf,2)
curthing = split (stext[nudmbr], ">")
end
eendrest = eendrest.."|"..curthing[1].."\n|"..curthing[2].."\n|"..curthing[3].."\n|-\n"
if (string.sub(stext[6],1,1)~="/") then
end
tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
return eendrest
else
end
tempsech = string.sub(tempsech,2)
 
end
function p.dia( frame )
if (string.sub(stext[7],1,1)~="/") then
    stext = split (frame.args[1], "§§§")
tempsieb = "[[#"..tempsieb.."|"..tempsieb.."]]"
lengthi = tablelength(stext)
else
curthing = ""
tempsieb = string.sub(tempsieb,2)
eendrest = ""
end
for nudmbr,crdrent in ipairs(stext) do
if (string.sub(stext[8],1,1)~="/") then
curthing = split (stext[nudmbr], ":")
tempacht = "[[#"..tempacht.."|"..tempacht.."]]"
eendrest = eendrest.."\n'''"..curthing[1]..":'''\n\n„"..curthing[2].."\n"
else
end
tempacht = string.sub(tempacht,2)
eendrest = string.gsub(eendrest, "(\n[\n%s]*)", "''%1''")
end
return eendrest
finalthing = "*"..tempeins.." (Bei 1-12)\n*"..tempzwei.." (Bei 13-24)\n*"..tempdrei.." (Bei 25-36)\n*"..tempvier.." (Bei 37-48)\n*"..tempfunf.." (Bei 49-60)\n*"..tempsech.." (Bei 61-72)\n*"..tempsieb.." (Bei 73-84)\n*"..tempacht.." (Bei 85-96)\n*Bei 97-100: Reroll"
end
elseif(lengthi==9) then
function p.image( frame )
if (string.sub(stext[1],1,1)~="/") then
imaage = "[[Datei:"..frame.args[1]
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
if (frame.args[2]~=nil) then
else
imaage = imaage.."|"..frame.args[2]
tempeins = string.sub(tempeins,2)
end
end
if (frame.args[3]~=nil) then
if (string.sub(stext[2],1,1)~="/") then
imaage = imaage.."|"..frame.args[3]
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
end
else
if (frame.args[4]~=nil) then
tempzwei = string.sub(tempzwei,2)
imaage = imaage.."|"..frame.args[4]
end
end
if (string.sub(stext[3],1,1)~="/") then
if (frame.args[5]~=nil) then
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
imaage = imaage.."|"..frame.args[5]
else
end
tempdrei = string.sub(tempdrei,2)
if (frame.args[6]~=nil) then
end
imaage = imaage.."|"..frame.args[6]
if (string.sub(stext[4],1,1)~="/") then
end
tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
imaage = imaage.."]]"
else
return imaage
tempvier = string.sub(tempvier,2)
end
end
 
if (string.sub(stext[5],1,1)~="/") then
 
tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
function p.vid( frame )
else
stext = split (frame.args[2], "§§§")
tempfunf = string.sub(tempfunf,2)
seend = "Hier kannst du das Abenteuer von ["..frame.args[1].."] noch einmal nachschauen! Viel Spaß! :)\n"..'{|class="wikitable"\n|-\n'
end
    for nuudmbr,curdrent in ipairs(stext) do
if (string.sub(stext[6],1,1)~="/") then
seend = seend.."!Teil "..tostring(nuudmbr).."\n"
tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
end
else
seend = seend.."|-\n"
tempsech = string.sub(tempsech,2)
    for nuudmbr,curdrent in ipairs(stext) do
end
seend = seend.."|"..frame:callParserFunction('#tag:youtube', curdrent).."\nFalls das Video nicht richtig angezeigt wird, kannst du es ["..curdrent.." hier] finden.\n"
if (string.sub(stext[7],1,1)~="/") then
end
tempsieb = "[[#"..tempsieb.."|"..tempsieb.."]]"
seend = seend.."|-\n|}\n"
else
return seend
tempsieb = string.sub(tempsieb,2)
end
 
function p.talents( frame )
handeln = split (frame.args[1], "\n")
wissen = split (frame.args[2], "\n")
soziales = split (frame.args[3], "\n")
    lenlist = {}
lenlist[1] = tablelength(handeln)
lenlist[2] = tablelength(wissen)
lenlist[3] = tablelength(soziales)
highesst = gethighest(lenlist)
intex = 1
selast = ""
while (intex<=highesst) do
selast = selast.."|"
if (handeln[intex]~=nil) then
selast = selast..handeln[intex]
end
end
if (string.sub(stext[8],1,1)~="/") then
selast = selast.."\n|"
tempacht = "[[#"..tempacht.."|"..tempacht.."]]"
if (wissen[intex]~=nil) then
else
selast = selast..wissen[intex]
tempacht = string.sub(tempacht,2)
end
end
if (string.sub(stext[9],1,1)~="/") then
selast = selast.."\n|"
tempneun = "[[#"..tempneun.."|"..tempneun.."]]"
if (soziales[intex]~=nil) then
else
selast = selast..soziales[intex]
tempneun = string.sub(tempneun,2)
end
end
finalthing = "*"..tempeins.." (Bei 1-11)\n*"..tempzwei.." (Bei 12-22)\n*"..tempdrei.." (Bei 23-33)\n*"..tempvier.." (Bei 34-44)\n*"..tempfunf.." (Bei 45-55)\n*"..tempsech.." (Bei 56-66)\n*"..tempsieb.." (Bei 67-77)\n*"..tempacht.." (Bei 78-88)\n*"..tempneun.." (Bei 89-99)\n*Bei 100: Reroll"
selast = selast.."\n|-\n"
else
intex = intex+1
finalthing = "Die Anzahl an ausgewählten Optionen wird nicht unterstützt. Erkundige dich, dass du alles richtig geschrieben hast. Falls dir das Maximum von 9 Optionen nicht reicht wende dich bitte an [[Benutzerin:Murmelgrumpf]]"
end
end
return finalthing
return selast
end
end
function p.optionsnodice( frame )
 
stext = split (frame.args[1], "§§§")
function p.description( frame )
lengthi = tablelength(stext)
    stext = split (frame.args[1], "§§§")
finalthing = ""
eerndrest=""
tempeins = stext[1]
if(tabContains(stext,"Szene")) then
tempzwei = stext[2]
eerndrest = eerndrest.."'''Szenen:'''\nSzenen geben Handlung und Orte vor, die die Spieler meist passiv miterleben.\n\n"
tempdrei = stext[3]
end
tempvier = stext[4]
if(tabContains(stext,"Inter")) then
tempfunf = stext[5]
eerndrest = eerndrest.."'''<span style='color:#BB0011;'>Interaktionen:</span>'''\nInteraktionen sind aktive Szenen, die eine Interaktion mit den Spielern erfordern.\n\n"
tempsech = stext[6]
end
tempsieb = stext[7]
if(tabContains(stext,"Kursiv")) then
tempacht = stext[8]
eerndrest = eerndrest.."''Kursive Texte:''\nKursive Texte können wörtlich vorgetragen werden und beinhalten meist direkte Rede oder Beschreibungen.\n\n"
tempneun = stext[9]
end
if (lengthi==2) then
if(tabContains(stext,"Probe")) then
if (string.sub(stext[1],1,1)~="/") then
eerndrest = eerndrest.."'''<span style='color:#31B404;'>Proben:</span>'''\nSteht für mögliche Talentwürfe, welche die Spieler ablegen müssen.\n\n"
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
end
else
if(tabContains(stext,"Moral")) then  
tempeins = string.sub(tempeins,2)
eerndrest = eerndrest.."'''<span style='color:#00b8ff;'>Moral:</span>'''\nBeinhaltet Situationen, an denen die Spieler moralische Fragen beantworten müssen, die sich auf den Verlauf des Abenteuers auswirken können.\n\n"
end
end
if (string.sub(stext[2],1,1)~="/") then
if(tabContains(stext,"Module")) then
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
eerndrest = eerndrest.."'''<span style='color:#4B088A;'>Module:</span>'''\nBeinhalten Regeln, die zusätzlich zum Grundregelwerk in diesem Abenteuer verwendet werden.\n\n"
else
end
tempzwei = string.sub(tempzwei,2)
if(tabContains(stext,"Module2")) then  
eerndrest = eerndrest.."'''<span style='color:#0014ff;'>Module 2:</span>'''\nBeinhaltet ebenfalls Regeln, eines anderen Modul allerdings, die farblich vom ersten Modul abgegrenzt sind.\n\n"
end
if(tabContains(stext,"Box")) then
eerndrest = eerndrest.."<div class='box'>'''Boxen:''' Boxen stehen für Spielleiterhinweise und beinhalten meist Hintergrundinformationen, welche die Spieler nicht haben können.</div>\n\n"
end
return string.sub(eerndrest,0,string.len(eerndrest)-2)
end
 
function p.ygggegerror ( frame )
displayedtext = "\n\n----\n\n"
listeeins, listezwei = gegapi()
headerends = {}
schlagworte = schlagwortliste()
for eines,zweites in pairs(listeeins) do
table.insert(headerends,listeeins[eines]["Name"])
for qfsdf,zweihgfhgtes in pairs(listeeins[eines]["Schlagwörter"]) do
if (tabContains(schlagworte,zweihgfhgtes)==nil) then
displayedtext = displayedtext..'<span style="color:red;"><big><big><big> Falsches Schlagwort gefunden: "'..zweihgfhgtes..'"'..", unter: '''("..listeeins[eines]["Category"].." - "..listeeins[eines]["Subcategory"].." - "..listeeins[eines]["Name"]..")'''!Bitte Ändern!</big></big></big>"..'</span>\n\n----\n\n'
end
end
end
finalthing = "*"..tempeins.."\n*"..tempzwei
end
elseif(lengthi==3) then
dupeeeetab = duptable(headerends)
if (string.sub(stext[1],1,1)~="/") then
for zup,dupeeee in pairs(dupeeeetab) do
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
if (dupeeee~=nil) then
else
displayedtext = displayedtext..'<span style="color:red;"><big><big><big>Duplikat gefunden: "'..listeeins[dupeeee[1]]["Name"]..'"'..", unter: '''("..listeeins[dupeeee[1]]["Category"]..' - '..listeeins[dupeeee[1]]["Subcategory"]..")''' und unter: '''("..listeeins[dupeeee[2]]["Category"]..' - '..listeeins[dupeeee[2]]["Subcategory"]..")''' !Bitte Ändern!</big></big></big>"..'</span>\n\n----\n\n'
tempeins = string.sub(tempeins,2)
end
end
if (string.sub(stext[2],1,1)~="/") then
end
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
else
tempzwei = string.sub(tempzwei,2)
return displayedtext
end
 
if (string.sub(stext[3],1,1)~="/") then
end
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
 
else
function p.testzwei ( frame )
tempdrei = string.sub(tempdrei,2)
 
return frame.args["test"]
end
 
function p.cur ( frame )
thingtext = frame.args[1]
thingtext = string.gsub(thingtext, "(\n+)", "''%1''")
return thingtext
end
 
function p.probe ( frame )
return "'''<span style='color:#31B404;'>"..string.gsub(frame.args[1], "(\n+)" , "</span>'''%1'''<span style='color:#31B404;'>").."</span>'''"
end
 
function p.taglist ( frame )
currenttagstate = frame.args[2]
currentcatstate = frame.args[3]
currentsite = frame.args[1]
allsetcats = categorylist()
allsetags = schlagwortliste()
if (string.len(currenttagstate)~=tablelength(allsetags)) then
currenttagstate = zeros(tablelength(allsetags))
end
if (string.len(currentcatstate)~=doubletablelength(allsetcats)) then
currentcatstate = zeros(doubletablelength(allsetcats))
end
sefinalendtext = '{|class="tagholder"\n|style="width:40%"|\n'
tagstatelength = string.len(currenttagstate)
catstatelength = string.len(currentcatstate)
countcat = 1
for curcatname,cursubcats in pairs(allsetcats) do
cursublength = tablelength(cursubcats)
catstdif = catstatelength-cursublength+1
sefinalendtext = sefinalendtext..'{|class="'..nummulttran(currentcatstate,catstdif,catstatelength)..'"\n|'..nummulttranlinkopen(currentcatstate,catstdif,catstatelength)..'[https://howtobeahero.de/index.php?title='..currentsite..'&tagstate='..currenttagstate..'&catstate='..multchangebinall(currentcatstate, catstdif, catstatelength).." "..curcatname..":]</span>\n"  
nowcatstatelength = catstatelength-cursublength
while (catstatelength>nowcatstatelength) do
cursubcatname = allsetcats[curcatname][catstatelength-nowcatstatelength]
sefinalendtext = sefinalendtext..'{|class="'..numtrancat(currentcatstate,catstatelength)..'"\n|'..numtranlinkopen(currentcatstate,catstatelength)..'[https://howtobeahero.de/index.php?title='..currentsite..'&tagstate='..currenttagstate..'&catstate='..changebin(currentcatstate,catstatelength).." "..cursubcatname.."]</span>\n|}\n"--..numtranlinkopen(
catstatelength = catstatelength-1
end
end
finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei
sefinalendtext = sefinalendtext.."\n|}"
elseif(lengthi==4) then
if (countcat%2==0) then
if (string.sub(stext[1],1,1)~="/") then
sefinalendtext = sefinalendtext.."\n<div>\n\n</div>\n"
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
else
else
tempeins = string.sub(tempeins,2)
sefinalendtext = sefinalendtext.."\n"
end
end
if (string.sub(stext[2],1,1)~="/") then
countcat=countcat+1
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
else
end
tempzwei = string.sub(tempzwei,2)
sefinalendtext = sefinalendtext..'|style="width:40%"|\n'
    while (tagstatelength>0) do
        sefinalendtext=sefinalendtext..'{|class="'..numtran(currenttagstate,tagstatelength)..'"\n|'..numtranlinkopen(currenttagstate,tagstatelength)..'[https://howtobeahero.de/index.php?title='..currentsite..'&tagstate='..changebin(currenttagstate,tagstatelength)..'&catstate='..currentcatstate.." "..allsetags[tagstatelength]..' •]</span>\n|}\n'
tagstatelength = tagstatelength-1
end
    sefinalendtext=sefinalendtext..'|style="width:20%"|\n'
 
senosort, secatliste= getpartapi(currenttagstate,currentcatstate)
sefinalendtext=sefinalendtext..'|-\n|colspan="5" align="left"|\n'
yggtabaapie = getyggtabapi(currenttagstate,currentcatstate)
descuu = getdes()
for nasf, dgasd in pairs(yggtabaapie) do
sefinalendtext = sefinalendtext.."=="..nasf.."==\n\n<big><big>"..descuu[nasf].."</big></big>\n\n"
for nassfsf, dgadasd in pairs(dgasd) do
sefinalendtext = sefinalendtext.."==="..nassfsf.."===\n\n<big><big>"..descuu[nassfsf].."</big></big>\n\n"
for nasfgjsfsf, dgagdfgdasd in pairs(dgadasd) do
sefinalendtext = sefinalendtext.."===="..nasfgjsfsf.."====\n\n"
frargs = {[1] = dgagdfgdasd["TabID"], [2] = dgagdfgdasd["Img"]}
rfr = frame
rfr.args = frargs
sefinalendtext = sefinalendtext..p.yggtab(rfr).."\n\n"
end
end
end
if (string.sub(stext[3],1,1)~="/") then
end
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
sefinalendtext = sefinalendtext.."|}"
else
--resulttext = yggtabaapie["log"]
tempdrei = string.sub(tempdrei,2)
end
return sefinalendtext.."\n\n"
if (string.sub(stext[4],1,1)~="/") then
end
tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
else
tempvier = string.sub(tempvier,2)
end
finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei.."\n*"..tempvier
elseif(lengthi==5) then
if (string.sub(stext[1],1,1)~="/") then
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
else
tempeins = string.sub(tempeins,2)
end
if (string.sub(stext[2],1,1)~="/") then
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
else
tempzwei = string.sub(tempzwei,2)
end
if (string.sub(stext[3],1,1)~="/") then
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
else
tempdrei = string.sub(tempdrei,2)
end
if (string.sub(stext[4],1,1)~="/") then
tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
else
tempvier = string.sub(tempvier,2)
end
if (string.sub(stext[5],1,1)~="/") then
tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
else
tempfunf = string.sub(tempfunf,2)
end
finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei.."\n*"..tempvier.."\n*"..tempfunf
elseif(lengthi==6) then
if (string.sub(stext[1],1,1)~="/") then
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
else
tempeins = string.sub(tempeins,2)
end
if (string.sub(stext[2],1,1)~="/") then
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
else
tempzwei = string.sub(tempzwei,2)
end
if (string.sub(stext[3],1,1)~="/") then
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
else
tempdrei = string.sub(tempdrei,2)
end
if (string.sub(stext[4],1,1)~="/") then
tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
else
tempvier = string.sub(tempvier,2)
end
if (string.sub(stext[5],1,1)~="/") then
tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
else
tempfunf = string.sub(tempfunf,2)
end
if (string.sub(stext[6],1,1)~="/") then
tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
else
tempsech = string.sub(tempsech,2)
end
finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei.."\n*"..tempvier.."\n*"..tempfunf.."\n*"..tempsech
elseif(lengthi==7) then
if (string.sub(stext[1],1,1)~="/") then
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
else
tempeins = string.sub(tempeins,2)
end
if (string.sub(stext[2],1,1)~="/") then
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
else
tempzwei = string.sub(tempzwei,2)
end
if (string.sub(stext[3],1,1)~="/") then
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
else
tempdrei = string.sub(tempdrei,2)
end
if (string.sub(stext[4],1,1)~="/") then
tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
else
tempvier = string.sub(tempvier,2)
end
if (string.sub(stext[5],1,1)~="/") then
tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
else
tempfunf = string.sub(tempfunf,2)
end
if (string.sub(stext[6],1,1)~="/") then
tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
else
tempsech = string.sub(tempsech,2)
end
if (string.sub(stext[7],1,1)~="/") then
tempsieb = "[[#"..tempsieb.."|"..tempsieb.."]]"
else
tempsieb = string.sub(tempsieb,2)
end
finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei.."\n*"..tempvier.."\n*"..tempfunf.."\n*"..tempsech.."\n*"..tempsieb
elseif(lengthi==8) then
if (string.sub(stext[1],1,1)~="/") then
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
else
tempeins = string.sub(tempeins,2)
end
if (string.sub(stext[2],1,1)~="/") then
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
else
tempzwei = string.sub(tempzwei,2)
end
if (string.sub(stext[3],1,1)~="/") then
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
else
tempdrei = string.sub(tempdrei,2)
end
if (string.sub(stext[4],1,1)~="/") then
tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
else
tempvier = string.sub(tempvier,2)
end
if (string.sub(stext[5],1,1)~="/") then
tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
else
tempfunf = string.sub(tempfunf,2)
end
if (string.sub(stext[6],1,1)~="/") then
tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
else
tempsech = string.sub(tempsech,2)
end
if (string.sub(stext[7],1,1)~="/") then
tempsieb = "[[#"..tempsieb.."|"..tempsieb.."]]"
else
tempsieb = string.sub(tempsieb,2)
end
if (string.sub(stext[8],1,1)~="/") then
tempacht = "[[#"..tempacht.."|"..tempacht.."]]"
else
tempacht = string.sub(tempacht,2)
end
finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei.."\n*"..tempvier.."\n*"..tempfunf.."\n*"..tempsech.."\n*"..tempsieb.."\n*"..tempacht
elseif(lengthi==9) then
if (string.sub(stext[1],1,1)~="/") then
tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
else
tempeins = string.sub(tempeins,2)
end
if (string.sub(stext[2],1,1)~="/") then
tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
else
tempzwei = string.sub(tempzwei,2)
end
if (string.sub(stext[3],1,1)~="/") then
tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
else
tempdrei = string.sub(tempdrei,2)
end
if (string.sub(stext[4],1,1)~="/") then
tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
else
tempvier = string.sub(tempvier,2)
end
if (string.sub(stext[5],1,1)~="/") then
tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
else
tempfunf = string.sub(tempfunf,2)
end
if (string.sub(stext[6],1,1)~="/") then
tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
else
tempsech = string.sub(tempsech,2)
end
if (string.sub(stext[7],1,1)~="/") then
tempsieb = "[[#"..tempsieb.."|"..tempsieb.."]]"
else
tempsieb = string.sub(tempsieb,2)
end
if (string.sub(stext[8],1,1)~="/") then
tempacht = "[[#"..tempacht.."|"..tempacht.."]]"
else
tempacht = string.sub(tempacht,2)
end
if (string.sub(stext[9],1,1)~="/") then
tempneun = "[[#"..tempneun.."|"..tempneun.."]]"
else
tempneun = string.sub(tempneun,2)
end
finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei.."\n*"..tempvier.."\n*"..tempfunf.."\n*"..tempsech.."\n*"..tempsieb.."\n*"..tempacht.."\n*"..tempneun
else
finalthing = "Die Anzahl an ausgewählten Optionen wird nicht unterstützt. Erkundige dich, dass du alles richtig geschrieben hast. Falls dir das Maximum von 9 Optionen nicht reicht wende dich bitte an [[Benutzerin:Murmelgrumpf]]"
end
return finalthing
end
function p.kampf( frame )
    stext = split (frame.args[1], "§§§")
lengthi = tablelength(stext)
curthing = ""
eendrest = ""
for nudmbr,crdrent in ipairs(stext) do
curthing = split (stext[nudmbr], ">")
eendrest = eendrest.."|"..curthing[1].."\n|"..curthing[2].."\n|"..curthing[3].."\n|-\n"
end
return eendrest
end
 
function p.dia( frame )
    stext = split (frame.args[1], "§§§")
lengthi = tablelength(stext)
curthing = ""
eendrest = ""
for nudmbr,crdrent in ipairs(stext) do
curthing = split (stext[nudmbr], ":")
eendrest = eendrest.."\n'''"..curthing[1]..":'''\n\n„"..curthing[2].."“\n"
end
eendrest = string.gsub(eendrest, "(\n[\n%s]*)", "''%1''")
return eendrest
end
function p.image( frame )
imaage = "[[Datei:"..frame.args[1]
if (frame.args[2]~=nil) then
imaage = imaage.."|"..frame.args[2]
end
if (frame.args[3]~=nil) then
imaage = imaage.."|"..frame.args[3]
end
if (frame.args[4]~=nil) then
imaage = imaage.."|"..frame.args[4]
end
if (frame.args[5]~=nil) then
imaage = imaage.."|"..frame.args[5]
end
if (frame.args[6]~=nil) then
imaage = imaage.."|"..frame.args[6]
end
imaage = imaage.."]]"
return imaage
end
 
 
function p.vid( frame )
stext = split (frame.args[2], "§§§")
seend = "Hier kannst du das Abenteuer von ["..frame.args[1].."] noch ein mal nachschauen! Viel Spaß! :)\n"..'{|class="wikitable"\n|-\n'
    for nuudmbr,curdrent in ipairs(stext) do
seend = seend.."!Teil "..tostring(nuudmbr).."\n"
end
seend = seend.."|-\n"
    for nuudmbr,curdrent in ipairs(stext) do
seend = seend.."|"..curdrent.."\n"
end
seend = seend.."|-\n|}\n"
return seend
end


function p.talents( frame )
function p.kampflist ( frame )
handeln = split (frame.args[1], "\n")
seendthingi = '{|style="display: inline-block;"\n|'..string.gsub(frame.args[1], "§§§",'\n|}\n{|style="display: inline-block;"\n|')..'\n|}'
wissen = split (frame.args[2], "\n")
return seendthingi
soziales = split (frame.args[3], "\n")
end  
    lenlist = {}
lenlist[1] = tablelength(handeln)
lenlist[2] = tablelength(wissen)
lenlist[3] = tablelength(soziales)
highesst = gethighest(lenlist)
intex = 1
selast = ""
while (intex<=highesst) do
selast = selast.."|"
if (handeln[intex]~=nil) then
selast = selast..handeln[intex]
end
selast = selast.."\n|"
if (wissen[intex]~=nil) then
selast = selast..wissen[intex]
end
selast = selast.."\n|"
if (soziales[intex]~=nil) then
selast = selast..soziales[intex]
end
selast = selast.."\n|-\n"
intex = intex+1
end
return selast
end


function p.description( frame )
function p.howhlp ( frame )
    stext = split (frame.args[1], "§§§")
if (frame.args[1]=="") then
eerndrest=""
return "'''None'''"
if(tabContains(stext,"Szene")) then  
else
eerndrest = eerndrest.."'''Szenen:'''\nSzenen geben Handlung und Orte vor, die die Spieler meist passiv miterleben.\n\n"
--return frame.args[1]
end
return "*[[Spielwiese:HowHlp/"..string.sub(frame.args[1],7):gsub("§§§","]]\n*[[Spielwiese:HowHlp/").."]]"
if(tabContains(stext,"Inter")) then
eerndrest = eerndrest.."'''<span style='color:#BB0011;'>Interaktionen:</span>'''\nInteraktionen sind aktive Szenen, die eine Interaktion mit den Spielern erfordern.\n\n"
end
if(tabContains(stext,"Kursiv")) then
eerndrest = eerndrest.."''Kursive Texte:''\nKursive Texte können wörtlich vorgetragen werden und beinhalten meist direkte Rede oder Beschreibungen.\n\n"
end
if(tabContains(stext,"Probe")) then
eerndrest = eerndrest.."'''<span style='color:#31B404;'>Proben:</span>'''\nSteht für mögliche Talentwürfe, welche die Spieler ablegen müssen.\n\n"
end
if(tabContains(stext,"Moral")) then
eerndrest = eerndrest.."'''<span style='color:#00b8ff;'>Moral:</span>'''\nBeinhaltet Situationen, an denen die Spieler moralische Fragen beantworten müssen, die sich auf den Verlauf des Abenteuers auswirken können.\n\n"
end
end
if(tabContains(stext,"Module")) then
eerndrest = eerndrest.."'''<span style='color:#4B088A;'>Module:</span>'''\nBeinhalten Regeln, die zusätzlich zum Grundregelwerk in diesem Abenteuer verwendet werden.\n\n"
end
if(tabContains(stext,"Box")) then
eerndrest = eerndrest.."<div class='box'>'''Boxen:''' Boxen stehen für Spielleiterhinweise und beinhalten meist Hintergrundinformationen, welche die Spieler nicht haben können.</div>\n\n"
end
return string.sub(eerndrest,0,string.len(eerndrest)-2)
end
end


function p.ygggegerror ( frame )
function p.testi ( frame )
displayedtext = "\n\n----\n\n"
return getdes()["Kampfutensilien"]
listeeins, listezwei = gegapi()
headerends = {}
end
schlagworte = schlagwortliste()
 
for eines,zweites in pairs(listeeins) do
function p.abenteuersort( frame )
table.insert(headerends,listeeins[eines]["Name"])
output = ""
for qfsdf,zweihgfhgtes in pairs(listeeins[eines]["Schlagwörter"]) do
categories = mw.ext.dpl.getFullpagenames({["category"] "AbenteuerBack" })
if (tabContains(schlagworte,zweihgfhgtes)==nil) then
for i,v in ipairs(categories) do
displayedtext = displayedtext..'<span style="color:red;"><big><big><big> Falsches Schlagwort gefunden: "'..zweihgfhgtes..'"'..", unter: '''("..listeeins[eines]["Category"].." - "..listeeins[eines]["Subcategory"].." - "..listeeins[eines]["Name"]..")'''!Bitte Ändern!</big></big></big>"..'</span>\n\n----\n\n'
      output = output..v.."<br \>"
end
    end
end
return output
end
dupeeeetab = duptable(headerends)
for zup,dupeeee in pairs(dupeeeetab) do
if (dupeeee~=nil) then
displayedtext = displayedtext..'<span style="color:red;"><big><big><big>Duplikat gefunden: "'..listeeins[dupeeee[1]]["Name"]..'"'..", unter: '''("..listeeins[dupeeee[1]]["Category"]..' - '..listeeins[dupeeee[1]]["Subcategory"]..")''' und unter: '''("..listeeins[dupeeee[2]]["Category"]..' - '..listeeins[dupeeee[2]]["Subcategory"]..")''' !Bitte Ändern!</big></big></big>"..'</span>\n\n----\n\n'
end
end
return displayedtext
 
end
 
function p.testzwei ( frame )
 
return frame.args["test"]
end
end


function p.cur ( frame )
thingtext = frame.args[1]
thingtext = string.gsub(thingtext, "(\n+)", "''%1''")
return thingtext
end
function p.probe ( frame )
return "'''<span style='color:#31B404;'>"..string.gsub(frame.args[1], "(\n+)" , "</span>'''%1'''<span style='color:#31B404;'>").."</span>'''"
end


function p.prodbe ( frame )
return "'''<span style='color:#31B404;'>"..string.gsub(frame.args[1], "(\n+)" , "</span>'''%1'''<span style='color:#31B404;'>").."</span>'''"
end


function p.prodbe ( frame )
return "'''<span style='color:#31B404;'>"..string.gsub(frame.args[1], "(\n+)" , "</span>'''%1'''<span style='color:#31B404;'>").."</span>'''"
end
function p.prohbe ( frame )
return "'''<span style='color:#31B404;'>"..string.gsub(frame.args[1], "(\n+)" , "</span>'''%1'''<span style='color:#31B404;'>").."</span>'''"
end
function p.proabe ( frame )
return "'''<span style='color:#31B404;'>"..string.gsub(frame.args[1], "(\n+)" , "</span>'''%1'''<span style='color:#31B404;'>").."</span>'''"
end
function p.probhe ( frame )
return "'''<span style='color:#31B404;'>"..string.gsub(frame.args[1], "(\n+)" , "</span>'''%1'''<span style='color:#31B404;'>").."</span>'''"
end


function p.cufghr ( frame )
thingtext = frame.args[1]
thingtext = string.gsub(thingtext, "(\n+)", "''%1''")
return thingtext
end
function p.chur ( frame )
thingtext = frame.args[1]
thingtext = string.gsub(thingtext, "(\n+)", "''%1''")
return thingtext
end
function p.cugr ( frame )
thingtext = frame.args[1]
thingtext = string.gsub(thingtext, "(\n+)", "''%1''")
return thingtext
end
function p.cusgr ( frame )
thingtext = frame.args[1]
thingtext = string.gsub(thingtext, "(\n+)", "''%1''")
return thingtext
end
return p
return p
--§§§

Aktuelle Version vom 12. Oktober 2021, 20:40 Uhr

Die Dokumentation für dieses Modul kann unter Modul:X/Doku erstellt werden

local p = {} --local p = {} -- p steht für Paket (engl. package)

require( "Module:Xfunc" )
function p.cutblock ( frame )
	text = frame.args[3]-- "Die Schmiede"
	width = tonumber(frame.args[2]) -- 4
	height = tonumber(frame.args[1]) -- 12
	block = ""
	textlen = string.len(text) -- 12
	tempsplit = {}
	
	
	while (height>0 and textlen>=width) do -- 12>0 and 12>=4|11>0 and 11>=4
		tempsplit = split(cut(width, text), "%%%@%%") -- ("Die", "Schmiede")| (
		block = block..tempsplit[1].." " -- "Die "
		text = tempsplit[2] -- "Schmiede"
		height = height-1 -- 11
		if (text==nil) then
			text = ""
		end
		textlen = string.len(text) -- 8
	end
	if (height>0) then
		block = block.." "..text
		text = ""
	end
	
	result = block.."%@%"..text
	result = string.gsub(result, "%§", " ")
	return result


end

function p.cut( frame )
	testtext = ""
	realtext = frame.args[2] --Die Schmiede
	realtext = removespaceinlink(realtext) --Die Schmiede
	srealtext = split(realtext, " ") --Die|Schmiede(list)
	i = 2; --2
	testtext = testtext.."<br \>"..i..": "
	limit = tonumber(frame.args[1]) --4
	text = display(removespaceinlink(realtext)) --Die Schmiede
	stext = split(text, " ") --Die|Schmiede(list)
	
	if(table.getn(stext)==1) then
		if(string.len(stext[1])>limit) then
			return "%@%"..text
		else
			return text.."%@%"
		end
	end
	
	cuttext = stext[1] --Die
	realcuttext = srealtext[1] --Die
	
	nextwo = stext[2] --Schmiede
	realnextwo = srealtext[2] --Schmiede
	
	nextlen = string.len(nextwo)--8
	textlen = string.len(text)--12
	cuttextlen = string.len(cuttext)--3
	
	set = true;
	testtext = testtext.."<br \>"..i..": "..realcuttext
	
	if(limit>=textlen)then --4>=12
		return realtext.."%@%"
	
	elseif(cuttextlen>limit) then--3>4
		return "%@%"..realtext
	
	
	

	else
		while (cuttextlen+nextlen+1<=textlen+2) do --8+3+1<=12+2(12<=14)|14+3+1<=12+2(18<=14)
			
			if(cuttextlen+nextlen+1>limit and set) then --8+3+1>4(12>4)|
				set = false
				cuttext = cuttext.."%@%" --"Die %@%"
				realcuttext = realcuttext.."%@%" --"Die %@%"
				
			else
				cuttext = cuttext.." " --
				realcuttext = realcuttext.." " --
				
			end
			-- testtext = testtext..tostring(i)..": "..realcuttext.."<br />"
			i = i + 1 --3
			
			cuttext = cuttext..nextwo -- "Die%@%Schmiede"
			realcuttext = realcuttext..realnextwo -- "Die%@%Schmiede"
			
			nextwo = stext[i]-- nil
			realnextwo = srealtext[i]-- nil
			
			if (nextwo ~= nil) then
				nextlen = string.len(nextwo) -- 5
			end
			cuttextlen = string.len(cuttext) -- 14
			testtext = testtext.."<br \>"..i..": "..realcuttext
			
		end
		realnextwo = srealtext[i]
		if (realnextwo ~= nil) then
			realcuttext = realcuttext.." "..realnextwo
		end
	end
	testtext = testtext.."<br \>"..(i+1)..": "..realcuttext
	return realcuttext
end

function p.display ( frame )
	text = frame.args[1]
	text = text:gsub("'", "")
	lend = string.len(text)
	i=1
	auf = {}
	zu = {}
	currentauf = string.find(text, "%[%[")
	while (currentauf ~= nil) do
		auf[i] = currentauf;
		if (string.find(string.sub(text,currentauf+2), "%[%[")~=nil)then
			currentauf = currentauf+1+string.find(string.sub(text,currentauf+2), "%[%[")
		else
			currentauf = nil
		end
		
		i=i+1
	end
	
	i=1
	currentzu = string.find(text, "%|")
	while (currentzu ~= nil) do
		zu[i] = currentzu;
		if (string.find(string.sub(text,currentzu+2), "%|")~=nil)then
			currentzu = currentzu+1+string.find(string.sub(text,currentzu+2), "%|")
		else
			currentzu = nil
		end
		i=i+1
	end
	
	offset = 0
	
	if(table.getn(auf) == table.getn(zu))then
		
		 i=1
		 while (table.getn(auf)>=i) do
			anfang = auf[i]
			ende = zu[i]
			tt, uu = string.find(string.sub(text, 1, anfang-offset+1), "%[%[(.+)%|")
			text = string.gsub(string.sub(text, 1, anfang-offset+1), "%[%[(.+)%|", "")..string.sub(text,anfang-offset+2,string.len(text))
			-- text = string.sub(text,1,anfang-offset+1)..string.sub(text,ende+1-offset,string.len(text))
			if (tt ~= nil) and (uu ~= nil) then
				offset = offset+uu-tt
			end
			i=i+1
		 end
		 text = string.gsub(text, "%[%[(.+)%|", "")
	end
	
	-- text = text:gsub("%[", "")
	-- text = text:gsub("%|", "")
	text = text:gsub("%]", "")


	return text
end



function p.split ( frame )
	spl = split(frame.args[1],frame.args[2])
	i=1
	t=""
	while(i<=tablelength(spl)) do
		t = t..spl[i].."\n\n"
		i=i+1
	end

    return t	
end

function p.removespaceinlink(frame)
	text = frame.args[1]
	i=1
	auf = {}
	zu = {}
	currentauf = string.find(text, "%[%[")
	while (currentauf ~= nil) do
		auf[i] = currentauf;
		if (string.find(string.sub(text,currentauf+2), "%[%[")~=nil)then
			currentauf = currentauf+1+string.find(string.sub(text,currentauf+2), "%[%[")
		else
			currentauf = nil
		end
		
		i=i+1
	end
	
	i=1
	currentzu = string.find(text, "%]%]")
	while (currentzu ~= nil) do
		zu[i] = currentzu;
		if (string.find(string.sub(text,currentzu+2), "%]%]")~=nil)then
			currentzu = currentzu+1+string.find(string.sub(text,currentzu+2), "%]%]")
		else
			currentzu = nil
		end
		i=i+1
	end
	if(table.getn(auf) == table.getn(zu))then
		i=1
		while (table.getn(auf)>=i) do
			anfang = auf[i]
			ende = zu[i]
			text = string.sub(text,1,anfang-1)..string.gsub(string.sub(text,anfang,ende)," ","§")..string.sub(text,ende+1,string.len(text))

			i=i+1
		end
	end
	
	return text
end






function p.size ( frame )
	text = frame.args[1]
	return textSize(text)
end





function p.size ( frame )
	text = frame.args[1]
	return textSize(text)
end

function p.findg( frame )
	text = frame.args[1]
	d,s,r = string.find(text, "g")
	return d,s,r

end

function p.indexold
( frame )
	text = frame.args[1]
	stext = split (text, "§§§")
	currentpage = ""
	currentheaders= nil
	finish = ""
	i = 1
	inde = 1
	while (i<=tablelength(stext)) do
		currentpage = stext[i]
		currentheaders = getheaderlimit(currentpage, "Yggdrasil")
		currentpage = string.sub(currentpage, 1, string.len(currentpage)-2)
		headlen = tablelength(currentheaders)
		inde = 1
		while (inde<=headlen) do
			finish = finish.."|[[Yggdrasil:"..currentpage.."#"..currentheaders[inde].."|"..currentheaders[inde].."]]\n|[[Yggdrasil:"..currentpage.."|"..currentpage.."]]\n|-\n"
			
			inde=inde+1
		end
		
		i=i+1
	end
	
	--text = frame.args[1]
	--stext = split (text, "\n")
	--ending = ""
	
	--for i = 1,tablelength(stext),1 do 
	--	currentsplit = split (stext[i], "%>")
	--	leng = tablelength(currentsplit)
	--	ending = ending.."|[[Yggdrasil:"..currentsplit[2].."#"..currentsplit[1].."|"..currentsplit[1].."]]\n|[[Yggdrasil:"..currentsplit[2].."|"..currentsplit[2].."]]\n|-\n"
	--end
	
	return finish
end


function p.yggrassen( frame )
	text = frame.args[1]
	stext = split (text, "\n")
	haupttext = split (text, "'''Nebenrassen'''")[1]
	nebentext = split (text, "'''Nebenrassen'''")[2]
	shaupttext = split (haupttext, "\n")
	snebentext = split (nebentext, "\n")
	ending = "!<big>Hauptrassen</big>\n|-\n"
	
	for i = 2,tablelength(stext),1 do 
		if (stext[i]=="'''Nebenrassen'''") then
			ending = ending.."!<big>Nebenrassen</big>\n|-\n"
		else
			ending = ending.."|<big>'''[[#"..stext[i].."|"..stext[i].."]]'''</big>\n|-\n"
		end
	end
	
	
	

	return ending

end



function p.yggtab( frame )
	text = frame.args[1]
	img = frame.args[2]
	stext = split (text, "§§§")
	exist = true
	imgtext = ''
	if (img~=nil and img~='' and img~='{{{img}}}') then
		imgtext='<div id="yggimg">[[Datei:'..img..']]</div>\n'
		
	end
	i=1
	rettext='{|class="wikitable" style="width: 32%; float:right; margin-top: 0; margin-bottom: 0px;"\n|-\n'
	while (stext[i+1]~=nil) do
		rettext=rettext..'!style="width:32%; padding: 10px;" |'..string.sub(stext[i],2,string.len(stext[i]))..'\n'
		i=i+1
		if (stext[i+1]~=nil and stext[i]~='-') then
			rettext=rettext..'|style="width:68%; padding: 10px;" |'
		end
		
		while (stext[i+1]~=nil and stext[i]~='-') do
			if(string.sub(stext[i],1,1)=='/') then
				rettext=rettext..string.sub(stext[i],2)
			elseif(string.find(stext[i],'#')~=nil) then
				found=string.find(stext[i],'#')
				rettext=rettext..'[[Yggdrasil:'..string.sub(stext[i],1,found-1)..'#'..string.sub(stext[i],found+1,string.len(stext[i]))..'|'..string.sub(stext[i],found+1,string.len(stext[i]))..']]'
				
			else
				rettext=rettext..'[[#'..stext[i]..'|'..stext[i]..']]'
			end
			rettext=rettext..'\n\n'
			i=i+1
		end

		rettext=rettext..'|-\n'
		i=i+1
		
	end
	rettext=rettext..'|}'..stext[i-1]..'\n|style="width:20%; padding: 0; vertical-align:top;"|'..imgtext
	return '{|style="width:100%;"\n|style="width:80%; padding: 0; vertical-align:top;"|\n'..rettext..'\n|}'
end

function p.getpage( frame )
	title = mw.title.new( frame.args[1], frame.args[2] )
	content = title:getContent()
	return content
end

function p.getheader( frame )
	title = mw.title.new( frame.args[1], frame.args[2] )
	content = title:getContent()
	--content = string.gsub(content, "([$$$]+)", "DIESER CHARACTER WIRD NICHT UNTERSTÜTZT")
	content = string.gsub(content, "%=%=+", "§§§")
	content = split("hallo"..content, "§§§")
	i = 2
	length = tablelength(content)
	finaltext=""
	while (i<=length) do
		if (string.match(content[i], "[^[(%s)(%d)(%a)]]")==nil) then
			finaltext = finaltext..content[i].."\n\n"
		end
		i = i + 2
	end
	return finaltext
end



function p.index( frame )
	--content = displaytablevert(getindexformat())
	text = frame.args[1]
	stext = split (text, "§§§")
	currentpage = ""
	currentheaders= nil
	finish = ""
	tempfinish =""
	i = 1
	inde = 1
	while (i<=tablelength(stext)) do
		currentpage = stext[i]
		currentheaders = headertotablelimit(currentpage, "Yggdrasil")
		currentpage = string.sub(currentpage, 1, string.len(currentpage)-2)
		headlen = tablelength(currentheaders)
		inde = 1
		while (inde<=headlen) do
			if (tablelength(currentheaders[inde])==1) then
				tempfinish = getindexformat()[1]
				tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1])
				
				tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]")
				
			elseif(tablelength(currentheaders[inde])==2) then
				tempfinish = getindexformat()[2]
				tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1])
				tempfinish = string.gsub(tempfinish, "{{{h2}}}", currentheaders[inde][2])
				
				tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]")
				tempfinish = string.gsub(tempfinish, "{{{h2 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][2].."|"..currentheaders[inde][2].."]]")
				
			elseif(tablelength(currentheaders[inde])==3) then
				tempfinish = getindexformat()[3]
				tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1])
				tempfinish = string.gsub(tempfinish, "{{{h2}}}", currentheaders[inde][2])
				tempfinish = string.gsub(tempfinish, "{{{h3}}}", currentheaders[inde][3])
				
				tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]")
				tempfinish = string.gsub(tempfinish, "{{{h2 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][2].."|"..currentheaders[inde][2].."]]")
				tempfinish = string.gsub(tempfinish, "{{{h3 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][3].."|"..currentheaders[inde][3].."]]")
				
			elseif(tablelength(currentheaders[inde])==4) then
				tempfinish = getindexformat()[4]
				tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1])
				tempfinish = string.gsub(tempfinish, "{{{h2}}}", currentheaders[inde][2])
				tempfinish = string.gsub(tempfinish, "{{{h3}}}", currentheaders[inde][3])
				tempfinish = string.gsub(tempfinish, "{{{h4}}}", currentheaders[inde][4])
				
				tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]")
				tempfinish = string.gsub(tempfinish, "{{{h2 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][2].."|"..currentheaders[inde][2].."]]")
				tempfinish = string.gsub(tempfinish, "{{{h3 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][3].."|"..currentheaders[inde][3].."]]")
				tempfinish = string.gsub(tempfinish, "{{{h4 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][4].."|"..currentheaders[inde][4].."]]")
				
			elseif(tablelength(currentheaders[inde])==5) then
				tempfinish = getindexformat()[5]
				tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1])
				tempfinish = string.gsub(tempfinish, "{{{h2}}}", currentheaders[inde][2])
				tempfinish = string.gsub(tempfinish, "{{{h3}}}", currentheaders[inde][3])
				tempfinish = string.gsub(tempfinish, "{{{h4}}}", currentheaders[inde][4])
				tempfinish = string.gsub(tempfinish, "{{{h5}}}", currentheaders[inde][5])
				
				tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]")
				tempfinish = string.gsub(tempfinish, "{{{h2 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][2].."|"..currentheaders[inde][2].."]]")
				tempfinish = string.gsub(tempfinish, "{{{h3 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][3].."|"..currentheaders[inde][3].."]]")
				tempfinish = string.gsub(tempfinish, "{{{h4 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][4].."|"..currentheaders[inde][4].."]]")
				tempfinish = string.gsub(tempfinish, "{{{h5 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][5].."|"..currentheaders[inde][5].."]]")
				
			elseif(tablelength(currentheaders[inde])==6) then
				tempfinish = getindexformat()[6]
				tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1])
				tempfinish = string.gsub(tempfinish, "{{{h2}}}", currentheaders[inde][2])
				tempfinish = string.gsub(tempfinish, "{{{h3}}}", currentheaders[inde][3])
				tempfinish = string.gsub(tempfinish, "{{{h4}}}", currentheaders[inde][4])
				tempfinish = string.gsub(tempfinish, "{{{h5}}}", currentheaders[inde][5])
				tempfinish = string.gsub(tempfinish, "{{{h6}}}", currentheaders[inde][6])
				
				tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]")
				tempfinish = string.gsub(tempfinish, "{{{h2 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][2].."|"..currentheaders[inde][2].."]]")
				tempfinish = string.gsub(tempfinish, "{{{h3 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][3].."|"..currentheaders[inde][3].."]]")
				tempfinish = string.gsub(tempfinish, "{{{h4 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][4].."|"..currentheaders[inde][4].."]]")
				tempfinish = string.gsub(tempfinish, "{{{h5 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][5].."|"..currentheaders[inde][5].."]]")
				tempfinish = string.gsub(tempfinish, "{{{h6 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][6].."|"..currentheaders[inde][6].."]]")
				
				
				
			end
			if(tablelength(currentheaders[inde])~=0) then
				if (currentpage=="Religion") then
					currentpagedis = "Religion/Äscher"
				elseif(currentpage=="Religion2") then
					currentpagedis = "Religion/Lacerta"
				elseif(currentpage=="Religion2") then
					currentpagedis = "Religion/Lichtalben"
				elseif(currentpage=="Religion2") then
					currentpagedis = "Religion/Dunkelalben"
				elseif(currentpage=="Religion2") then
					currentpagedis = "Religion/Dweorgo"
				elseif(currentpage=="Religion2") then
					currentpagedis = "Religion/Andere"
				else
					currentpagedis = currentpage
				end
			
				tempfinish = "|"..string.gsub(string.gsub(tempfinish, "{{{page}}}", currentpagedis),"\n", "",1)
				tempfinish = string.gsub(tempfinish, "{{{page link}}}", "[[Yggdrasil:"..currentpage.."|"..currentpagedis.."]]")
				finish = finish..tempfinish.."\n|-\n"
			end
			inde=inde+1
		end
		
		i=i+1
	end
	
	return finish

--<h2>

end

function p.religion( frame )
	ull = ""
	if (frame.args[1]=="1") then
		ull = '{{YggRegister|!Religion:Äscher|Religion2:Lacerta|Religion3:Lichtalben|Religion4:Dubkelalben|Religion5:Dweorgo|Religion6:Andere}}'
	elseif (frame.args[1]=="2") then
		ull = '{{YggRegister|Religion:Äscher|!Religion2:Lacerta|Religion3:Lichtalben|Religion4:Dubkelalben|Religion5:Dweorgo|Religion6:Andere}}'
	elseif (frame.args[1]=="3") then
		ull = '{{YggRegister|Religion:Äscher|Religion2:Lacerta|!Religion3:Lichtalben|Religion4:Dubkelalben|Religion5:Dweorgo|Religion6:Andere}}'
	elseif (frame.args[1]=="4") then
		ull = '{{YggRegister|Religion:Äscher|Religion2:Lacerta|Religion3:Lichtalben|!Religion4:Dubkelalben|Religion5:Dweorgo|Religion6:Andere}}'
	elseif (frame.args[1]=="5") then
		ull = '{{YggRegister|Religion:Äscher|Religion2:Lacerta|Religion3:Lichtalben|Religion4:Dubkelalben|!Religion5:Dweorgo|Religion6:Andere}}'
	elseif (frame.args[1]=="6") then
		ull = '{{YggRegister|Religion:Äscher|Religion2:Lacerta|Religion3:Lichtalben|Religion4:Dubkelalben|Religion5:Dweorgo|!Religion6:Andere}}'
	end
	return ull
end


function p.test( frame )
	dieter, dieter2 = gegapi()
	dieter2 = dieter2["Kampfutensilien"]["Nahkampfwaffen"][1]
	leresti = "Dinge:\n"
    for zahl,dingsi in  pairs(dieter2) do
        leresti = leresti.."*"..zahl..":"
		if (dingsi[1]~=nil) then
			for zahfgsal,didfsdhngsi in  pairs(dingsi) do
				leresti = leresti.." - "..didfsdhngsi
			end
		else
			leresti = leresti.." "..dingsi
		end
		leresti = leresti.."\n"
	end
	
	
	return leresti
	

end

function p.options( frame )
	stext = split (frame.args[1], "§§§")
	lengthi = tablelength(stext)
	finalthing = ""
	tempeins = stext[1]
	tempzwei = stext[2]
	tempdrei = stext[3]
	tempvier = stext[4]
	tempfunf = stext[5]
	tempsech = stext[6]
	tempsieb = stext[7]
	tempacht = stext[8]
	tempneun = stext[9]
	if (lengthi==2) then
		if (string.sub(stext[1],1,1)~="/") then
			tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
		else
			tempeins = string.sub(tempeins,2)
		end
		if (string.sub(stext[2],1,1)~="/") then
			tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
		else
			tempzwei = string.sub(tempzwei,2)
		end
		finalthing = "*"..tempeins.." (bei 1-50)\n*"..tempzwei.." (bei 51-100)"
	elseif(lengthi==3) then
		if (string.sub(stext[1],1,1)~="/") then
			tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
		else
			tempeins = string.sub(tempeins,2)
		end
		if (string.sub(stext[2],1,1)~="/") then
			tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
		else
			tempzwei = string.sub(tempzwei,2)
		end
		if (string.sub(stext[3],1,1)~="/") then
			tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
		else
			tempdrei = string.sub(tempdrei,2)
		end
		finalthing = "*"..tempeins.." (Bei 1-33)\n*"..tempzwei.." (Bei 34-66)\n*"..tempdrei.." (Bei 67-99)\n*Bei 100: Reroll"
	elseif(lengthi==4) then
		if (string.sub(stext[1],1,1)~="/") then
			tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
		else
			tempeins = string.sub(tempeins,2)
		end
		if (string.sub(stext[2],1,1)~="/") then
			tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
		else
			tempzwei = string.sub(tempzwei,2)
		end
		if (string.sub(stext[3],1,1)~="/") then
			tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
		else
			tempdrei = string.sub(tempdrei,2)
		end
		if (string.sub(stext[4],1,1)~="/") then
			tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
		else
			tempvier = string.sub(tempvier,2)
		end
		finalthing = "*"..tempeins.." (Bei 1-25)\n*"..tempzwei.." (Bei 26-50)\n*"..tempdrei.." (Bei 51-75)\n*"..tempvier.." (Bei 76-100)"
	elseif(lengthi==5) then
		if (string.sub(stext[1],1,1)~="/") then
			tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
		else
			tempeins = string.sub(tempeins,2)
		end
		if (string.sub(stext[2],1,1)~="/") then
			tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
		else
			tempzwei = string.sub(tempzwei,2)
		end
		if (string.sub(stext[3],1,1)~="/") then
			tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
		else
			tempdrei = string.sub(tempdrei,2)
		end
		if (string.sub(stext[4],1,1)~="/") then
			tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
		else
			tempvier = string.sub(tempvier,2)
		end
		if (string.sub(stext[5],1,1)~="/") then
			tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
		else
			tempfunf = string.sub(tempfunf,2)
		end
		finalthing = "*"..tempeins.." (Bei 1-20)\n*"..tempzwei.." (Bei 21-40)\n*"..tempdrei.." (Bei 41-60)\n*"..tempvier.." (Bei 61-80)\n*"..tempfunf.." (Bei 81-100)"
	elseif(lengthi==6) then
		if (string.sub(stext[1],1,1)~="/") then
			tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
		else
			tempeins = string.sub(tempeins,2)
		end
		if (string.sub(stext[2],1,1)~="/") then
			tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
		else
			tempzwei = string.sub(tempzwei,2)
		end
		if (string.sub(stext[3],1,1)~="/") then
			tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
		else
			tempdrei = string.sub(tempdrei,2)
		end
		if (string.sub(stext[4],1,1)~="/") then
			tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
		else
			tempvier = string.sub(tempvier,2)
		end
		if (string.sub(stext[5],1,1)~="/") then
			tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
		else
			tempfunf = string.sub(tempfunf,2)
		end
		if (string.sub(stext[6],1,1)~="/") then
			tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
		else
			tempsech = string.sub(tempsech,2)
		end
		finalthing = "*"..tempeins.." (Bei 1-16)\n*"..tempzwei.." (Bei 17-32)\n*"..tempdrei.." (Bei 33-48)\n*"..tempvier.." (Bei 49-64)\n*"..tempfunf.." (Bei 65-80)\n*"..tempsech.." (Bei 81-96)\n*Bei 97-100: Reroll"
	elseif(lengthi==7) then
		if (string.sub(stext[1],1,1)~="/") then
			tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
		else
			tempeins = string.sub(tempeins,2)
		end
		if (string.sub(stext[2],1,1)~="/") then
			tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
		else
			tempzwei = string.sub(tempzwei,2)
		end
		if (string.sub(stext[3],1,1)~="/") then
			tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
		else
			tempdrei = string.sub(tempdrei,2)
		end
		if (string.sub(stext[4],1,1)~="/") then
			tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
		else
			tempvier = string.sub(tempvier,2)
		end
		if (string.sub(stext[5],1,1)~="/") then
			tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
		else
			tempfunf = string.sub(tempfunf,2)
		end
		if (string.sub(stext[6],1,1)~="/") then
			tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
		else
			tempsech = string.sub(tempsech,2)
		end
		if (string.sub(stext[7],1,1)~="/") then
			tempsieb = "[[#"..tempsieb.."|"..tempsieb.."]]"
		else
			tempsieb = string.sub(tempsieb,2)
		end
		finalthing = "*"..tempeins.." (Bei 1-14)\n*"..tempzwei.." (Bei 15-28)\n*"..tempdrei.." (Bei 29-42)\n*"..tempvier.." (Bei 43-56)\n*"..tempfunf.." (Bei 57-70)\n*"..tempsech.." (Bei 71-84)\n*"..tempsieb.." (Bei 85-98)\n*Bei 99-100: Reroll"
	elseif(lengthi==8) then
		if (string.sub(stext[1],1,1)~="/") then
			tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
		else
			tempeins = string.sub(tempeins,2)
		end
		if (string.sub(stext[2],1,1)~="/") then
			tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
		else
			tempzwei = string.sub(tempzwei,2)
		end
		if (string.sub(stext[3],1,1)~="/") then
			tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
		else
			tempdrei = string.sub(tempdrei,2)
		end
		if (string.sub(stext[4],1,1)~="/") then
			tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
		else
			tempvier = string.sub(tempvier,2)
		end
		if (string.sub(stext[5],1,1)~="/") then
			tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
		else
			tempfunf = string.sub(tempfunf,2)
		end
		if (string.sub(stext[6],1,1)~="/") then
			tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
		else
			tempsech = string.sub(tempsech,2)
		end
		if (string.sub(stext[7],1,1)~="/") then
			tempsieb = "[[#"..tempsieb.."|"..tempsieb.."]]"
		else
			tempsieb = string.sub(tempsieb,2)
		end
		if (string.sub(stext[8],1,1)~="/") then
			tempacht = "[[#"..tempacht.."|"..tempacht.."]]"
		else
			tempacht = string.sub(tempacht,2)
		end
		finalthing = "*"..tempeins.." (Bei 1-12)\n*"..tempzwei.." (Bei 13-24)\n*"..tempdrei.." (Bei 25-36)\n*"..tempvier.." (Bei 37-48)\n*"..tempfunf.." (Bei 49-60)\n*"..tempsech.." (Bei 61-72)\n*"..tempsieb.." (Bei 73-84)\n*"..tempacht.." (Bei 85-96)\n*Bei 97-100: Reroll"
	elseif(lengthi==9) then
		if (string.sub(stext[1],1,1)~="/") then
			tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
		else
			tempeins = string.sub(tempeins,2)
		end
		if (string.sub(stext[2],1,1)~="/") then
			tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
		else
			tempzwei = string.sub(tempzwei,2)
		end
		if (string.sub(stext[3],1,1)~="/") then
			tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
		else
			tempdrei = string.sub(tempdrei,2)
		end
		if (string.sub(stext[4],1,1)~="/") then
			tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
		else
			tempvier = string.sub(tempvier,2)
		end
		if (string.sub(stext[5],1,1)~="/") then
			tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
		else
			tempfunf = string.sub(tempfunf,2)
		end
		if (string.sub(stext[6],1,1)~="/") then
			tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
		else
			tempsech = string.sub(tempsech,2)
		end
		if (string.sub(stext[7],1,1)~="/") then
			tempsieb = "[[#"..tempsieb.."|"..tempsieb.."]]"
		else
			tempsieb = string.sub(tempsieb,2)
		end
		if (string.sub(stext[8],1,1)~="/") then
			tempacht = "[[#"..tempacht.."|"..tempacht.."]]"
		else
			tempacht = string.sub(tempacht,2)
		end
		if (string.sub(stext[9],1,1)~="/") then
			tempneun = "[[#"..tempneun.."|"..tempneun.."]]"
		else
			tempneun = string.sub(tempneun,2)
		end
		finalthing = "*"..tempeins.." (Bei 1-11)\n*"..tempzwei.." (Bei 12-22)\n*"..tempdrei.." (Bei 23-33)\n*"..tempvier.." (Bei 34-44)\n*"..tempfunf.." (Bei 45-55)\n*"..tempsech.." (Bei 56-66)\n*"..tempsieb.." (Bei 67-77)\n*"..tempacht.." (Bei 78-88)\n*"..tempneun.." (Bei 89-99)\n*Bei 100: Reroll"
	else
		finalthing = "Die Anzahl an ausgewählten Optionen wird nicht unterstützt. Erkundige dich, dass du alles richtig geschrieben hast. Falls dir das Maximum von 9 Optionen nicht reicht wende dich bitte an [[Benutzerin:Murmelgrumpf]]"
	end
	return finalthing
	
end
function p.optionsnodice( frame )
	stext = split (frame.args[1], "§§§")
	lengthi = tablelength(stext)
	finalthing = ""
	tempeins = stext[1]
	tempzwei = stext[2]
	tempdrei = stext[3]
	tempvier = stext[4]
	tempfunf = stext[5]
	tempsech = stext[6]
	tempsieb = stext[7]
	tempacht = stext[8]
	tempneun = stext[9]
	if (lengthi==2) then
		if (string.sub(stext[1],1,1)~="/") then
			tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
		else
			tempeins = string.sub(tempeins,2)
		end
		if (string.sub(stext[2],1,1)~="/") then
			tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
		else
			tempzwei = string.sub(tempzwei,2)
		end
		finalthing = "*"..tempeins.."\n*"..tempzwei
	elseif(lengthi==3) then
		if (string.sub(stext[1],1,1)~="/") then
			tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
		else
			tempeins = string.sub(tempeins,2)
		end
		if (string.sub(stext[2],1,1)~="/") then
			tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
		else
			tempzwei = string.sub(tempzwei,2)
		end
		if (string.sub(stext[3],1,1)~="/") then
			tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
		else
			tempdrei = string.sub(tempdrei,2)
		end
		finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei
	elseif(lengthi==4) then
		if (string.sub(stext[1],1,1)~="/") then
			tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
		else
			tempeins = string.sub(tempeins,2)
		end
		if (string.sub(stext[2],1,1)~="/") then
			tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
		else
			tempzwei = string.sub(tempzwei,2)
		end
		if (string.sub(stext[3],1,1)~="/") then
			tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
		else
			tempdrei = string.sub(tempdrei,2)
		end
		if (string.sub(stext[4],1,1)~="/") then
			tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
		else
			tempvier = string.sub(tempvier,2)
		end
		finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei.."\n*"..tempvier
	elseif(lengthi==5) then
		if (string.sub(stext[1],1,1)~="/") then
			tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
		else
			tempeins = string.sub(tempeins,2)
		end
		if (string.sub(stext[2],1,1)~="/") then
			tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
		else
			tempzwei = string.sub(tempzwei,2)
		end
		if (string.sub(stext[3],1,1)~="/") then
			tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
		else
			tempdrei = string.sub(tempdrei,2)
		end
		if (string.sub(stext[4],1,1)~="/") then
			tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
		else
			tempvier = string.sub(tempvier,2)
		end
		if (string.sub(stext[5],1,1)~="/") then
			tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
		else
			tempfunf = string.sub(tempfunf,2)
		end
		finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei.."\n*"..tempvier.."\n*"..tempfunf
	elseif(lengthi==6) then
		if (string.sub(stext[1],1,1)~="/") then
			tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
		else
			tempeins = string.sub(tempeins,2)
		end
		if (string.sub(stext[2],1,1)~="/") then
			tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
		else
			tempzwei = string.sub(tempzwei,2)
		end
		if (string.sub(stext[3],1,1)~="/") then
			tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
		else
			tempdrei = string.sub(tempdrei,2)
		end
		if (string.sub(stext[4],1,1)~="/") then
			tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
		else
			tempvier = string.sub(tempvier,2)
		end
		if (string.sub(stext[5],1,1)~="/") then
			tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
		else
			tempfunf = string.sub(tempfunf,2)
		end
		if (string.sub(stext[6],1,1)~="/") then
			tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
		else
			tempsech = string.sub(tempsech,2)
		end
		finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei.."\n*"..tempvier.."\n*"..tempfunf.."\n*"..tempsech
	elseif(lengthi==7) then
		if (string.sub(stext[1],1,1)~="/") then
			tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
		else
			tempeins = string.sub(tempeins,2)
		end
		if (string.sub(stext[2],1,1)~="/") then
			tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
		else
			tempzwei = string.sub(tempzwei,2)
		end
		if (string.sub(stext[3],1,1)~="/") then
			tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
		else
			tempdrei = string.sub(tempdrei,2)
		end
		if (string.sub(stext[4],1,1)~="/") then
			tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
		else
			tempvier = string.sub(tempvier,2)
		end
		if (string.sub(stext[5],1,1)~="/") then
			tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
		else
			tempfunf = string.sub(tempfunf,2)
		end
		if (string.sub(stext[6],1,1)~="/") then
			tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
		else
			tempsech = string.sub(tempsech,2)
		end
		if (string.sub(stext[7],1,1)~="/") then
			tempsieb = "[[#"..tempsieb.."|"..tempsieb.."]]"
		else
			tempsieb = string.sub(tempsieb,2)
		end
		finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei.."\n*"..tempvier.."\n*"..tempfunf.."\n*"..tempsech.."\n*"..tempsieb
	elseif(lengthi==8) then
		if (string.sub(stext[1],1,1)~="/") then
			tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
		else
			tempeins = string.sub(tempeins,2)
		end
		if (string.sub(stext[2],1,1)~="/") then
			tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
		else
			tempzwei = string.sub(tempzwei,2)
		end
		if (string.sub(stext[3],1,1)~="/") then
			tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
		else
			tempdrei = string.sub(tempdrei,2)
		end
		if (string.sub(stext[4],1,1)~="/") then
			tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
		else
			tempvier = string.sub(tempvier,2)
		end
		if (string.sub(stext[5],1,1)~="/") then
			tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
		else
			tempfunf = string.sub(tempfunf,2)
		end
		if (string.sub(stext[6],1,1)~="/") then
			tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
		else
			tempsech = string.sub(tempsech,2)
		end
		if (string.sub(stext[7],1,1)~="/") then
			tempsieb = "[[#"..tempsieb.."|"..tempsieb.."]]"
		else
			tempsieb = string.sub(tempsieb,2)
		end
		if (string.sub(stext[8],1,1)~="/") then
			tempacht = "[[#"..tempacht.."|"..tempacht.."]]"
		else
			tempacht = string.sub(tempacht,2)
		end
		finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei.."\n*"..tempvier.."\n*"..tempfunf.."\n*"..tempsech.."\n*"..tempsieb.."\n*"..tempacht
	elseif(lengthi==9) then
		if (string.sub(stext[1],1,1)~="/") then
			tempeins = "[[#"..tempeins.."|"..tempeins.."]]"
		else
			tempeins = string.sub(tempeins,2)
		end
		if (string.sub(stext[2],1,1)~="/") then
			tempzwei = "[[#"..tempzwei.."|"..tempzwei.."]]"
		else
			tempzwei = string.sub(tempzwei,2)
		end
		if (string.sub(stext[3],1,1)~="/") then
			tempdrei = "[[#"..tempdrei.."|"..tempdrei.."]]"
		else
			tempdrei = string.sub(tempdrei,2)
		end
		if (string.sub(stext[4],1,1)~="/") then
			tempvier = "[[#"..tempvier.."|"..tempvier.."]]"
		else
			tempvier = string.sub(tempvier,2)
		end
		if (string.sub(stext[5],1,1)~="/") then
			tempfunf = "[[#"..tempfunf.."|"..tempfunf.."]]"
		else
			tempfunf = string.sub(tempfunf,2)
		end
		if (string.sub(stext[6],1,1)~="/") then
			tempsech = "[[#"..tempsech.."|"..tempsech.."]]"
		else
			tempsech = string.sub(tempsech,2)
		end
		if (string.sub(stext[7],1,1)~="/") then
			tempsieb = "[[#"..tempsieb.."|"..tempsieb.."]]"
		else
			tempsieb = string.sub(tempsieb,2)
		end
		if (string.sub(stext[8],1,1)~="/") then
			tempacht = "[[#"..tempacht.."|"..tempacht.."]]"
		else
			tempacht = string.sub(tempacht,2)
		end
		if (string.sub(stext[9],1,1)~="/") then
			tempneun = "[[#"..tempneun.."|"..tempneun.."]]"
		else
			tempneun = string.sub(tempneun,2)
		end
		finalthing = "*"..tempeins.."\n*"..tempzwei.."\n*"..tempdrei.."\n*"..tempvier.."\n*"..tempfunf.."\n*"..tempsech.."\n*"..tempsieb.."\n*"..tempacht.."\n*"..tempneun
	else
		finalthing = "Die Anzahl an ausgewählten Optionen wird nicht unterstützt. Erkundige dich, dass du alles richtig geschrieben hast. Falls dir das Maximum von 9 Optionen nicht reicht wende dich bitte an [[Benutzerin:Murmelgrumpf]]"
	end
	return finalthing
	
end
function p.kampf( frame )
    stext = split (frame.args[1], "§§§")
	lengthi = tablelength(stext)
	curthing = ""
	eendrest = ""
	for nudmbr,crdrent in ipairs(stext) do
		curthing = split (stext[nudmbr], ">")
		eendrest = eendrest.."|"..curthing[1].."\n|"..curthing[2].."\n|"..curthing[3].."\n|-\n"
	end
	return eendrest
end

function p.dia( frame )
    stext = split (frame.args[1], "§§§")
	lengthi = tablelength(stext)
	curthing = ""
	eendrest = ""
	for nudmbr,crdrent in ipairs(stext) do
		curthing = split (stext[nudmbr], ":")
		eendrest = eendrest.."\n'''"..curthing[1]..":'''\n\n„"..curthing[2].."“\n"
	end
	eendrest = string.gsub(eendrest, "(\n[\n%s]*)", "''%1''")
	return eendrest
end
function p.image( frame )
	imaage = "[[Datei:"..frame.args[1]
	if (frame.args[2]~=nil) then
		imaage = imaage.."|"..frame.args[2]
	end
	if (frame.args[3]~=nil) then
		imaage = imaage.."|"..frame.args[3]
	end
	if (frame.args[4]~=nil) then
		imaage = imaage.."|"..frame.args[4]
	end
	if (frame.args[5]~=nil) then
		imaage = imaage.."|"..frame.args[5]
	end
	if (frame.args[6]~=nil) then
		imaage = imaage.."|"..frame.args[6]
	end
	imaage = imaage.."]]"
	return imaage
end


function p.vid( frame )
	stext = split (frame.args[2], "§§§")
	seend = "Hier kannst du das Abenteuer von ["..frame.args[1].."] noch einmal nachschauen! Viel Spaß! :)\n"..'{|class="wikitable"\n|-\n'
    for nuudmbr,curdrent in ipairs(stext) do
		seend = seend.."!Teil "..tostring(nuudmbr).."\n"
	end
	seend = seend.."|-\n"
    for nuudmbr,curdrent in ipairs(stext) do
		seend = seend.."|"..frame:callParserFunction('#tag:youtube', curdrent).."\nFalls das Video nicht richtig angezeigt wird, kannst du es ["..curdrent.." hier] finden.\n"
	end
	seend = seend.."|-\n|}\n"
	return seend
end

function p.talents( frame )
	handeln = split (frame.args[1], "\n")
	wissen = split (frame.args[2], "\n")
	soziales = split (frame.args[3], "\n")
    lenlist = {}
	lenlist[1] = tablelength(handeln)
	lenlist[2] = tablelength(wissen)
	lenlist[3] = tablelength(soziales)
	highesst = gethighest(lenlist)
	intex = 1
	selast = ""
	while (intex<=highesst) do
		selast = selast.."|"
		if (handeln[intex]~=nil) then
			selast = selast..handeln[intex]
		end
		selast = selast.."\n|"
		if (wissen[intex]~=nil) then
			selast = selast..wissen[intex]
		end
		selast = selast.."\n|"
		if (soziales[intex]~=nil) then
			selast = selast..soziales[intex]
		end
		selast = selast.."\n|-\n"
		intex = intex+1
	end
	return selast
end

function p.description( frame )
    stext = split (frame.args[1], "§§§")
	eerndrest=""
	if(tabContains(stext,"Szene")) then 
		eerndrest = eerndrest.."'''Szenen:'''\nSzenen geben Handlung und Orte vor, die die Spieler meist passiv miterleben.\n\n"
	end
	if(tabContains(stext,"Inter")) then 
		eerndrest = eerndrest.."'''<span style='color:#BB0011;'>Interaktionen:</span>'''\nInteraktionen sind aktive Szenen, die eine Interaktion mit den Spielern erfordern.\n\n"
	end
	if(tabContains(stext,"Kursiv")) then 
		eerndrest = eerndrest.."''Kursive Texte:''\nKursive Texte können wörtlich vorgetragen werden und beinhalten meist direkte Rede oder Beschreibungen.\n\n"
	end
	if(tabContains(stext,"Probe")) then 
		eerndrest = eerndrest.."'''<span style='color:#31B404;'>Proben:</span>'''\nSteht für mögliche Talentwürfe, welche die Spieler ablegen müssen.\n\n"
	end
	if(tabContains(stext,"Moral")) then 
		eerndrest = eerndrest.."'''<span style='color:#00b8ff;'>Moral:</span>'''\nBeinhaltet Situationen, an denen die Spieler moralische Fragen beantworten müssen, die sich auf den Verlauf des Abenteuers auswirken können.\n\n"
	end
	if(tabContains(stext,"Module")) then 
		eerndrest = eerndrest.."'''<span style='color:#4B088A;'>Module:</span>'''\nBeinhalten Regeln, die zusätzlich zum Grundregelwerk in diesem Abenteuer verwendet werden.\n\n"
	end
	if(tabContains(stext,"Module2")) then 
		eerndrest = eerndrest.."'''<span style='color:#0014ff;'>Module 2:</span>'''\nBeinhaltet ebenfalls Regeln, eines anderen Modul allerdings, die farblich vom ersten Modul abgegrenzt sind.\n\n"
	end
	if(tabContains(stext,"Box")) then 
		eerndrest = eerndrest.."<div class='box'>'''Boxen:''' Boxen stehen für Spielleiterhinweise und beinhalten meist Hintergrundinformationen, welche die Spieler nicht haben können.</div>\n\n"
	end
	return string.sub(eerndrest,0,string.len(eerndrest)-2)
end

function p.ygggegerror ( frame )
	displayedtext = "\n\n----\n\n"
	listeeins, listezwei = gegapi()
	headerends = {}
	schlagworte = schlagwortliste()
	for eines,zweites in pairs(listeeins) do
		table.insert(headerends,listeeins[eines]["Name"])
		for qfsdf,zweihgfhgtes in pairs(listeeins[eines]["Schlagwörter"]) do
			if (tabContains(schlagworte,zweihgfhgtes)==nil) then
				displayedtext = displayedtext..'<span style="color:red;"><big><big><big> Falsches Schlagwort gefunden: "'..zweihgfhgtes..'"'..", unter: '''("..listeeins[eines]["Category"].." - "..listeeins[eines]["Subcategory"].." - "..listeeins[eines]["Name"]..")'''!Bitte Ändern!</big></big></big>"..'</span>\n\n----\n\n'
			end
		end
	end
	dupeeeetab = duptable(headerends)
	for zup,dupeeee in pairs(dupeeeetab) do
		if (dupeeee~=nil) then
			displayedtext = displayedtext..'<span style="color:red;"><big><big><big>Duplikat gefunden: "'..listeeins[dupeeee[1]]["Name"]..'"'..", unter: '''("..listeeins[dupeeee[1]]["Category"]..' - '..listeeins[dupeeee[1]]["Subcategory"]..")''' und unter: '''("..listeeins[dupeeee[2]]["Category"]..' - '..listeeins[dupeeee[2]]["Subcategory"]..")''' !Bitte Ändern!</big></big></big>"..'</span>\n\n----\n\n'
		end
	end
	
	
	return displayedtext

end

function p.testzwei ( frame )

	
	return frame.args["test"]
end

function p.cur ( frame )
	thingtext = frame.args[1]
	thingtext = string.gsub(thingtext, "(\n+)", "''%1''")
	return thingtext
end

function p.probe ( frame )
	return "'''<span style='color:#31B404;'>"..string.gsub(frame.args[1], "(\n+)" , "</span>'''%1'''<span style='color:#31B404;'>").."</span>'''"
end

function p.taglist ( frame )
	currenttagstate = frame.args[2]
	currentcatstate = frame.args[3]
	currentsite = frame.args[1]
	allsetcats = categorylist()
	allsetags = schlagwortliste()
	if (string.len(currenttagstate)~=tablelength(allsetags)) then
		currenttagstate = zeros(tablelength(allsetags))
	end
	if (string.len(currentcatstate)~=doubletablelength(allsetcats)) then
		currentcatstate = zeros(doubletablelength(allsetcats))
	end
	
	
	sefinalendtext = '{|class="tagholder"\n|style="width:40%"|\n'
	tagstatelength = string.len(currenttagstate)
	catstatelength = string.len(currentcatstate)
	countcat = 1
	
	for curcatname,cursubcats in pairs(allsetcats) do
		cursublength = tablelength(cursubcats)
		catstdif = catstatelength-cursublength+1
		
		sefinalendtext = sefinalendtext..'{|class="'..nummulttran(currentcatstate,catstdif,catstatelength)..'"\n|'..nummulttranlinkopen(currentcatstate,catstdif,catstatelength)..'[https://howtobeahero.de/index.php?title='..currentsite..'&tagstate='..currenttagstate..'&catstate='..multchangebinall(currentcatstate, catstdif, catstatelength).." "..curcatname..":]</span>\n" 
		nowcatstatelength = catstatelength-cursublength
		while (catstatelength>nowcatstatelength) do
			cursubcatname = allsetcats[curcatname][catstatelength-nowcatstatelength]
			sefinalendtext = sefinalendtext..'{|class="'..numtrancat(currentcatstate,catstatelength)..'"\n|'..numtranlinkopen(currentcatstate,catstatelength)..'[https://howtobeahero.de/index.php?title='..currentsite..'&tagstate='..currenttagstate..'&catstate='..changebin(currentcatstate,catstatelength).." "..cursubcatname.."]</span>\n|}\n"--..numtranlinkopen(
			catstatelength = catstatelength-1
		end
		sefinalendtext = sefinalendtext.."\n|}"
		if (countcat%2==0) then
			sefinalendtext = sefinalendtext.."\n<div>\n\n</div>\n"
		
		else
			sefinalendtext = sefinalendtext.."\n"
		end
		countcat=countcat+1
			
	end
	
	sefinalendtext = sefinalendtext..'|style="width:40%"|\n'
    while (tagstatelength>0) do
        sefinalendtext=sefinalendtext..'{|class="'..numtran(currenttagstate,tagstatelength)..'"\n|'..numtranlinkopen(currenttagstate,tagstatelength)..'[https://howtobeahero.de/index.php?title='..currentsite..'&tagstate='..changebin(currenttagstate,tagstatelength)..'&catstate='..currentcatstate.." "..allsetags[tagstatelength]..' •]</span>\n|}\n'
		tagstatelength = tagstatelength-1
	end
		
    sefinalendtext=sefinalendtext..'|style="width:20%"|\n'

	senosort, secatliste= getpartapi(currenttagstate,currentcatstate)
	
	sefinalendtext=sefinalendtext..'|-\n|colspan="5" align="left"|\n'
	
	
	
	
	
	yggtabaapie = getyggtabapi(currenttagstate,currentcatstate)
	descuu = getdes()
	for nasf, dgasd in pairs(yggtabaapie) do
		sefinalendtext = sefinalendtext.."=="..nasf.."==\n\n<big><big>"..descuu[nasf].."</big></big>\n\n"
		for nassfsf, dgadasd in pairs(dgasd) do
			sefinalendtext = sefinalendtext.."==="..nassfsf.."===\n\n<big><big>"..descuu[nassfsf].."</big></big>\n\n"
			for nasfgjsfsf, dgagdfgdasd in pairs(dgadasd) do
				sefinalendtext = sefinalendtext.."===="..nasfgjsfsf.."====\n\n"
				frargs = {[1] = dgagdfgdasd["TabID"], [2] = dgagdfgdasd["Img"]}
				rfr = frame
				rfr.args = frargs
				sefinalendtext = sefinalendtext..p.yggtab(rfr).."\n\n"
			end
		end
	end
	sefinalendtext = sefinalendtext.."|}"
	--resulttext = yggtabaapie["log"]
	
	return sefinalendtext.."\n\n"
end

function p.kampflist ( frame )
	seendthingi = '{|style="display: inline-block;"\n|'..string.gsub(frame.args[1], "§§§",'\n|}\n{|style="display: inline-block;"\n|')..'\n|}'
	return seendthingi
end 

function p.howhlp ( frame )
	if (frame.args[1]=="") then
		return "'''None'''"
	else
		--return frame.args[1]
		return "*[[Spielwiese:HowHlp/"..string.sub(frame.args[1],7):gsub("§§§","]]\n*[[Spielwiese:HowHlp/").."]]"
	end
end

function p.testi ( frame )
	return getdes()["Kampfutensilien"]
	
end

function p.abenteuersort( frame )
	output = ""
	categories = mw.ext.dpl.getFullpagenames({["category"] =  "AbenteuerBack" })
	for i,v in ipairs(categories) do
      output = output..v.."<br \>"
    end
	return output
end




return p
--§§§