// antonMover.js // // Created by Thijs Wenker on 7/4/2017 // // Happy 4th of July, Anton! // // Copyright 2017 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html var LOCATION_CHECK_INTERVAL_MS = 5000; var current_change = -1; function checkTimeAndSendLocation() { var current_hour = new Date(); current_hour = current_hour.getHours(); if ((current_hour != current_change) && (current_hour % 2 === 0)) { current_change = current_hour; location = 'hifi://WelcomeWagon/anton'; } } Script.setInterval(function() { checkTimeAndSendLocation(); }, LOCATION_CHECK_INTERVAL_MS);