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 | + | if not image then |
− | image = | + | 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 | + | if not game_type then |
− | 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 | ||