Live For Speed

From WiiLi

Jump to: navigation, search
// Live For Speed Script Created by MadCatMk2 (jimsemi[at]hotmail[dot]com)
// Version 1.4

//.....................................................................ChangeLog
// ..It doesn't matter which wiimote is which now
// ..ZL and ZR buttons can be used for changing the view
// ..If You Have Two Wiimotes And Two Classic Controllers, You Can Swap Between Those If You Run Out Of Battery
// ..Two Resolutions Are Now Supported For The LED Warning


// You need a classic controller attached to Any Wiimote (Or Both) for this script
// Shoulder Buttons can be used for shifting gears. When they are pressed, the connected Wiimote's LEDs flash.
// A second wiimote can be used to indicate the moment you have to shift (Look at the end of the script for more)


// SETTING RESOLUTION - "a" is for 1280x1024 - "b" is for 1024x768
var.Resolution = "a"

//..................................................................Seconario 1:
if (wiimote1.HasClassic){

// PPJoy Axes

   PPJoy.Analog0 = Wiimote.Classic.Joy1X
   PPJoy.Analog1 = Wiimote.Classic.Joy1Y
   PPJoy.Analog2 = Wiimote.Classic.Joy2X
   PPJoy.Analog3 = Wiimote.Classic.Joy2Y

// Map Joystick to Keys

   Keyboard.Shift+P = Wiimote.Classic.Minus
   Keyboard.Shift+R = Wiimote.Classic.Plus
   Keyboard.Escape  = Wiimote.Classic.A

   Keyboard.x = Wiimote.Classic.L  //Shift Down
   Keyboard.s = Wiimote.Classic.R  //Shift Up


// Shift Button LEDs

if (Wiimote.Classic.R) {
   Wiimote.Leds = 15
   wait 500 ms
   Wiimote.Leds = 0
}

if (Wiimote.Classic.L) {
   Wiimote.Leds = 15
   wait 500 ms
   Wiimote.Leds = 0
}

// RPM Warning On Wiimote2
// You have to set needle color to BLACK

if (var.Resolution = "a") {
var.hdc = USER32.DLL.GetDC(NULL)
var.pixel = GDI32.DLL.GetPixel(var.hdc, Int(147), Int(879))
USER32.DLL.ReleaseDC(NULL, Int(var.hdc))
debug = '0x'+IntToHex(var.pixel, 6)

if (var.pixel = 000000) {
   wiimote2.leds = 15
   wait 500 ms
wiimote2.leds = 0
}
if (var.Resolution = "b") {
var.hdc = USER32.DLL.GetDC(NULL)
var.pixel = GDI32.DLL.GetPixel(var.hdc, Int(126), Int(655))
USER32.DLL.ReleaseDC(NULL, Int(var.hdc))
debug = '0x'+IntToHex(var.pixel, 6)

if (var.pixel = 000000) {
   wiimote2.leds = 15
   wait 500 ms
wiimote2.leds = 0

Keyboard.W = Wiimote.Classic.ZL
Keyboard.E = Wiimote.Classic.ZR
}
}

//...................................................................Scenario 2:
if (wiimote2.HasClassic){

// PPJoy Axes

   PPJoy.Analog0 = Wiimote2.Classic.Joy1X
   PPJoy.Analog1 = Wiimote2.Classic.Joy1Y
   PPJoy.Analog2 = Wiimote2.Classic.Joy2X
   PPJoy.Analog3 = Wiimote2.Classic.Joy2Y

// Map Joystick to Keys

   Keyboard.Shift+P = Wiimote2.Classic.Minus
   Keyboard.Shift+R = Wiimote2.Classic.Plus
   Keyboard.Escape  = Wiimote2.Classic.A

   Keyboard.x = Wiimote2.Classic.L  //Shift Down
   Keyboard.s = Wiimote2.Classic.R  //Shift Up


// Shift Button LEDs

if (Wiimote2.Classic.R) {
   Wiimote2.Leds = 15
   wait 500 ms
   Wiimote2.Leds = 0
}

if (Wiimote2.Classic.L) {
   Wiimote2.Leds = 15
   wait 500 ms
   Wiimote2.Leds = 0
}

// RPM Warning On Wiimote2 (Well,1)
// You have to set needle color to BLACK

if (var.Resolution = "a") {
var.hdc = USER32.DLL.GetDC(NULL)
var.pixel = GDI32.DLL.GetPixel(var.hdc, Int(147), Int(879))
USER32.DLL.ReleaseDC(NULL, Int(var.hdc))
debug = '0x'+IntToHex(var.pixel, 6)

if (var.pixel = 000000) {
   wiimote1.leds = 15
   wait 500 ms
wiimote1.leds = 0
}
if (var.Resolution = "b") {
var.hdc = USER32.DLL.GetDC(NULL)
var.pixel = GDI32.DLL.GetPixel(var.hdc, Int(126), Int(655))
USER32.DLL.ReleaseDC(NULL, Int(var.hdc))
debug = '0x'+IntToHex(var.pixel, 6)

if (var.pixel = 000000) {
   wiimote1.leds = 15
   wait 500 ms
wiimote1.leds = 0

Keyboard.W = Wiimote2.Classic.ZL
Keyboard.E = Wiimote2.Classic.ZR
}
}
//...........................................................Scenario 3 (Dual):
if (wiimote1.HasClassic || wiimote2.HasClassic){

// PPJoy Axes

   PPJoy.Analog0 = Wiimote1.Classic.Joy1X
   PPJoy.Analog1 = Wiimote1.Classic.Joy1Y
   PPJoy.Analog2 = Wiimote1.Classic.Joy2X
   PPJoy.Analog3 = Wiimote1.Classic.Joy2Y

   PPJoy.Analog0 = Wiimote2.Classic.Joy1X
   PPJoy.Analog1 = Wiimote2.Classic.Joy1Y
   PPJoy.Analog2 = Wiimote2.Classic.Joy2X
   PPJoy.Analog3 = Wiimote2.Classic.Joy2Y

// Map Joystick to Keys

   Keyboard.Shift+P = Wiimote1.Classic.Minus
   Keyboard.Shift+R = Wiimote1.Classic.Plus
   Keyboard.Escape  = Wiimote1.Classic.A

   Keyboard.Shift+P = Wiimote2.Classic.Minus
   Keyboard.Shift+R = Wiimote2.Classic.Plus
   Keyboard.Escape  = Wiimote2.Classic.A


   Keyboard.x = Wiimote1.Classic.L  //Shift Down
   Keyboard.s = Wiimote1.Classic.R  //Shift Up

   Keyboard.x = Wiimote2.Classic.L  //Shift Down
   Keyboard.s = Wiimote2.Classic.R  //Shift Up


// Shift Button LEDs

if (Wiimote.Classic.R) {
   Wiimote.Leds = 15
   wait 500 ms
   Wiimote.Leds = 0
}

if (Wiimote.Classic.L) {
   Wiimote.Leds = 15
   wait 500 ms
   Wiimote.Leds = 0
}
Keyboard.W = Wiimote.Classic.ZL
Keyboard.E = Wiimote.Classic.ZR
}
if (Wiimote2.Classic.R) {
   Wiimote2.Leds = 15
   wait 500 ms
   Wiimote2.Leds = 0
}

if (Wiimote2.Classic.L) {
   Wiimote2.Leds = 15
   wait 500 ms
   Wiimote2.Leds = 0
}
Keyboard.W = Wiimote2.Classic.ZL
Keyboard.E = Wiimote2.Classic.ZR
}
}

End If
End If
Personal tools
Online Casino - best online casino reviews.
Facebook Developers - facebook applications, facebook developers, facebook development, social network application development and viral widget social media strategy