input.buttonA.onEvent(ButtonEvent.Up, function () {
mouse.setButton(MouseButton.Left, false)
})
input.buttonA.onEvent(ButtonEvent.Down, function () {
mouse.setButton(MouseButton.Left, true)
})
forever(function () {
console.logValue("x", input.acceleration(Dimension.X))
console.logValue("y", input.acceleration(Dimension.Y))
if (input.acceleration(Dimension.Y) > 400) {
mouse.move(0, 20)
} else if (input.acceleration(Dimension.Y) < -400) {
mouse.move(0, -20)
} else if (input.acceleration(Dimension.X) > 400) {
mouse.move(20, 0)
} else if (input.acceleration(Dimension.X) < -400) {
mouse.move(-20, 0)
} else if (input.acceleration(Dimension.X) > 200 && input.acceleration(Dimension.Y) > 200) {
mouse.move(20, 20)
} else if (input.acceleration(Dimension.X) < -200 && input.acceleration(Dimension.Y) < -200) {
mouse.move(-20, -20)
} else if (input.acceleration(Dimension.X) > 200 && input.acceleration(Dimension.Y) < -200) {
mouse.move(20, -20)
} else if (input.acceleration(Dimension.X) < -200 && input.acceleration(Dimension.Y) > 200) {
mouse.move(-20, 20)
} else if (input.acceleration(Dimension.X) > 100 && input.acceleration(Dimension.Y) > 300) {
mouse.move(20, 20)
} else if (input.acceleration(Dimension.X) < -100 && input.acceleration(Dimension.Y) < -300) {
mouse.move(-20, -20)
} else if (input.acceleration(Dimension.X) > 300 && input.acceleration(Dimension.Y) > 100) {
mouse.move(20, 20)
} else if (input.acceleration(Dimension.X) < -300 && input.acceleration(Dimension.Y) < -100) {
mouse.move(-20, -20)
} else if (input.acceleration(Dimension.X) > 300 && input.acceleration(Dimension.Y) < -100) {
mouse.move(20, -20)
} else if (input.acceleration(Dimension.X) < -300 && input.acceleration(Dimension.Y) < 100) {
mouse.move(-20, 20)
} else if (input.acceleration(Dimension.X) > 100 && input.acceleration(Dimension.Y) < -300) {
mouse.move(20, -20)
} else if (input.acceleration(Dimension.X) < -100 && input.acceleration(Dimension.Y) > 300) {
mouse.move(-20, 20)
} else if (input.acceleration(Dimension.X) > 50 && input.acceleration(Dimension.Y) > 350) {
mouse.move(20, 20)
} else if (input.acceleration(Dimension.X) < -50 && input.acceleration(Dimension.Y) > -350) {
mouse.move(-20, -20)
} else if (input.acceleration(Dimension.X) > 150 && input.acceleration(Dimension.Y) > 250) {
mouse.move(20, 20)
} else if (input.acceleration(Dimension.X) < -150 && input.acceleration(Dimension.Y) < -250) {
mouse.move(-20, -20)
} else if (input.acceleration(Dimension.X) > 250 && input.acceleration(Dimension.Y) > 150) {
mouse.move(20, 20)
} else if (input.acceleration(Dimension.X) < -250 && input.acceleration(Dimension.Y) < -250) {
mouse.move(-20, -20)
} else if (input.acceleration(Dimension.X) > 350 && input.acceleration(Dimension.Y) > 50) {
mouse.move(20, 20)
} else if (input.acceleration(Dimension.X) < -350 && input.acceleration(Dimension.Y) > -50) {
mouse.move(-20, -20)
} else if (input.acceleration(Dimension.X) < 350 && input.acceleration(Dimension.Y) > 50) {
mouse.move(-20, 20)
} else if (input.acceleration(Dimension.X) > 350 && input.acceleration(Dimension.Y) > -50) {
mouse.move(20, -20)
} else if (input.acceleration(Dimension.X) < -250 && input.acceleration(Dimension.Y) > 150) {
mouse.move(-20, 20)
} else if (input.acceleration(Dimension.X) > 250 && input.acceleration(Dimension.Y) > -150) {
mouse.move(20, -20)
} else if (input.acceleration(Dimension.X) < -150 && input.acceleration(Dimension.Y) > 250) {
mouse.move(-20, 20)
} else if (input.acceleration(Dimension.X) > 150 && input.acceleration(Dimension.Y) < -250) {
mouse.move(20, -20)
} else if (input.acceleration(Dimension.X) < -50 && input.acceleration(Dimension.Y) > 350) {
mouse.move(-20, 20)
} else if (input.acceleration(Dimension.X) > 50 && input.acceleration(Dimension.Y) < -350) {
mouse.move(20, -20)
}
})
Comments