xxxxxxxxxx
function myFunction() -- Start with 'function', give it a name
-- Do something amazing
end -- Finish with 'end'
myFunction() -- Call the function later in the code
xxxxxxxxxx
Lua is a powerful and fast programming language that is easy to
learn and use and to embed into your application.
Lua is designed to be a lightweight embeddable scripting language.
It is used for all sorts of applications,
from games to web applications and image processing.
--
Used commonly in Roblox, Garry's Mod and Multi Theft Auto
xxxxxxxxxx
--// Basic Function
function PrintingText()
print("My text here")
end
PrintingText()
xxxxxxxxxx
function MyFunction()
print('Function fired')
end)
if true == true then
MyFunction() --firing the function.
end
xxxxxxxxxx
// Full page Screenshot
((TakesScreenshot) driver).getScreenshotAs(OutuputType.file)
// Element Screenshot
((TakesScreenshot) element).getScreenshotAs(OutputType.file)
xxxxxxxxxx
-- You can do either
local hello = "Hello World!"
-- Or
print("whatever you want to put in the output")