Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (13 sloc) 517 Bytes
import Sound.OpenSoundControl
import Network.Netclock.Client
import System.Exit
main = do clocked "starter" "127.0.0.1" "127.0.0.1" 2 onTick
onTick :: BpsChange -> Int -> IO ()
onTick bps ticks = do putStrLn $ "aha " ++ show ticks
if ticks `mod` 8 == 1
then start
else return ()
start :: IO ()
start = do serv <- openUDP "127.0.0.1" 7777
send serv (Message "/screensave/start" [])
exitWith ExitSuccess