#!/bin/sh # MetaCard 2.4 stack # The following is not ASCII text, # so now would be a good time to q out of more exec mc $0 "$@" ballclock4 2 b 22 ballclock IV U Arial U Arial U Lucida Grande P 'on preOpenStack set loc of this stack to the screenLoc setTime -- THE NEXT LINE PREVENTS THE USER SEEING -- THE SECOND HAND POSITION ITSELF -- UPON OPENING THE STACK wait until the movingControls = "" initStacks end preOpenStack local sLocation -- ARRAY OF LOCATIONS OF THE BALLS local ringPoints,ringLoc on setTime if ringPoints is empty then put the points of grc "_ring" into ringPoints repeat for each line L in ringPoints put globalLoc(L) & cr after temp end repeat delete last char of temp put temp into ringPoints end if if ringLoc is empty then put the loc of grc "_ring" into ringLoc put word 1 of the long time into T split T using ":" repeat with i = 1 to 3 put char i of "HMS" into C if i = 1 then put T[1] * 5 + T[2] div 12 into T[1] -- HOURS WORKS OF MINUTES AS WELL put (T[i] + 59) mod 60 + 1 into T[i] if sLocation[i] = T[i] then next repeat move stack (C & "ball") to (line T[i] of ringPoints) without waiting put T[i] into sLocation[i] end repeat send "setTime" to me in (1 - (the long seconds mod 1)) seconds end setTime on updateStacks # ACCOUNT FOR REPOSITIONING MAINSTACK cancel item 1 of line lineOffset("setTime",pendingMessages()) of pendingMessages() put "" into ringPoints put "" into sLocation put the moveSpeed into MS set the moveSpeed to 500 setTime wait until the movingControls = "" set the moveSpeed to MS end updateStacks --on suspend -- repeat for each char T in "hms" -- topLevel stack (T & "Ball") -- end repeat --end suspend -- --on resume -- initStacks -- go stack ballclock4 --end resume on initStacks repeat for each char T in "hms" set shadow of stack (T & "Ball") to false palette stack (T & "Ball") end repeat end initStacks on closeStack close stack sBall close stack mBall close stack hBall end closeStack # WINDOW DRAG ROUTINE local allowDrag on mouseDown cancel item 1 of line lineOffset("setTime",pendingMessages()) of pendingMessages() put mouseLoc() into allowDrag end mouseDown on mouseMove X,Y if allowDrag = "" then exit mouseMove set topLeft of this stack to globalLoc(X - item 1 of allowDrag & "," & Y - item 2 of allowDrag) end mouseMove on mouseUp put "" into allowDrag updateStacks end mouseUp on mouseRelease mouseUp end mouseRelease 22 cREVGeneral scriptChecksum c"̼w&ن bookmarks handlerList `preOpenStack setTime updateStacks initStacks closeStack mouseDown mouseMove mouseUp mouseReleasescriptSelection char 1905 to 1904prevHandler closeStacktempScript script
on preOpenStack
set loc of this stack to the screenLoc
setTime
-- THE NEXT LINE PREVENTS THE USER SEEING
-- THE SECOND HAND POSITION ITSELF
-- UPON OPENING THE STACK
wait until the movingControls = ""
initStacks
end preOpenStack
local sLocation -- ARRAY OF LOCATIONS OF THE BALLS
local ringPoints,ringLoc
on setTime
if ringPoints is empty then
put the points of grc "_ring" into ringPoints
repeat for each line L in ringPoints
put globalLoc(L) & cr after temp
end repeat
delete last char of temp
put temp into ringPoints
end if
if ringLoc is empty then put the loc of grc "_ring" into ringLoc
put word 1 of the long time into T
split T using ":"
repeat with i = 1 to 3
put char i of "HMS" into C
if i = 1 then put T[1] * 5 + T[2] div 12 into T[1] -- HOURS WORKS OF MINUTES AS WELL
put (T[i] + 59) mod 60 + 1 into T[i]
if sLocation[i] = T[i] then next repeat
move stack (C & "ball") to (line T[i] of ringPoints) without waiting
put T[i] into sLocation[i]
end repeat
send "setTime" to me in (1 - (the long seconds mod 1)) seconds
end setTime
on updateStacks
# ACCOUNT FOR REPOSITIONING MAINSTACK
cancel item 1 of line lineOffset("setTime",pendingMessages()) of pendingMessages()
put "" into ringPoints
put "" into sLocation
put the moveSpeed into MS
set the moveSpeed to 500
setTime
wait until the movingControls = ""
set the moveSpeed to MS
end updateStacks
--on suspend
-- repeat for each char T in "hms"
-- topLevel stack (T & "Ball")
-- end repeat
--end suspend
--
--on resume
-- initStacks
-- go stack ballclock4
--end resume
on initStacks
repeat for each char T in "hms"
set shadow of stack (T & "Ball") to false
palette stack (T & "Ball")
end repeat
end initStacks
on closeStack
close stack sBall
close stack mBall
close stack hBall
end closeStack
# WINDOW DRAG ROUTINE
local allowDrag
on mouseDown
cancel item 1 of line lineOffset("setTime",pendingMessages()) of pendingMessages()
put mouseLoc() into allowDrag
end mouseDown
on mouseMove X,Y
if allowDrag = "" then exit mouseMove
set topLeft of this stack to globalLoc(X - item 1 of allowDrag & "," & Y - item 2 of allowDrag)
end mouseMove
on mouseUp
put "" into allowDrag
updateStacks
end mouseUp
on mouseRelease
mouseUp
end mouseRelease
Sseg C white c _ring C 5 4 <