Anonimo

Modulo:FunzioniGeneriche: differenze tra le versioni

Da Wikitrek.
nessun oggetto della modifica
Nessun oggetto della modifica
Nessun oggetto della modifica
Riga 338: Riga 338:
local CountLiks = select(2, string.gsub(FullRow, "%[%[", ""))
local CountLiks = select(2, string.gsub(FullRow, "%[%[", ""))
--print (CountLiks)
--print (CountLiks)
if CountLiks == 2 then
if string.find(FullRow, ":") == nil then
--Two links in the string, process both
--Character only, unknown performer
--print("Two links")
Pattern = "%*.-%[%[(.-)%]%].-"
Pattern = "%*.-%[%[(.-)%]%].-:%s?%[%[(.-)%]%]"    
_, Character = string.find(FullRow, Pattern)
elseif CountLiks == 1 then
Performer = "Interprete non accreditato"
--Character is not a linked entity
--print("One link")
Pattern = "%*%s?(.-)%s?:%s?%[%[(.-)%]%]"
else
else
--error no links on either side
if CountLiks == 2 then
    Pattern = "%*%s?(.-)%s?:%s?(.-)%s?\n"
--Two links in the string, process both
--print("Two links")
Pattern = "%*.-%[%[(.-)%]%].-:%s?%[%[(.-)%]%]"     
elseif CountLiks == 1 then
--Character is not a linked entity
--print("One link")
Pattern = "%*%s?(.-)%s?:%s?%[%[(.-)%]%]"
else
--error no links on either side
    Pattern = "%*%s?(.-)%s?:%s?(.-)%s?\n"
end
_, _, Character, Performer = string.find(FullRow, Pattern)
end
end
_, _, Character, Performer = string.find(FullRow, Pattern)
Character = string.gsub(Character, "|.*","")
if Character == nil then
Character = "Null"
else
Character = string.gsub(Character, "|.*","")
end
if Performer == nil then
Performer = "Null"
end
--print("          Character: " .. Character, "Performer: " .. Performer)
--print("          Character: " .. Character, "Performer: " .. Performer)
--print(string.rep("-",100))
--print(string.rep("-",100))