ئىشلەتكۈچى:Oyunqi/UnitTest.js
دىققەت - ساقلىغاندىن كېيىن، تور كۆرگۈنىڭ غەملىكىنى تازىلىغاندىن كېيىنلا ئاندىن ئېلىپ بارغان ئۆزگەرتىشنى كۆرەلەيسىز.
- Firefox / Safari: دا Shift كۇنۇپكىسىنى بېسىپ تۇرۇپ قايتا يۈكلەنى ياكى Ctrl-F5 ياكى Ctrl-R (Mac تا ⌘-R)؛
- Google Chrome: دا Ctrl-Shift-R (⌘-Shift-R Mac)
- Internet Explorer: دا Ctrl نى بېسىپ تۇرۇپ يېڭىلا, ياكى Ctrl-F5؛
- Opera: دا قورال → مايىللىقلار؛ نى بېسىپ غەملەكنى تازىلاڭ.
-- All Lua modules on Wikipedia must begin by defining a variable that will hold their
-- externally accessible functions. They can have any name and may also hold data.
my_object = {};
-- Add a function to the variable. These are callable in Wikipedia via the #invoke command.
-- "frame" will contain the data that Wikipedia sends this function when it is called.
my_object.hello = function( frame )
-- Declare a local variable and assign data to it.
local str = "Hello World!"
-- Quit this function and send the information in "str" back to Wikipedia.
-- The "print" function is not allowed, so all output is accomplished via
-- returning strings in this fashion.
return str
-- End the function.
end
-- All modules end by returning the variable containing its functions to Wikipedia.
return my_object
-- We can now use this module by calling {{#invoke: HelloWorld | hello }}.
-- The #invoke command begins with the module's name, in this case "HelloWorld",
-- then takes the name of one of its functions as an argument, in this case "hello".