It is currently June 26th, 2019, 4:54 pm

Tutorial Help

Discuss the use of Lua in Script measures.
drakulaboy
Posts: 164
Joined: June 29th, 2014, 8:35 pm

Tutorial Help

drakulaboy » December 25th, 2014, 9:45 pm

done all like in this video
[youtube]46pjMM9Ydm4[/youtube]

and i get

Image

why and what is the problem

Code: Select all

[Rainmeter]
 Update=1

[myScript]
 Measure=Script
 ScriptFile=myScript.lua

[image]
 Meter=Image
 ImageName=Stop.png
 W=100
 H=100

Code: Select all

function intialize ()
        opacity = 255
        fadeOut = true
end

function Update()

	if opacity == 255 then
		fadeOut = true
	elseif opacity == 0 then
		fadeOut = false
    end

   SKIN:Bang('!SetOption image ImageAlpha ' .. opacity)

   if fadeOut == true then
	opacity = opacity - 1
   else
	opacity = opacity + 1
  end

end
User avatar
smurfier
Moderator
Posts: 1937
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Tutorial Help

smurfier » December 26th, 2014, 3:08 am

The function name you want to use is Initialize. Note the capitalization.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
drakulaboy
Posts: 164
Joined: June 29th, 2014, 8:35 pm

Re: Tutorial Help

drakulaboy » December 26th, 2014, 10:32 am

wow, 1 error and the code won't work, i wish a compilator for lua scripts :D thank you for answer! now it's working, i want to use some simple scripts on a few skins