Volatile:ListMolByReference: Difference between revisions

mNo edit summary
mNo edit summary
Line 15: Line 15:
   print("Showing below ".. count .. " structures.")
   print("Showing below ".. count .. " structures.")
   for k,v in pairs(idS) do
   for k,v in pairs(idS) do
     print("* [[Image:" ..k.. ".png]] ")
     print("* [[" ..k.. "&" ..k.. "]] [[Image:" ..k.. ".png&200px]] ")
     for i,w in pairs(v) do
     for i,w in pairs(v) do
       print(i)
       print(i)

Revision as of 00:11, 15 March 2013

Searching IDs with {{{1}}} in the reference namespace.


{{#lua:

 idS = {}
 count=0
 for ref, sp, id in stdin:gmatch("|?|?([^|]+)||([%w\., ]+)||([^\n]+)") do
   local S = idS[id]
   if (S == nil) then idS[id]={} S = idS[id] count = count + 1 end
   if (S[sp] == nil) then S[sp] = {ref}
   else table.insert(S[sp], ref) end
 end
 print("Showing below ".. count .. " structures.")
 for k,v in pairs(idS) do
   print("* " ..k.. " File:" ..k.. ".png ")
   for i,w in pairs(v) do
     print(i)
     for j,x in ipairs(w) do
       print("(ref)")
     end
   end
 end

| {{{1}}} }}