// This script is just to show you how Wiimote scripts look // See the WiimoteScripts folder for real scripts //Wiimote regular is the Right, Wiimote2 is left // Set keys to wiimote/nunchuk buttons var.wingsup = 0 key.w = var.keyw //AION mapping Key.a= Wiimote.B Key.d= Wiimote2.B Key.PageUp = Wiimote.A var.keyw = Wiimote.Up If var.counter - var.lastflap >15 Then //debug = "didnt' flap fast enough! Reset the rise key" + var.counter Key.r= False Key.f= True End If //If it's a hard enough flap, we need to see if it's quick enough If Wiimote.RelAccY > 20 and Wiimote2.RelAccY > 20 Then //did they flap recently enough? If var.counter - var.lastflap <= 10 Then debug = "Satisfactory flap" Key.f= False Key.r= True Else debug = "unsatisfactory flap" End If //set this flap as the last flap to determine time betwixt flaps //make sure it isn't the same flap with a time separation If var.counter - var.lastflap >=4 Then var.lastflap = var.counter End If End If //initializes to 0, gives a sense of time var.counter = var.counter + 1 //debug = var.counter // Rumble when shift is pressed Wiimote.rumble = Shift // Set the middle two LEDs to ON Wiimote.Led1 = False Wiimote.Led2 = True Wiimote.Led3 = True Wiimote.Led4 = False // Show the IR dots as fake cursors Cursor1.visible = Wiimote.dot1vis Cursor1.x = Wiimote.dot1x / 1023 Cursor1.y = Wiimote.dot1y / 1023 Cursor2.visible = Wiimote.dot2vis Cursor2.x = Wiimote.dot2x / 1023 Cursor2.y = Wiimote.dot2y / 1023 Cursor3.visible = Wiimote.dot3vis Cursor3.x = Wiimote.dot3x / 1023 Cursor3.y = Wiimote.dot3y / 1023 Cursor4.visible = Wiimote.dot4vis Cursor4.x = Wiimote.dot4x / 1023 Cursor4.y = Wiimote.dot4y / 1023 Mouse.Swallow = True Mouse.DirectInputX = Mouse.DirectInputX + Delta(mouse1.DirectInputX) Mouse.DirectInputY = Mouse.DirectInputY + Delta(mouse1.DirectInputY) Mouse.LeftButton = mouse1.LeftButton Mouse.RightButton = mouse1.RightButton Mouse.MiddleButton = mouse1.MiddleButton Mouse.XButton1 = mouse1.XButton1 Mouse.XButton2 = mouse1.XButton2 Mouse.Button6 = mouse1.Button6 Mouse.Button7 = mouse1.Button7 Mouse.Button8 = mouse1.Button8 Key.a = var.keya Key.d = var.keyd Key.Space = joystick.Button2 debug = joystick.x //set walk to false on first run If var.initialized == False Then var.walk = False var.initialized = True End If // Do mouse pointer 4 If Mouse.present Then // How much has mouse 2 moved? var.deltax4 = Delta(Mouse.DirectInputX) var.deltay4 = Delta(Mouse.DirectInputY) // Mouse ballistics attempt var.velocity = ([(Smooth(var.deltaX4) / 24ms) in inches per second, (Smooth(var.deltaY4) / 24ms) in inches per second] ) // var.velocity = ([(var.deltaX4 / 24ms) in inches per second, (var.deltaY4 / 24ms) in inches per second] ) var.Speed = |var.velocity| //debug=var.speed If var.Speed > var.maxSpeed Then var.maxSpeed = var.Speed End If // debug = var.maxSpeed //debug = var.walk // debug = var.maxSpeed in miles per hour //debug=var.maxSpeed in miles per hour if wiimote.Up == false then If var.Speed > 3 Then var.keyw = True Else var.keyw = False End If end if debug = var.Speed End If