// Code for playing FPS Games // Posted by Kasten /* NOTE for this code to work right with the wiimote please read the following */ // 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 = 10 var.yOffset = -32 var.zOffset = 9 // Change this if you would like your mouse to go faster var.speed = 2 // change these to a higher number if your hands are not steady or lower if they are var.xCutoff = 4 var.zCutoff = 4 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 if var.xRot > var.xCutoff then mouse.x = mouse.x - .001 * var.speed * (var.xRot - var.xCutoff) if var.xRot < -var.xCutoff then mouse.x = mouse.x - .001 * var.speed * (var.xRot + var.xCutoff) if var.zRot > var.zCutoff then mouse.y = mouse.y - .001 * var.speed * (-var.zRot - var.zCutoff) if var.zRot < -var.zCutoff then mouse.y = mouse.y - .001 * var.speed * (-var.zRot + var.zCutoff) Up = Wiimote.Up Down = Wiimote.Down Left = Wiimote.Left Right = Wiimote.Right Mouse.LeftButton = Wiimote.B Mouse.RightButton = Wiimote.A if var.yRot >= 100 || var.yRot <= -100 then Mouse.MiddleButton = true else Mouse.MiddleButton = false Keyboard.Space = Wiimote.Home Keyboard.RightControl = Wiimote.Minus Keyboard.NUMPAD0 = Wiimote.Plus Mouse.WheelDown = Wiimote.One Keyboard.RightShift = Wiimote.Two Wiimote.Rumble = Joystick.ForceFeedback Wiimote.Leds = 1