test {
%fname = $getdir $+ mircnow5.gif
echo fname: %fname
if ($exists(%fname)) {
showgif
return
}
var %url = https://www.mirc.com/images/mircnow5.gif
echo urlget: $urlget(%url,gf,%fname,showgif)
}
showgif {
if (!$exists(%fname)) return
%icons = $pic(%fname).icons
echo icons: %icons
if (%icons > 0) {
%frames = $pic(%fname).frames
echo frames: %frames
if (%frames > 0) {
%w = $calc($pic(%fname).width + 20)
%h = $calc($pic(%fname).height + 20)
window -pf @test 10 10 %w %h
drawrect -fr @test $rgb(255,255,255) 1 0 0 %w %h
%i = 0
.timergif -m 1 0 showframe
}
}
}
showframe {
if (!$window(@test)) return
drawrect -nfr @test $rgb(255,255,255) 1 0 0 %w %h
drawpic -to @test $rgb(0,255,0) 10 10 %i %fname
%delay = $pic(%fname,%i).delay
echo i: %i delay: %delay
.timergif -m 1 %delay showframe
inc %i
if (%i >= %frames) %i = 0
}