Module:EncounterTable: Difference between revisions

177 bytes added ,  03:27, 13 November 2019
no edit summary
(ok this fixes it for sure.)
No edit summary
Line 86: Line 86:
       end
       end
     elseif row["item"] == 'none' then  
     elseif row["item"] == 'none' then  
     
      linkstr = ""
       finalTable[i]['item'] = 'Item from [[EncounterTable:' .. row['table']:match('^(.+)%s+%w*$') .. '#' .. row['table'] .. '|' .. row['table'] .. ']]'
       maintable = row['table']:match('^(.+)%s+%w*$')
      if maintable ~= nil and maintable ~= '' then
        linkstr = maintable .. '#' .. row['table']
      else
        linkstr = row['table']
      end
      finalTable[i]['item'] = 'Item from [[EncounterTable:' .. linkstr  .. '|' .. row['table'] .. ']]'
     else
     else
       error('A table and item cannot be specified at the same time!')
       error('A table and item cannot be specified at the same time!')