Lua:Tutorial GettingStarted
From Spring
Development < Lua Scripting < Lua:Tutorial GettingStarted
function widget:GetInfo()
return {
name = "Name as shown in widget list",
desc = "",
author = "john doe",
date = "date",
license = "PD",
layer = 0,
experimental = false,
enabled = true
}
end
local stringOfWords = "BLAH BLAH BLAH"
local toggle
function widget:Initialize()
Spring.Echo(stringOfWords .. " I STARTED LOOK AT ME JIM!")
end
function widget:Update(frame)
if(toggle == true) then
Spring.Echo("TOCK")
toggle = false
else
Spring.Echo("TICK")
toggle = true
end
end