Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var DOMAIN_GOTO = "hifi://dev-mobile-master"
- var DOMAIN_CHANGE_TIME_MS = 2800;
- var domainChanges = 0;
- var comeBack = false;
- var initialPos = MyAvatar.position;
- var shouldStop = function() {
- return Vec3.length(Vec3.subtract(initialPos, MyAvatar.position)) > 0.1;
- }
- var tick = Script.setInterval(function() {
- console.log("Changing domains " + (++domainChanges) + " times");
- if (Window.location.href.indexOf(DOMAIN_GOTO) > -1) {
- Window.location.goBack();
- } else {
- if (shouldStop()) {
- Script.clearInterval(tick);
- } else {
- Window.location = DOMAIN_GOTO;
- }
- }
- }, DOMAIN_CHANGE_TIME_MS);
Add Comment
Please, Sign In to add comment