// Counter Strike v1.2 Script by Ethan // http://www.wiipcscripts.fr.nf var.xOffset = 2 var.yOffset = -2 var.zOffset = 4 var.xRot = Wiimote.RawForceX + var.xOffset var.yRot = Wiimote.RawForceY + var.yOffset var.zRot = Wiimote.RawForceZ + var.zOffset // This controls the cursorspeed - set it higher to get faster mouseaction. var.speed = 5 // These settings controls the jittering of the control. If you have very steady // hands, you can lower these settings, if you are a very jittery person // ( like the one in duskwood ) you set the values higher var.xCutoff = 4 var.zCutoff = 4 // Sets the mote straight by using the offset we used as inputs earlier in // the script, and print it out at the debug screen. 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 // The code for making the mouse move. Incorporates mouse x,y to the wiimotes // X,Y,Z system //Mouse Control Script using IR //by vkapadia with much assistance from inio //vkapadia@vkapadia.com // //Calibration: //To calibrate, run this program and put the Wiimote on a flat surface face-up. //Then read the values in the debug line (next to the run button). //Change these values until the debug line reads approx. all zeros. var.xtrim = 6 var.ytrim = -31 var.ztrim = 6 // //Options: var.deadzone = 5 //distance in pixels that you have to move the wiimote in //order for it to register movement. Creates a "dead zone" around the pointer //to make it easier to click. Higher = smoother but less accurate. var.KITTspeed = 100 ms //delay speed for flashing LEDs. higher = slower var.rumble = false //makes the wiimote rumble if you hit the edge of the screen //more options to be added later if wiimote.Up shift = true else shift = false endif if wiimote.Down e = true else e = false endif if wiimote.Left mouse.wheelup = true else mouse.wheelup = false endif if wiimote.Right mouse.wheeldown = true else mouse.wheeldown = false endif key.space = wiimote.A //Mouse Buttons mouse.leftButton = wiimote.B //Plus and Minus //wiimote.One k = wiimote.one //wiimote.Two //LEDs look somewhat like KITT's grill from Knight Rider if 0 = 0 then if var.kitt = 0 then wiimote.Leds = 1 endif if var.kitt = 1 then wiimote.Leds = 3 endif if var.kitt = 2 then wiimote.Leds = 6 endif if var.kitt = 3 then wiimote.Leds = 12 endif if var.kitt = 4 then wiimote.Leds = 8 endif if var.kitt = 5 then wiimote.Leds = 12 endif if var.kitt = 6 then wiimote.Leds = 6 endif if var.kitt = 7 then wiimote.Leds = 3 endif wait var.KITTspeed var.kitt = (var.kitt + 1) % 8 endif var.accx = wiimote.RawForceX + var.xtrim var.accy = wiimote.RawForceY + var.ytrim var.accz = wiimote.RawForceZ + var.ztrim 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 = var.accx + " " + var.accy + " " + var.accz // Setting up the wiimote so that the controls on top of the wiimote works // Here I set the nunchuk so it corresponts with my direction keys. Right = 1 > Wiimote1.Nunchuk.JoyX > 0.5 Left = -1 < Wiimote1.Nunchuk.JoyX < -0.5 down = 1 > Wiimote1.Nunchuk.JoyY > 0.5 up = -1 < Wiimote1.Nunchuk.JoyY < -0.5 // Bind some keys to the mote, you can bind your own. key.B = Wiimote.HOME // Nunchuck r = Wiimote.Nunchuk.CButton ctrl = Wiimote.Nunchuk.ZButton // B for left click and A for right click mouse.LeftButton = Wiimote.B // You can use a combination of keys by adding a + in between, like this - if // you want to bind one of the buttons for SHIFT+Loot. // shift + mouse.RightButton = Wiimote.A // Nothin' like a little rumblin' if wiimote.home = true then wiimote.rumble = true wait 400 ms wiimote.rumble = false endif if wiimote.B = true then wiimote.rumble = true wait 400 ms wiimote.rumble = false endif // Using the leds when pressing the buttons. Almost like having a GF. Wiimote.Led1 = w Wiimote.Led2 = s Wiimote.Led3 = a Wiimote.Led4 = d Wiimote.Led1 = j Wiimote.Led2 = k Wiimote.Led3 = h Wiimote.Led4 = alt+g // Sets the wiimote rotation bindings - for jumping and mounting. // By flicking it upwards, you jump // By flicking it to the side, you mount ( or whatever you bound to alt+g ). // You could probably do an Z rotation too, but that movement is strictly // for watching pr0n.