Модуль:Песочница/Pok: различия между версиями

мНет описания правки
мНет описания правки
Строка 1: Строка 1:
local p = {}
local p = {}


function p.check(frame)
function p.increment(frame)
     if _G.__lua_version then
     local page_title = mw.title.getCurrentTitle().text
        return "Работает LuaStandalone. Версия Lua: " .. _G.__lua_version
    local count_key = "call_counter_" .. page_title
     else
 
        return "Работает LuaSandbox."
    local current_count = mw.getCache():get(count_key) or 0
    end
 
     current_count = current_count + 1
 
    mw.getCache():set(count_key, current_count)
 
    return "Модуль вызван " .. current_count .. " раз(а) на странице " .. page_title .. "."
end
end


return p
return p