lua
Code: Select all
function Initialize()
file = SELF:GetOption('File_play')
play_file_w = io.open(file, 'w')
play_file_w:write(0)
io.close(play_file_w)
last_play = 0
end
function Update()
play_file = io.open(file)
play_read = play_file:read("*all")
play_read = string.gsub(play_read, "\t", " ")
play_file:close()
SKIN:Bang('!SetVariable', 'ERROR_MSG', play_read)
SKIN:Bang('!SetVariable', 'last_play', last_play)
play_contents = SKIN:GetVariable("play_var")
if tonumber(play_read) ~= tonumber(last_play) then
SKIN:Bang('!ToggleMeter', "Background.Play")
SKIN:Bang('!ToggleMeter', "Image.Play")
SKIN:Bang('!ToggleMeter', "Background.Pause")
SKIN:Bang('!ToggleMeter', "Image.Pause")
SKIN:Bang('!SetVariable', 'play_var', play_read)
last_play = tostring(play_read)
SKIN:Bang('!SetVariable', 'ERROR_MSG1', last_play)
end
if tonumber(play_contents) ~= tonumber(last_play) then
SKIN:Bang('!ToggleMeter', "Background.Play")
SKIN:Bang('!ToggleMeter', "Image.Play")
SKIN:Bang('!ToggleMeter', "Background.Pause")
SKIN:Bang('!ToggleMeter', "Image.Pause")
last_play = tostring(play_contents)
SKIN:Bang('!SetVariable', 'last_play', last_play)
play_file_w = io.open(file, 'w')
play_file_w:write(play_contents)
io.close(play_file_w)
end
end
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
[Variables]
play_var=0
skip_var=0
back_var=0
shuffle_var=0
repeat_var=0
ERROR_MSG="A"
ERROR_MSG1="A"
last_play=0
[MeasureName]
Measure=Script
ScriptFile=test5.lua
File_play =C:\Users\----\Documents\Rainmeter\Skins\acidchu_v2\test\play_text.txt
DynamicVariables=1
;;===========================================
[Background.Play]
Meter=Shape
X=50r
Y=r
Hidden=1
Shape=Rectangle 0,0,26,26 | StrokeWidth 0 | Fill Color 255,255,255,1
LeftMouseUpAction=[!SetVariable "play_var" "0"][!Update]
[Image.Play]
Meter=Image
ImageName=Play.png
X=r
Y=r
W=26
Hidden=1
LeftMouseUpAction=[!SetVariable "play_var" "0"][!Update]
[Background.Pause]
Meter=Shape
X=r
Y=r
LeftMouseUpAction=[!SetVariable "play_var" "1"][!Update]
[Image.Pause]
Meter=Image
ImageName=Pause.png
X=r
Y=r
W=26
LeftMouseUpAction=[!SetVariable "play_var" "1"][!Update]