Editing Module:IL

From Fallen London Wiki (Staging)

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 33: Line 33:
 
if not image then
 
if not image then
 
image = mw.smw.ask({'[[' .. page .. ']]', '?Has icon'}, 'default=unknown')
 
image = mw.smw.ask({'[[' .. page .. ']]', '?Has icon'}, 'default=unknown')
if image and image[1]["Has icon"] then
+
if not image then
image = string.match(image[1]["Has icon"], '%[%[File:(.-)|')
+
image = 'Question.png'
 
else
 
else
image = 'Question.png'
+
if image[1]["Has icon"] then
 +
image = string.match(image[1]["Has icon"], '%[%[File:(.-)|')
 +
else
 +
image = 'Question.png'
 +
end
 
end
 
end
 
end
 
end
Line 63: Line 67:
 
-- get the game type. Have I mentioned yet I hate smw.ask?
 
-- get the game type. Have I mentioned yet I hate smw.ask?
 
local game_type = mw.smw.ask({'[[' .. page .. ']]', '?Has Game Type'})
 
local game_type = mw.smw.ask({'[[' .. page .. ']]', '?Has Game Type'})
if game_type and game_type[1]['Has Game Type'] then
+
if not game_type then
game_type = game_type[1]['Has Game Type']
+
game_type = 'Unknown'
 
else
 
else
game_type = 'Unknown'
+
if game_type[1]['Has Game Type'] then
 +
game_type = game_type[1]['Has Game Type']
 +
else
 +
game_type = 'Unknown'
 +
end
 
end
 
end
  

Please note that all contributions to Fallen London Wiki (Staging) are considered to be released under the Creative Commons Attribution-ShareAlike (see Fallen London Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)
Preview page with this template

Template used on this page: