Modul:X: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
(84 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) | ||
require( "Module:Xfunc" ) | |||
function p.cutblock ( frame ) | function p.cutblock ( frame ) | ||
text = frame.args[3]-- "Die Schmiede" | text = frame.args[3]-- "Die Schmiede" | ||
Zeile 701: | Zeile 9: | ||
textlen = string.len(text) -- 12 | textlen = string.len(text) -- 12 | ||
tempsplit = {} | tempsplit = {} | ||
while (height>0 and textlen>=width) do -- 12>0 and 12>=4|11>0 and 11>=4 | while (height>0 and textlen>=width) do -- 12>0 and 12>=4|11>0 and 11>=4 | ||
tempsplit = split(cut(width, text), "%%%@%%") -- ("Die", "Schmiede")| ( | tempsplit = split(cut(width, text), "%%%@%%") -- ("Die", "Schmiede")| ( | ||
Zeile 715: | Zeile 25: | ||
text = "" | text = "" | ||
end | end | ||
result = block.."%@%"..text | result = block.."%@%"..text | ||
result = string.gsub(result, "%§", " ") | result = string.gsub(result, "%§", " ") | ||
return result | return result | ||
end | end | ||
function p.cut( frame ) | function p.cut( frame ) | ||
testtext = "" | testtext = "" | ||
Zeile 729: | Zeile 43: | ||
text = display(removespaceinlink(realtext)) --Die Schmiede | text = display(removespaceinlink(realtext)) --Die Schmiede | ||
stext = split(text, " ") --Die|Schmiede(list) | stext = split(text, " ") --Die|Schmiede(list) | ||
if(table.getn(stext)==1) then | if(table.getn(stext)==1) then | ||
if(string.len(stext[1])>limit) then | if(string.len(stext[1])>limit) then | ||
Zeile 736: | Zeile 51: | ||
end | end | ||
end | end | ||
cuttext = stext[1] --Die | cuttext = stext[1] --Die | ||
realcuttext = srealtext[1] --Die | realcuttext = srealtext[1] --Die | ||
nextwo = stext[2] --Schmiede | nextwo = stext[2] --Schmiede | ||
realnextwo = srealtext[2] --Schmiede | realnextwo = srealtext[2] --Schmiede | ||
nextlen = string.len(nextwo)--8 | nextlen = string.len(nextwo)--8 | ||
textlen = string.len(text)--12 | textlen = string.len(text)--12 | ||
cuttextlen = string.len(cuttext)--3 | cuttextlen = string.len(cuttext)--3 | ||
set = true; | set = true; | ||
testtext = testtext.."<br \>"..i..": "..realcuttext | testtext = testtext.."<br \>"..i..": "..realcuttext | ||
if(limit>=textlen)then --4>=12 | if(limit>=textlen)then --4>=12 | ||
return realtext.."%@%" | return realtext.."%@%" | ||
elseif(cuttextlen>limit) then--3>4 | elseif(cuttextlen>limit) then--3>4 | ||
return "%@%"..realtext | return "%@%"..realtext | ||
else | else | ||
while (cuttextlen+nextlen+1<=textlen+2) do --8+3+1<=12+2(12<=14)|14+3+1<=12+2(18<=14) | 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)| | if(cuttextlen+nextlen+1>limit and set) then --8+3+1>4(12>4)| | ||
set = false | set = false | ||
cuttext = cuttext.."%@%" --"Die %@%" | cuttext = cuttext.."%@%" --"Die %@%" | ||
realcuttext = realcuttext.."%@%" --"Die %@%" | realcuttext = realcuttext.."%@%" --"Die %@%" | ||
else | else | ||
cuttext = cuttext.." " -- | cuttext = cuttext.." " -- | ||
realcuttext = realcuttext.." " -- | realcuttext = realcuttext.." " -- | ||
end | end | ||
-- testtext = testtext..tostring(i)..": "..realcuttext.."<br />" | -- testtext = testtext..tostring(i)..": "..realcuttext.."<br />" | ||
i = i + 1 --3 | i = i + 1 --3 | ||
cuttext = cuttext..nextwo -- "Die%@%Schmiede" | cuttext = cuttext..nextwo -- "Die%@%Schmiede" | ||
realcuttext = realcuttext..realnextwo -- "Die%@%Schmiede" | realcuttext = realcuttext..realnextwo -- "Die%@%Schmiede" | ||
nextwo = stext[i]-- nil | nextwo = stext[i]-- nil | ||
realnextwo = srealtext[i]-- nil | realnextwo = srealtext[i]-- nil | ||
if (nextwo ~= nil) then | if (nextwo ~= nil) then | ||
nextlen = string.len(nextwo) -- 5 | nextlen = string.len(nextwo) -- 5 | ||
Zeile 770: | Zeile 101: | ||
cuttextlen = string.len(cuttext) -- 14 | cuttextlen = string.len(cuttext) -- 14 | ||
testtext = testtext.."<br \>"..i..": "..realcuttext | testtext = testtext.."<br \>"..i..": "..realcuttext | ||
end | end | ||
realnextwo = srealtext[i] | realnextwo = srealtext[i] | ||
Zeile 779: | Zeile 111: | ||
return realcuttext | return realcuttext | ||
end | end | ||
function p.display ( frame ) | function p.display ( frame ) | ||
text = frame.args[1] | text = frame.args[1] | ||
Zeile 794: | Zeile 127: | ||
currentauf = nil | currentauf = nil | ||
end | end | ||
i=i+1 | i=i+1 | ||
end | end | ||
i=1 | i=1 | ||
currentzu = string.find(text, "%|") | currentzu = string.find(text, "%|") | ||
Zeile 807: | Zeile 142: | ||
i=i+1 | i=i+1 | ||
end | end | ||
offset = 0 | offset = 0 | ||
if(table.getn(auf) == table.getn(zu))then | if(table.getn(auf) == table.getn(zu))then | ||
i=1 | i=1 | ||
while (table.getn(auf)>=i) do | while (table.getn(auf)>=i) do | ||
Zeile 823: | Zeile 161: | ||
text = string.gsub(text, "%[%[(.+)%|", "") | text = string.gsub(text, "%[%[(.+)%|", "") | ||
end | end | ||
-- text = text:gsub("%[", "") | -- text = text:gsub("%[", "") | ||
-- text = text:gsub("%|", "") | -- text = text:gsub("%|", "") | ||
text = text:gsub("%]", "") | text = text:gsub("%]", "") | ||
return text | return text | ||
end | end | ||
function p.split ( frame ) | function p.split ( frame ) | ||
spl = split(frame.args[1],frame.args[2]) | spl = split(frame.args[1],frame.args[2]) | ||
Zeile 836: | Zeile 180: | ||
i=i+1 | i=i+1 | ||
end | end | ||
return t | return t | ||
end | end | ||
function p.removespaceinlink(frame) | function p.removespaceinlink(frame) | ||
text = frame.args[1] | text = frame.args[1] | ||
Zeile 851: | Zeile 197: | ||
currentauf = nil | currentauf = nil | ||
end | end | ||
i=i+1 | i=i+1 | ||
end | end | ||
i=1 | i=1 | ||
currentzu = string.find(text, "%]%]") | currentzu = string.find(text, "%]%]") | ||
Zeile 870: | Zeile 218: | ||
ende = zu[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)) | 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 | i=i+1 | ||
end | end | ||
end | end | ||
return text | return text | ||
end | end | ||
function p.size ( frame ) | function p.size ( frame ) | ||
text = frame.args[1] | text = frame.args[1] | ||
return textSize(text) | return textSize(text) | ||
end | end | ||
function p.size ( frame ) | function p.size ( frame ) | ||
text = frame.args[1] | text = frame.args[1] | ||
return textSize(text) | return textSize(text) | ||
end | end | ||
function p.findg( frame ) | function p.findg( frame ) | ||
text = frame.args[1] | text = frame.args[1] | ||
d,s,r = string.find(text, "g") | d,s,r = string.find(text, "g") | ||
return d,s,r | return d,s,r | ||
end | end | ||
function p.indexold | function p.indexold | ||
( frame ) | ( frame ) | ||
Zeile 905: | Zeile 269: | ||
while (inde<=headlen) do | while (inde<=headlen) do | ||
finish = finish.."|[[Yggdrasil:"..currentpage.."#"..currentheaders[inde].."|"..currentheaders[inde].."]]\n|[[Yggdrasil:"..currentpage.."|"..currentpage.."]]\n|-\n" | finish = finish.."|[[Yggdrasil:"..currentpage.."#"..currentheaders[inde].."|"..currentheaders[inde].."]]\n|[[Yggdrasil:"..currentpage.."|"..currentpage.."]]\n|-\n" | ||
inde=inde+1 | inde=inde+1 | ||
end | end | ||
i=i+1 | i=i+1 | ||
end | end | ||
--text = frame.args[1] | --text = frame.args[1] | ||
--stext = split (text, "\n") | --stext = split (text, "\n") | ||
--ending = "" | --ending = "" | ||
--for i = 1,tablelength(stext),1 do | --for i = 1,tablelength(stext),1 do | ||
-- currentsplit = split (stext[i], "%>") | -- currentsplit = split (stext[i], "%>") | ||
Zeile 917: | Zeile 285: | ||
-- ending = ending.."|[[Yggdrasil:"..currentsplit[2].."#"..currentsplit[1].."|"..currentsplit[1].."]]\n|[[Yggdrasil:"..currentsplit[2].."|"..currentsplit[2].."]]\n|-\n" | -- ending = ending.."|[[Yggdrasil:"..currentsplit[2].."#"..currentsplit[1].."|"..currentsplit[1].."]]\n|[[Yggdrasil:"..currentsplit[2].."|"..currentsplit[2].."]]\n|-\n" | ||
--end | --end | ||
return finish | return finish | ||
end | end | ||
function p.yggrassen( frame ) | function p.yggrassen( frame ) | ||
text = frame.args[1] | text = frame.args[1] | ||
Zeile 927: | Zeile 298: | ||
snebentext = split (nebentext, "\n") | snebentext = split (nebentext, "\n") | ||
ending = "!<big>Hauptrassen</big>\n|-\n" | ending = "!<big>Hauptrassen</big>\n|-\n" | ||
for i = 2,tablelength(stext),1 do | for i = 2,tablelength(stext),1 do | ||
if (stext[i]=="'''Nebenrassen'''") then | if (stext[i]=="'''Nebenrassen'''") then | ||
Zeile 934: | Zeile 306: | ||
end | end | ||
end | end | ||
return ending | return ending | ||
end | end | ||
function p.yggtab( frame ) | function p.yggtab( frame ) | ||
text = frame.args[1] | text = frame.args[1] | ||
Zeile 944: | Zeile 324: | ||
if (img~=nil and img~='' and img~='{{{img}}}') then | if (img~=nil and img~='' and img~='{{{img}}}') then | ||
imgtext='<div id="yggimg">[[Datei:'..img..']]</div>\n' | imgtext='<div id="yggimg">[[Datei:'..img..']]</div>\n' | ||
end | end | ||
i=1 | i=1 | ||
Zeile 953: | Zeile 334: | ||
rettext=rettext..'|style="width:68%; padding: 10px;" |' | rettext=rettext..'|style="width:68%; padding: 10px;" |' | ||
end | end | ||
while (stext[i+1]~=nil and stext[i]~='-') do | while (stext[i+1]~=nil and stext[i]~='-') do | ||
if(string.sub(stext[i],1,1)=='/') then | if(string.sub(stext[i],1,1)=='/') then | ||
Zeile 959: | Zeile 341: | ||
found=string.find(stext[i],'#') | 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]))..']]' | 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 | else | ||
rettext=rettext..'[[#'..stext[i]..'|'..stext[i]..']]' | rettext=rettext..'[[#'..stext[i]..'|'..stext[i]..']]' | ||
Zeile 965: | Zeile 348: | ||
i=i+1 | i=i+1 | ||
end | end | ||
rettext=rettext..'|-\n' | rettext=rettext..'|-\n' | ||
i=i+1 | i=i+1 | ||
end | end | ||
rettext=rettext..'|}'..stext[i-1]..'\n|style="width:20%; padding: 0; vertical-align:top;"|'..imgtext | 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|}' | return '{|style="width:100%;"\n|style="width:80%; padding: 0; vertical-align:top;"|\n'..rettext..'\n|}' | ||
end | end | ||
function p.getpage( frame ) | function p.getpage( frame ) | ||
title = mw.title.new( frame.args[1], frame.args[2] ) | title = mw.title.new( frame.args[1], frame.args[2] ) | ||
Zeile 976: | Zeile 362: | ||
return content | return content | ||
end | end | ||
function p.getheader( frame ) | function p.getheader( frame ) | ||
title = mw.title.new( frame.args[1], frame.args[2] ) | title = mw.title.new( frame.args[1], frame.args[2] ) | ||
Zeile 993: | Zeile 380: | ||
return finaltext | return finaltext | ||
end | end | ||
function p.index( frame ) | function p.index( frame ) | ||
--content = displaytablevert(getindexformat()) | --content = displaytablevert(getindexformat()) | ||
Zeile 1.013: | Zeile 403: | ||
tempfinish = getindexformat()[1] | tempfinish = getindexformat()[1] | ||
tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1]) | tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1]) | ||
tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]") | tempfinish = string.gsub(tempfinish, "{{{h1 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][1].."|"..currentheaders[inde][1].."]]") | ||
elseif(tablelength(currentheaders[inde])==2) then | elseif(tablelength(currentheaders[inde])==2) then | ||
tempfinish = getindexformat()[2] | tempfinish = getindexformat()[2] | ||
tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1]) | tempfinish = string.gsub(tempfinish, "{{{h1}}}", currentheaders[inde][1]) | ||
tempfinish = string.gsub(tempfinish, "{{{h2}}}", currentheaders[inde][2]) | 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, "{{{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, "{{{h2 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][2].."|"..currentheaders[inde][2].."]]") | ||
elseif(tablelength(currentheaders[inde])==3) then | elseif(tablelength(currentheaders[inde])==3) then | ||
tempfinish = getindexformat()[3] | tempfinish = getindexformat()[3] | ||
Zeile 1.025: | Zeile 419: | ||
tempfinish = string.gsub(tempfinish, "{{{h2}}}", currentheaders[inde][2]) | tempfinish = string.gsub(tempfinish, "{{{h2}}}", currentheaders[inde][2]) | ||
tempfinish = string.gsub(tempfinish, "{{{h3}}}", currentheaders[inde][3]) | 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, "{{{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, "{{{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, "{{{h3 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][3].."|"..currentheaders[inde][3].."]]") | ||
elseif(tablelength(currentheaders[inde])==4) then | elseif(tablelength(currentheaders[inde])==4) then | ||
tempfinish = getindexformat()[4] | tempfinish = getindexformat()[4] | ||
Zeile 1.034: | Zeile 430: | ||
tempfinish = string.gsub(tempfinish, "{{{h3}}}", currentheaders[inde][3]) | tempfinish = string.gsub(tempfinish, "{{{h3}}}", currentheaders[inde][3]) | ||
tempfinish = string.gsub(tempfinish, "{{{h4}}}", currentheaders[inde][4]) | 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, "{{{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, "{{{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, "{{{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, "{{{h4 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][4].."|"..currentheaders[inde][4].."]]") | ||
elseif(tablelength(currentheaders[inde])==5) then | elseif(tablelength(currentheaders[inde])==5) then | ||
tempfinish = getindexformat()[5] | tempfinish = getindexformat()[5] | ||
Zeile 1.045: | Zeile 443: | ||
tempfinish = string.gsub(tempfinish, "{{{h4}}}", currentheaders[inde][4]) | tempfinish = string.gsub(tempfinish, "{{{h4}}}", currentheaders[inde][4]) | ||
tempfinish = string.gsub(tempfinish, "{{{h5}}}", currentheaders[inde][5]) | 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, "{{{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, "{{{h2 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][2].."|"..currentheaders[inde][2].."]]") | ||
Zeile 1.050: | Zeile 449: | ||
tempfinish = string.gsub(tempfinish, "{{{h4 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][4].."|"..currentheaders[inde][4].."]]") | 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, "{{{h5 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][5].."|"..currentheaders[inde][5].."]]") | ||
elseif(tablelength(currentheaders[inde])==6) then | elseif(tablelength(currentheaders[inde])==6) then | ||
tempfinish = getindexformat()[6] | tempfinish = getindexformat()[6] | ||
Zeile 1.058: | Zeile 458: | ||
tempfinish = string.gsub(tempfinish, "{{{h5}}}", currentheaders[inde][5]) | tempfinish = string.gsub(tempfinish, "{{{h5}}}", currentheaders[inde][5]) | ||
tempfinish = string.gsub(tempfinish, "{{{h6}}}", currentheaders[inde][6]) | 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, "{{{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, "{{{h2 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][2].."|"..currentheaders[inde][2].."]]") | ||
Zeile 1.064: | Zeile 465: | ||
tempfinish = string.gsub(tempfinish, "{{{h5 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][5].."|"..currentheaders[inde][5].."]]") | 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].."]]") | tempfinish = string.gsub(tempfinish, "{{{h6 link}}}", "[[Yggdrasil:"..currentpage.."#"..currentheaders[inde][6].."|"..currentheaders[inde][6].."]]") | ||
end | end | ||
if(tablelength(currentheaders[inde])~=0) then | if(tablelength(currentheaders[inde])~=0) then | ||
Zeile 1.081: | Zeile 485: | ||
currentpagedis = currentpage | currentpagedis = currentpage | ||
end | end | ||
tempfinish = "|"..string.gsub(string.gsub(tempfinish, "{{{page}}}", currentpagedis),"\n", "",1) | tempfinish = "|"..string.gsub(string.gsub(tempfinish, "{{{page}}}", currentpagedis),"\n", "",1) | ||
tempfinish = string.gsub(tempfinish, "{{{page link}}}", "[[Yggdrasil:"..currentpage.."|"..currentpagedis.."]]") | tempfinish = string.gsub(tempfinish, "{{{page link}}}", "[[Yggdrasil:"..currentpage.."|"..currentpagedis.."]]") | ||
Zeile 1.087: | Zeile 492: | ||
inde=inde+1 | inde=inde+1 | ||
end | end | ||
i=i+1 | i=i+1 | ||
end | end | ||
return finish | return finish | ||
--<h2> | |||
end | end | ||
function p.religion( frame ) | function p.religion( frame ) | ||
ull = "" | ull = "" | ||
Zeile 1.108: | Zeile 519: | ||
return ull | return ull | ||
end | end | ||
function p.test( frame ) | function p.test( frame ) | ||
dieter, dieter2 = gegapi() | dieter, dieter2 = gegapi() | ||
Zeile 1.123: | Zeile 536: | ||
leresti = leresti.."\n" | leresti = leresti.."\n" | ||
end | end | ||
return leresti | return leresti | ||
end | end | ||
function p.options( frame ) | function p.options( frame ) | ||
stext = split (frame.args[1], "§§§") | stext = split (frame.args[1], "§§§") | ||
Zeile 1.149: | Zeile 567: | ||
tempzwei = string.sub(tempzwei,2) | tempzwei = string.sub(tempzwei,2) | ||
end | end | ||
finalthing = "*"..tempeins.." ( | finalthing = "*"..tempeins.." (bei 1-50)\n*"..tempzwei.." (bei 51-100)" | ||
elseif(lengthi==3) then | elseif(lengthi==3) then | ||
if (string.sub(stext[1],1,1)~="/") then | if (string.sub(stext[1],1,1)~="/") then | ||
Zeile 1.378: | Zeile 796: | ||
end | end | ||
return finalthing | return finalthing | ||
end | end | ||
function p.optionsnodice( frame ) | function p.optionsnodice( frame ) | ||
Zeile 1.632: | Zeile 1.051: | ||
end | end | ||
return finalthing | return finalthing | ||
end | end | ||
function p.kampf( frame ) | function p.kampf( frame ) | ||
Zeile 1.644: | Zeile 1.064: | ||
return eendrest | return eendrest | ||
end | end | ||
function p.dia( frame ) | function p.dia( frame ) | ||
stext = split (frame.args[1], "§§§") | stext = split (frame.args[1], "§§§") | ||
Zeile 1.676: | Zeile 1.097: | ||
return imaage | return imaage | ||
end | end | ||
function p.vid( frame ) | function p.vid( frame ) | ||
stext = split (frame.args[2], "§§§") | stext = split (frame.args[2], "§§§") | ||
seend = "Hier kannst du das Abenteuer von ["..frame.args[1].."] noch | 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 | for nuudmbr,curdrent in ipairs(stext) do | ||
seend = seend.."!Teil "..tostring(nuudmbr).."\n" | seend = seend.."!Teil "..tostring(nuudmbr).."\n" | ||
Zeile 1.684: | Zeile 1.107: | ||
seend = seend.."|-\n" | seend = seend.."|-\n" | ||
for nuudmbr,curdrent in ipairs(stext) do | for nuudmbr,curdrent in ipairs(stext) do | ||
seend = seend.."|"..curdrent.."\n" | seend = seend.."|"..frame:callParserFunction('#tag:youtube', curdrent).."\nFalls das Video nicht richtig angezeigt wird, kannst du es ["..curdrent.." hier] finden.\n" | ||
end | end | ||
seend = seend.."|-\n|}\n" | seend = seend.."|-\n|}\n" | ||
return seend | return seend | ||
end | end | ||
function p.talents( frame ) | function p.talents( frame ) | ||
handeln = split (frame.args[1], "\n") | handeln = split (frame.args[1], "\n") | ||
Zeile 1.718: | Zeile 1.142: | ||
return selast | return selast | ||
end | end | ||
function p.description( frame ) | function p.description( frame ) | ||
stext = split (frame.args[1], "§§§") | stext = split (frame.args[1], "§§§") | ||
Zeile 1.738: | Zeile 1.163: | ||
if(tabContains(stext,"Module")) then | 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" | 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 | end | ||
if(tabContains(stext,"Box")) then | if(tabContains(stext,"Box")) then | ||
Zeile 1.744: | Zeile 1.172: | ||
return string.sub(eerndrest,0,string.len(eerndrest)-2) | return string.sub(eerndrest,0,string.len(eerndrest)-2) | ||
end | end | ||
function p.ygggegerror ( frame ) | function p.ygggegerror ( frame ) | ||
displayedtext = "\n\n----\n\n" | displayedtext = "\n\n----\n\n" | ||
Zeile 1.763: | Zeile 1.192: | ||
end | end | ||
end | end | ||
return displayedtext | return displayedtext | ||
end | end | ||
function p.testzwei ( frame ) | function p.testzwei ( frame ) | ||
return frame.args["test"] | return frame.args["test"] | ||
end | end | ||
function p.cur ( frame ) | function p.cur ( frame ) | ||
thingtext = frame.args[1] | thingtext = frame.args[1] | ||
Zeile 1.773: | Zeile 1.209: | ||
return thingtext | return thingtext | ||
end | end | ||
function p.probe ( frame ) | function p.probe ( frame ) | ||
return "'''<span style='color:#31B404;'>"..string.gsub(frame.args[1], "(\n+)" , "</span>'''%1'''<span style='color:#31B404;'>").."</span>'''" | return "'''<span style='color:#31B404;'>"..string.gsub(frame.args[1], "(\n+)" , "</span>'''%1'''<span style='color:#31B404;'>").."</span>'''" | ||
end | end | ||
function p.taglist ( frame ) | function p.taglist ( frame ) | ||
currenttagstate = frame.args[ | currenttagstate = frame.args[2] | ||
currentcatstate = frame.args[ | currentcatstate = frame.args[3] | ||
currentsite = frame.args[1] | |||
allsetcats = categorylist() | allsetcats = categorylist() | ||
allsetags = schlagwortliste() | allsetags = schlagwortliste() | ||
Zeile 1.785: | Zeile 1.224: | ||
end | end | ||
if (string.len(currentcatstate)~=doubletablelength(allsetcats)) then | if (string.len(currentcatstate)~=doubletablelength(allsetcats)) then | ||
currentcatstate = | currentcatstate = zeros(doubletablelength(allsetcats)) | ||
end | end | ||
sefinalendtext = '{|class="tagholder"\n|style="width:40%"|\n' | sefinalendtext = '{|class="tagholder"\n|style="width:40%"|\n' | ||
tagstatelength = string.len(currenttagstate) | tagstatelength = string.len(currenttagstate) | ||
catstatelength = string.len(currentcatstate) | catstatelength = string.len(currentcatstate) | ||
countcat = 1 | countcat = 1 | ||
for curcatname,cursubcats in pairs(allsetcats) do | for curcatname,cursubcats in pairs(allsetcats) do | ||
cursublength = tablelength(cursubcats) | cursublength = tablelength(cursubcats) | ||
catstdif = catstatelength-cursublength+1 | 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" | 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 | nowcatstatelength = catstatelength-cursublength | ||
Zeile 1.805: | Zeile 1.247: | ||
if (countcat%2==0) then | if (countcat%2==0) then | ||
sefinalendtext = sefinalendtext.."\n<div>\n\n</div>\n" | sefinalendtext = sefinalendtext.."\n<div>\n\n</div>\n" | ||
else | else | ||
sefinalendtext = sefinalendtext.."\n" | sefinalendtext = sefinalendtext.."\n" | ||
end | end | ||
countcat=countcat+1 | countcat=countcat+1 | ||
end | end | ||
sefinalendtext = sefinalendtext..'|style="width:40%"|\n' | sefinalendtext = sefinalendtext..'|style="width:40%"|\n' | ||
while (tagstatelength>0) do | while (tagstatelength>0) do | ||
Zeile 1.815: | Zeile 1.260: | ||
tagstatelength = tagstatelength-1 | tagstatelength = tagstatelength-1 | ||
end | end | ||
sefinalendtext=sefinalendtext..'|style="width:20%"|\n' | sefinalendtext=sefinalendtext..'|style="width:20%"|\n' | ||
sefinalendtext=sefinalendtext..'|} | |||
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" | return sefinalendtext.."\n\n" | ||
end | 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 | 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
--§§§