// Half life 2 Script by Ethan and // http://www.wiipcscripts.fr.nf var.dummy = wiimote.rawforcex // Get Nunchuk axis locations. Range is -0.99 to 0.99 // Multiply by 100 to get whole numbers. (-99 to 99) var.xNunchuk = Wiimote.Nunchuk.JoyX * 100 var.yNunchuk = Wiimote.Nunchuk.JoyY * 100 // X/Y offsets for Analog. If it's too sensative then make the numbers larger. var.xOff = 7 var.yOff = 7 // Acceleration ammount for Nunchuk Reload (default = 17.0) var.nunchukAccX = 19.0 // Blink rate for battery check. var.Blink = 500ms // Master Sensitivity (Default 80) - Change Not Recommended var.smooth = 80 // Look Speed (Default 1) var.speed = 1 // Speed When Aiming Down Sight (Default 1/2) var.zoom = 1/2 // Less Sensitive Area Around Cursor (Default 40) var.deadzone = 40 // // Analog Movements // if var.xNunchuk > var.xOff and var.yNunchuk > var.yOff then key.w = false key.a = false key.s = true key.d = true //debug = 'SE' else if var.xNunchuk > var.xOff and var.yNunchuk < -var.yOff then key.w = true key.a = false key.s = false key.d = true //debug = 'NE' else if var.xNunchuk < -var.xOff and var.yNunchuk < -var.yOff then key.w = true key.a = true key.s = false key.d = false //debug = 'NW' else if var.xNunchuk < -var.xOff and var.yNunchuk > var.yOff then key.w = false key.a = true key.s = true key.d = false //debug = 'SW' else if var.xNunchuk > var.xOff then key.w = false key.a = false key.s = false key.d = true //debug = 'Right' else if var.xNunchuk < -var.xOff then key.w = false key.a = true key.s = false key.d = false //debug = 'Left' else if var.yNunchuk < -var.yOff then key.w = true key.a = false key.s = false key.d = false //debug = 'Up' else if var.yNunchuk > var.yOff then key.w = false key.a = false key.s = true key.d = false //debug = 'Down' else if var.xNunchuk > -var.xOff and < var.xOff and var.yNunchuk < var.yOff and > -var.yOff then key.w = false key.a = false key.s = false key.d = false //debug = 'Khai sucks' else key.w = false key.a = false key.s = false key.d = false //debug = 'Khai sucks' endif // // Game buttons. // // Wiimote key.Shift = Wiimote.Up mouse.WheelUp = Wiimote.Left mouse.WheelDown = Wiimote.Right key.e = Wiimote.Down mouse.LeftButton = Wiimote.B Wiimote.Rumble = Wiimote.B mouse.RightButton = Wiimote.A key.q = Wiimote.Minus key.escape = Wiimote.Home key.f = Wiimote.Plus key.One = Wiimote.One // Wiimote.Two handles Battery. // // Nunchuk // key.space = Wiimote.Nunchuk.ZButton key.Ctrl = Wiimote.Nunchuk.CButton // // Reload // if Wiimote.Nunchuk.RawForceY > 60 then key.r = true Wiimote.Rumble = true Wiimote.Led1 = true else key.r = false Wiimote.Led1 = false Wiimote.Rumble = false end if //debug = 'VROOM!' endif Wiimote.leds = 0 // // Battery Check! // // A full battery gives 0xC0 (192) if Wiimote.Two == true then var.Batt = wiimote.Battery / 48 if true then wait 5 seconds // it sends an instruction that tells the Wiimote to actually // send the report. Wiimote.Report15 = 0x80 | Int(wiimote.Rumble) endif // Display the battery level of your wiimote using the four LEDs on the bottom. // Battery level is displayed in four levels increasing to the right, like a cell // phone battery gauge. As the battery gets close to the next level down, the LED // for the current level will blink. debug = "Battery level: " + 100*48*var.Batt/192 + "%" if 0 <= var.Batt <= 0.25 then Wiimote.Leds = 1 wait var.Blink Wiimote.Leds = 0 wait var.Blink elseif 0.25 < var.Batt<=1 then Wiimote.Leds = 1 elseif 1 < var.Batt<=1.25 then Wiimote.Leds = 3 wait var.Blink Wiimote.Leds = 1 wait var.Blink elseif 1.25 < var.Batt<=2 then Wiimote.Leds = 3 elseif 2 < var.Batt<=2.25 then Wiimote.Leds = 7 wait var.Blink Wiimote.Leds = 3 wait var.Blink elseif 2.25 < var.Batt<=3 then Wiimote.Leds = 7 elseif 3 < var.Batt<=3.25 then Wiimote.Leds = 15 wait var.Blink Wiimote.Leds = 7 wait var.Blink elseif 3.25 < var.Batt<=4 then Wiimote.Leds = 15 else Wiimote.Leds = 0 endif endif // Motion 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) // Debug debug = 'Debug: xNunchuk: ' + (Wiimote.Nunchuk.Roll + var.xNunchuk) + ' SpeedY: ' + var.speedY + ' SpeedX: ' + var.speedX