/* Zelda: Ocarina of Time with Nunchuk, Battery Meter, and PJ64 Control - BMH version 1.1. Written by BMH (based on Kunal Khiyani & vkapadia scripts) Edited by Jeshua */ // // Set your emulator to these values: // Analog Stick = Up, Down, Left, and Right Arrow Keys // Start = S // Z-Button = z // R-Button = r // A-Button = a // B-Button = b // L-Button = l // C-Up = NUMPAD8 // C-Down = NUMPAD5 // C-Left = NUMPAD4 // C-Right = NUMPAD6 // // // CONTROLS: // // Wiimote: // // Shake the wiimote = use sword // D-pad = C buttons / Alt. PJ64 Control // A = A (blue button/ context sensitive button) / Alt. Moon Jump/Map // B trigger = Use shield // Minus = Green button (skip text/navigate through menus) // Home = Nothing // Plus = Start (/red button in menus) // 1 = Start // 2 = Moon Jump/Map // // Nunchuk: // // Shake the nunchuk = spin attack // Analoge stick = movement // C = Activate Alternates // Z = Z-targeting /* Backup script clips // Nunchuk movement: if 2 > Wiimote1.Nunchuk.JoyX > 0.5 then Right = true wait 60 ms Right = false endif if -2 < Wiimote1.Nunchuk.JoyX < -0.5 then left = true wait 60 ms left = false endif if 2 > Wiimote1.Nunchuk.JoyY > 0.5 then down = true wait 60 ms down = false endif if -2 < Wiimote1.Nunchuk.JoyY < -0.5 then up = true wait 60 ms up = false endif */ // Spin attack (needs work/Fail rate is too high) if (wiimote.Nunchuk.RawAccX > 20) then up = true wait 10 ms left = true wait 10 ms up = false wait 10 ms down = true wait 10 ms left = false wait 10 ms right = true wait 10 ms down = false wait 10 ms up = true wait 10 ms right = false B = true wait 10 ms B and up = false wait 600 ms wiimote.Rumble = false endif /* Modifying to work with battery script better // LEDs & rumble during spin attack if (wiimote.Nunchuk.RawAccX > 20) then wait 90 ms wiimote.Rumble = true wait 20 ms Wiimote.Led1 = 1 wait 75 ms Wiimote.Led2 = 1 wait 75 ms Wiimote.Led3 = 1 wait 75 ms Wiimote.Led4 = 1 wait 75 ms Wiimote.Led1 = 0 wait 75 ms Wiimote.Led2 = 0 wait 75 ms Wiimote.Led3 = 0 wait 75 ms Wiimote.Led4 = 0 wait 75 ms wiimote.Rumble = false endif */ // Nunchuck controls Z = wiimote.Nunchuk.ZButton // Z-Target/Focus if Wiimote.Nunchuk.CButton then F5 = Wiimote.Up // Save F7 = Wiimote.Down // Restore F2 = Wiimote.Left // Pause F12 = Wiimote.Right // End Emulation L = Wiimote.A // Moon Jump/Map else NUMPAD8 = Wiimote.Up // C-Up NUMPAD4 = Wiimote.Left // C-Left NUMPAD6 = Wiimote.Right // C-Right NUMPAD5 = Wiimote.Down // C-Down L = Wiimote.Two // Moon Jump/Map endif /* if Wiimote.Nunchuk.Cbutton then // Nunchuk movement: if 2 > Wiimote1.RawAccX > 0.5 then Right = true; wait 60 ms; Right = false; endif if -2 < Wiimote1.RawAccX < -0.5 then left = true wait 60 ms left = false endif if 2 > Wiimote1.RawAccY > 0.5 then down = true wait 60 ms down = false endif if -2 < Wiimote1.RawAccY < -0.5 then up = true wait 60 ms up = false endif else */ // Nunchuk movement: if 2 > Wiimote1.Nunchuk.JoyX > 0.5 then Right = true wait 60 ms Right = false endif if -2 < Wiimote1.Nunchuk.JoyX < -0.5 then left = true wait 60 ms left = false endif if 2 > Wiimote1.Nunchuk.JoyY > 0.5 then down = true wait 60 ms down = false endif if -2 < Wiimote1.Nunchuk.JoyY < -0.5 then up = true wait 60 ms up = false endif //endif // Wiimote controls: S = wiimote.Plus b = wiimote.Minus r = wiimote.b a = Wiimote.A S = wiimote.One // Swordfighting if (wiimote.RelAccX > 25) or (wiimote.RelAccY > 25) or (wiimote.RelAccZ > 15) then B = true wiimote.Rumble = true wait 60 ms B = false wait 100 ms wiimote.Rumble = false endif //A full battery gives 0xC0 (192) 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) end if //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. //Blink rate var.Blink = 500ms 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