if Wiimote.home if doubleclicked(Wiimote.home) ExitPie else wait 200 ms ExitProgram endif endif /* Controls Shooting = B button on Wiimote Grenade = Forward Nunchuk thrust Melee = A button on Wiimote Reload = Right button on Wiimote Switch Weapons = Left button on Wiimote Switch Grenade = Up button on Wiimote Zoom = Down button on Wiimote Action = C button on Nunchuk Jump = Z button on Nunchuk */ Mouse.LeftButton = Wiimote.B Mouse.RightButton = Wiimote.Nunchuk.gx > 1.25 Key.F = Wiimote.A Key.R = Wiimote.Right Key.TAB = Wiimote.Left Key.G = Wiimote.Up Key.Z = Wiimote.Down Key.Enter = Wiimote.minus Key.Escape = Wiimote.plus Key.E = Wiimote.Nunchuk.CButton Key.Space = Wiimote.Nunchuk.ZButton /* Movement Use Nunchuk joystick to move around Up = forward Down = backward Right = right Left = left */ Key.D = 1 > Wiimote1.Nunchuk.JoyX > 0.5 Key.A = -1 < Wiimote1.Nunchuk.JoyX < -0.5 Key.S = 1 > Wiimote1.Nunchuk.JoyY > 0.5 Key.W = -1 < Wiimote1.Nunchuk.JoyY < -0.5 debug = "X="+var.xRot+" Y="+var.yRot+" Z="+var.zRot+" MX="+mouse.x+" MY="+mouse.y // When configuring the offsets please put the wiimote flat and do not move it. // These are offsets change them so that your debug output reads 0,28,0 // The debug output is at the top of this window. // Ex if you get -7,33,-6 then change the offsets to 7,-5,6 var.xOffset = 0 var.yOffset = 3 var.zOffset = 0 // Change this if you would like your mouse to go faster var.speed = .7 // change these to a higher number if your hands are not steady or lower if they are var.xCutoff = 10 var.zCutoff = 10 var.xRot = Wiimote.RawForceX + var.xOffset var.yRot = Wiimote.RawForceY + var.yOffset var.zRot = Wiimote.RawForceZ + var.zOffset debug = 'X:' + var.xRot + ', ' + 'Y:' + var.yRot + ', ' + 'Z:' + var.zRot /* This is the code that moves your mouse, in other words, looking around Look left = Rotate the Wiimote left Look right = Rotate the Wiimote right Look up = Rotate the Wiimote up Look down = Rotate the Wiimote down */ if var.xRot > var.xCutoff then mouse.x = mouse.x - .0001 * var.speed * (var.xRot - var.xCutoff) if var.xRot < -var.xCutoff then mouse.x = mouse.x - .0001 * var.speed * (var.xRot + var.xCutoff) if var.zRot > var.zCutoff then mouse.y = mouse.y - .0001 * var.speed * (var.zRot - var.zCutoff) if var.zRot < -var.zCutoff then mouse.y = mouse.y - .0001 * var.speed * (var.zRot + var.zCutoff)