Motodai (トーク | 投稿記録)
17Liveに準じて、Pococha も作成、当面は、僕青のみ
 
Motodai (トーク | 投稿記録)
文法に従って書き直し
 
(同じ利用者による、間の2版が非表示)
12行目: 12行目:
     end
     end
      
      
     local dataStore = {}
     -- local dataStore = {}
     dataStore['Pocochaアカウント'] = t_name
     -- dataStore['Pocochaアカウント'] = t_name


     local result = mw.smw.set( dataStore )
     local ok, result = pcall(mw.smw.set, {
    ['Pocochaアカウント'] = t_name
    })


     if result == true then
if not ok then
        -- everything ok
return '<span class="error">SMW Lua error: ' .. tostring(result) .. '</span>'
    else
end
     if result ~= true then
         -- error message to be found in result.error
         -- error message to be found in result.error
        return '<span class="error">SMW set error: ' .. tostring(result.error) .. '</span>'
     end
     end
end
end
48行目: 52行目:
end
end


local t_name2 = '(@' .. t_name  ..')';
-- local t_name2 = '(@' .. t_name  ..')';
if mw.ustring.match(name, '%(' .. t_name .. '%)$') then
if mw.ustring.match(name, '%(' .. t_name .. '%)$') then
t_name2 = '';
t_name2 = '';
54行目: 58行目:


     -- Pococha は記事が作成されるまではリンクは張らない
     -- Pococha は記事が作成されるまではリンクは張らない
return '[' ..url ..' ' ..name ..'] ' ..t_name2 ..' - Pococha';
-- return '[' ..url ..' ' ..name ..'] ' ..t_name2 ..' - Pococha';
return '[' ..url ..' ' ..name ..'] - Pococha';
end
end


return p;
return p;