Модуль:Песочница/Pok: различия между версиями
Материал из Space Station 14 Вики
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) Нет описания правки |
||
| Строка 1: | Строка 1: | ||
local p = {} | local p = {} | ||
function p. | function p.increment(frame) | ||
local | local content = mw.title.getCurrentTitle():getContent() | ||
local currentCount = tonumber(content:match('<!--callCount:(%d+)-->')) or 0 | |||
local newCount = currentCount + 1 | |||
mw.title.getCurrentTitle():edit(content .. '\n<!--callCount:' .. newCount .. '-->') | |||
return "Количество вызовов: " .. newCount | |||
end | end | ||
return p | return p | ||
Версия от 13:51, 3 февраля 2025
Для документации этого модуля может быть создана страница Модуль:Песочница/Pok/doc
local p = {}
function p.increment(frame)
local content = mw.title.getCurrentTitle():getContent()
local currentCount = tonumber(content:match('<!--callCount:(%d+)-->')) or 0
local newCount = currentCount + 1
mw.title.getCurrentTitle():edit(content .. '\n<!--callCount:' .. newCount .. '-->')
return "Количество вызовов: " .. newCount
end
return p