 |
WiiLi.org a new revolution
|
| View previous topic :: View next topic |
| Author |
Message |
HiNtZ
Joined: 27 Dec 2007 Posts: 67
Digg It |
Posted: Sat Jan 12, 2008 2:17 pm Post subject: |
|
|
A simple window switching script which i wrote to make using the wiimote easier when switching windows.
Feel free to edit
Start by holding the wiimote flat, then hold the B button and pitch the wiimote back until the window switcher shows up, as soon as it does put the wiimote flat again whilst still holding B, then use the D-Pad to select which window you want. Once highlighted, release B to open that window.
| Code: |
//Feedback to Lightside55@hotmail.com
//Window Switching
if wiimote.b = true then
key.alt+tab = (Wiimote1.pitch > 20) deg
wait 500 ms
release key.tab
endif
if wiimote.b = false then
release key.alt
endif |
Whilst GlovePIE is running this script, you can't use the original ALT+Tab system on the keyboard.......maybe if you switch the pitch code around, it will work.....but i have no problems with it  |
|
| Back to top |
|
 |
Jayz Facez
Joined: 13 Jan 2008 Posts: 1
Digg It |
Posted: Sun Jan 13, 2008 5:47 am Post subject: |
|
|
This is my first script
It is for Super Mario 64 but it uses the same controls as Super Mario Galaxy
I've also added another feature when you flick the Nunchuk.
Enjoy
| Code: | ////////////////////////////////////////////////////////////////////////////////
// -Super Mario 64- //
// -Super Mario Galaxy- //
// -Controls- //
// //
// -By Jayz Facez- //
// -January 2008- //
////////////////////////////////////////////////////////////////////////////////
//Controls
//Set These keys in your emulator
//A=A
//B=B
//R=R
//Start=S
//Analog Stick=Arrow Keys
//C-Up=Home
//C-Down=End
//C-Left=Delete
//C-Right=Page down
//Special Controls
//Shake the Wiimote to attack (B)
//Flick the Nunchuk up if moving to do a long jump
//Flick the Nunchuk up if standing still to do a high jump (Backflip)
//----------------------------------------------------------------------------//
//SCRIPT
//Debug
debug = "X="+Wiimote.RelAccX+' Y='+Wiimote.RelAccY+' Z='+Wiimote.RelAccZ
//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
//Super Mario Galaxy Style Attack
if (wiimote.RelAccX > 25) or (wiimote.RelAccY > 25) or (wiimote.RelAccZ > 15) then
B = true
wiimote.Rumble = true
wait 60 ms
B = false
wait 240 ms
wiimote.Rumble = false
endif
//LEDS
if (Key.B = 1) or (wiimote1.Nunchuk.RelAccY > 10)
wiimote.Led1 = 1
wait 50ms
wiimote.Led1 = 0
wiimote.Led2 = 1
wait 50ms
wiimote.Led2 = 0
wiimote.Led3 = 1
wait 50ms
wiimote.Led3 = 0
wiimote.led4 = 1
wait 50ms
wiimote.Led4 = 0
wiimote.Led3 = 1
wait 50ms
wiimote.Led3 = 0
wiimote.Led2 = 1
wait 50ms
wiimote.led2= 0
end if
//Controller Mapping
Key.A = Wiimote1.A
Key.Z = Wiimote1.Nunchuk.ZButton
Key.R = Wiimote1.Nunchuk.CButton
Key.End = Wiimote1.Down
Key.Delete = Wiimote1.Left
Key.PageDown = Wiimote1.Right
Key.Home = Wiimote1.Up
Key.S = Wiimote1.Plus
//Auto Long/High Jump
if (wiimote1.Nunchuk.RelAccY > 10)
Key.Z = 1
Wiimote.Rumble = 1
wait 120 ms
Key.A = 1
wait 100 ms
Key.Z = 0
Key.A = 0
wait 100 ms
Wiimote.Rumble = 0
end if
//END
//----------------------------------------------------------------------------//
|
|
|
| Back to top |
|
 |
SuperTrunksz
Joined: 08 Mar 2007 Posts: 1
Digg It |
Posted: Mon Jan 14, 2008 4:35 pm Post subject: |
|
|
SuperTrunksZ' Classic Controller Right Analog to Mouse partial script
Well,someone has already done it,but i made a script where mouse moves ANALOGICAL.
| Code: | //Partial script by SuperTrunksZ
if wiimote1.classic.joy2x < -0.2 or wiimote1.classic.joy2x > 0.2
Mouse.DirectInputX = Mouse.DirectInputX + (30)*(wiimote1.classic.joy2x)
endif
if wiimote1.classic.joy2y < -0.2 or wiimote1.classic.joy2y > 0.2
Mouse.DirectInputy = Mouse.DirectInputy + (30)*(wiimote1.classic.joy2y)
endif
|
|
|
| Back to top |
|
 |
gma
Joined: 15 Jan 2008 Posts: 6
Digg It |
Posted: Tue Jan 15, 2008 3:08 am Post subject: NOLF & Half Life 2 |
|
|
ok Here is my contribution
| Code: | // My first script for N.O.L.F. & Half Life 2
// Just execute & select game, sensitivity & mode
//
// It has two modes: Aim & Mouse use Aim in the game, Mouse while in the menus
// <2> + <1> : To select game. Audio feedback
// <2> + <-> & <+> : To adjust Aim sensitivity
// <2> + <Home> : To toggle between Aim mode and Mouse mode
// <Home> : Escape
// ...
//
// - Requires Sensor Bar
// - The wiimote rumbles for two seconds when it doesn't see the sensor bar anymore
// - Nunchuk for movement:
// - Lean left & right the Nunchuk to peek sideways (NOLF)
//
// - To jump you need to actually jump (or flick the wiimote and Nunchuk simultaneously)
//
// - To crouch you need to physically crouch (or kneel, sit, etc.)
Var.CrouchPosition = 0.2
// - Adjust setting depending on your particular set up, i.e.:
// Height of the Sensor Bar, your height, etc.
// - In NOLF you need to change <C> to crouch, not toggle crouch or use another key
//
// Check out the rest of the commands at the bottom
//
// Tweak to to your hearts desire
// Enjoy!!!
//
// By GMA
Keyboard.RepeatFakeKeys = var.AbsolutePositioning
if Nunchuk.Exists then
var.AccX = Nunchuk.gx
var.AccY = Nunchuk.gy
else
var.AccX = wiimote.gx
var.AccY = wiimote.gy
end if
var.AccZ = wiimote.gz
if starting then
wiimote1.Led1 = 1 // Identify wiimote
if wiimote.Count = 2 then
wiimote2.Led2 = 1
end if
if wiimote.Count = 3 then
wiimote3.Led3 = 1
end if
if wiimote.Count = 4 then
wiimote4.Led4 = 1
end if
end if
if Var.AbsolutePositioning then
debug = Var.Game + ", click <2> <1> to select game. Mode: MOUSE, click <2> <home> to change"
else
debug = Var.Game + ", click <2> <1> to select game. Mode: AIM, click <2> <home> to change. Sensitivity: " + Var.Sensitivity + " (<2> and <-> <+> to adjust)"
end if
if CLicked(wiimote.Two + wiimote.One) or starting then
if Var.Game = "N.O.L.F." then
Var.Game = "Half Life 2"
else
Var.Game = "N.O.L.F."
end if
Say Var.Game
if Var.Game = "N.O.L.F." then
var.Sensitivity = 0.17 // 0.17 for NOLF
else if Var.Game = "Half Life 2" then
var.Sensitivity = 1 // 1 for Half Life 2
end if
end if
if Clicked(wiimote.Two + wiimote.Home) or starting then var.AbsolutePositioning = not var.AbsolutePositioning
if Clicked(wiimote.Two + wiimote.Plus) then var.Sensitivity *= 1.1
if Clicked(wiimote.Two + wiimote.Minus) then var.Sensitivity /= 1.1
if starting then
var.Margin = 1
end if
Var.WiiG = sqr(Wiimote.gx) + sqr(Wiimote.gy) + sqr(Wiimote.gz)
Var.NunG = sqr(Nunchuk.gx) + sqr(Nunchuk.gy) + sqr(Nunchuk.gz)
Space = Var.WiiG > 4 and Var.NunG > 4
if Var.WiiG > 4 and Var.NunG > 4 then
Var.StopTracking = true // don't track when you jump
wait 0.6 s
Var.StopTracking = false
end if
if not Var.StopTracking then
if wiimote.dot1vis or wiimote.dot2vis then
if wiimote.dot1vis and wiimote.dot2vis then
var.DotX = (wiimote.dot1x + wiimote.dot2x) / 2
var.DotY = (wiimote.dot1y + wiimote.dot2y) / 2
Var.Rumble = false
else
if wiimote.dot1vis then
var.DotX = wiimote.dot1x
var.DotY = wiimote.dot1y
else if wiimote.dot2vis then
var.DotX = wiimote.dot2x
var.DotY = wiimote.dot2y
end if
end if
if var.AccX >= .7 and not Nunchuk.Exists then
Var.PY = var.DotX / (1024 - var.Margin * 2)
Var.PX = var.DotY / (768 - var.Margin * 2)
else if var.AccX <= -.7 and not Nunchuk.Exists then
Var.PY = (1024 - var.DotX) / (1024 - var.Margin * 2)
Var.PX = (768 - var.DotY) / (768 - var.Margin * 2)
else
Var.PX = (1024 - var.DotX) / (1024 - var.Margin * 2)
Var.PY = var.DotY / (768 - var.Margin * 2)
end if
var.PX = wiimote.PointerX
var.PY = wiimote.PointerY
var.NextX = screen.Width * Var.PX - var.Margin
var.NextY = screen.Height * Var.PY - var.Margin
Var.KeepRolling = true
if var.AbsolutePositioning then
mouse.cursorposx = var.NextX
mouse.cursorposy = var.NextY
end if
else if Var.KeepRolling and not var.AbsolutePositioning then
Var.Rumble = true
wait 2 seconds
Var.Rumble = false
Var.NextX = screen.Width / 2
Var.NextY = screen.Height / 2
Var.KeepRolling = false
end if
if not var.AbsolutePositioning then
Var.TrackX = Delta(var.NextX)
Var.TrackY = Delta(var.NextY)
if Var.TrackX = 0 then
if Var.NextX > screen.Width * .75 then Var.TrackX = screen.Width * .003
if Var.NextX < screen.Width * .25 then Var.TrackX = -screen.Width * .003
end if
if Var.TrackY = 0 then
if Var.NextY > screen.Height * .75 then Var.TrackY = screen.Height * .003
if Var.NextY < screen.Height * .25 then Var.TrackY = -screen.Height * .003
end if
if Var.TrackX > 0 then Var.TrackX *= var.Sensitivity * sqr(var.NextX / screen.Width)
if Var.TrackX < 0 then Var.TrackX *= var.Sensitivity * sqr(1 - (var.NextX / screen.Width))
if Var.TrackY > 0 then Var.TrackY *= var.Sensitivity * sqr(var.NextY / screen.Height)
if Var.TrackY < 0 then Var.TrackY *= var.Sensitivity * sqr(1 - (var.NextY / screen.Height))
mouse.DirectInputX += Var.TrackX
mouse.DirectInputY += Var.TrackY
end if
end if
if Mouse.LeftButton then
Var.Rumble = true
wait 10 ms
Var.Rumble = false
endif
if Var.Rumble and not var.AbsolutePositioning then
wiimote.Rumble = true
wait 10 ms
wiimote.Rumble = false
wait 10 ms
end if
// Commands
if Var.Game = "N.O.L.F." then
Mouse.RightButton = wiimote.A // to use secondary actions (zooming, auto/semi, silencing, etc)
F = wiimote.Down // Change Ammo
G = wiimote.One // Lift Body
L = wiimote.Two // Light
Q = var.accx >= .7 // lean left
E = var.accx <= -.7 // lean right
C = var.AccZ >= Var.CrouchPosition // Crouch by crouching (not Toggle Crouch) Adjust game accordingly
BackSpace = Nunchuk.CButton
else
E = wiimote.A // to use secondary actions (zooming, auto/semi, silencing, etc)
Q = wiimote.Down // Last gun
G = wiimote.One // Gravitty gun
F = wiimote.Two // Light
'Q = var.accx >= .7 // lean left
'E = var.accx <= -.7 // lean right
Ctrl = var.AccZ >= Var.CrouchPosition // Crouch by crouching (not Toggle Crouch) Adjust game
Mouse.RightButton = Nunchuk.CButton // Secondary Attack
end if
Mouse.LeftButton = wiimote.B // shoot
Key.Escape = wiimote.Home and not wiimote.Two
R = Wiimote.Minus // reload
Mouse.WheelUp = wiimote.Right // plus to cycle through weapons
Mouse.WheelDown = wiimote.Left // plus to cycle through weapons
Z = wiimote.Up // Zoom
LeftShift = Nunchuk.ZButton // to run
W = Nunchuk.JoyY < -.56
S = Nunchuk.JoyY > .56
A = Nunchuk.JoyX < -.56
D = Nunchuk.JoyX > .56
|
|
|
| Back to top |
|
 |
Shakipu
Joined: 15 Jan 2008 Posts: 1
Digg It |
Posted: Tue Jan 15, 2008 10:54 am Post subject: |
|
|
I saw that there is a script for Mario Tennis but note like Tennis in WiiSports so I did a script for that : it is my first script and you can play with two players. You need a Wiimote and a Nunchuk.
//Variable for the localisation of the Wiimote
var.yOffset=0
//Variable for the movement of the Wiimote1
var.yRot1=Wiimote1.RawAccy+var.yOffset
//Buttons for the player 1. You need to put these options in
//Project 64 with the keyboard :
//A=Q Move the Wiimote like a Racket for the button A
//B=B Press B and move the Wiimote for the button B
//Up=Up }
//Down=Down } Use the joystick of the nunchuk
//Right=Right }
//Left=Left }
//Start=enter Press Home for the button Start
//L=L Press the Left of the Wiimote for the button L
//R=R Press the Right of the Wiimote for the button R
//If you want to change the sensibility of the Wiimote1, change the
//number "25" in a number between 12.5 and 50
Q=var.yRot1>25 && Wiimote1.B=0
B=var.yRot1>25 && Wiimote1.B=1
Up=Wiimote1.Nunchuk.JoyY<-0.5
Down=Wiimote1.Nunchuk.JoyY>0.5
Right=Wiimote1.Nunchuk.JoyX>0.5
Left=Wiimote1.Nunchuk.JoyX<-0.5
enter=Wiimote1.Home
L=Wiimote1.Left
R=Wiimote1.Right
//For the rumble of the Wiimote1. Erase it if you don't want it.
If (var.yRot1>25) then
Wiimote1.Rumble=TRUE
Wait 0.2 s
Wiimote1.Rumble=FALSE
Endif
//Variable for the movement of the Wiimote
var.yRot2=Wiimote2.RawAccy+var.yOffset
//Buttons for the player 2. You need to put these options in
//Project 64 with the keyboard :
//A=V Move the Wiimote like a Racket for the button A
//B=N Press B and move the Wiimote for the button B
//Up=W }
//Down=S } Use the joystick of the nunchuk
//Right=D }
//Left=A }
//Start=enter Press Home for the button Start
//L=X Press the Left of the Wiimote for the button L
//R=C Press the Right of the Wiimote for the button R
//If you want to change the sensibility of the Wiimote1, change the
//number "25" in a number between 12.5 and 50
V=var.yRot2>25 && Wiimote2.B=0
N=var.yRot2>25 && Wiimote2.B=1
W=Wiimote2.Nunchuk.JoyY<-0.5
S=Wiimote2.Nunchuk.JoyY>0.5
D=Wiimote2.Nunchuk.JoyX>0.5
A=Wiimote2.Nunchuk.JoyX<-0.5
enter=Wiimote2.Home
X=Wiimote2.Left
C=Wiimote2.Right
//For the rumble of the Wiimote. Erase it if you don't want it.
If (var.yRot2>25) then
Wiimote2.Rumble=TRUE
Wait 0.2 s
Wiimote2.Rumble=FALSE
Endif
|
|
| Back to top |
|
 |
katznet
Joined: 18 Jan 2008 Posts: 1
Digg It |
Posted: Fri Jan 18, 2008 1:46 pm Post subject: |
|
|
// this is the code for the N64 emulator, project 64 this uses 2 wiimotes and
// no nunckuck the gontroller setup on the emulator is as follows
// analog stick L = a u= w r= d d= s
// buttons a = / b = . s = enter l = n r = m z = z
// digital L = left R = right U = up D = down
// C stick l = j r = L u = i d = k
//
Key.A = Wiimote1.Left
Key.S = Wiimote1.Down
Key.D = Wiimote1.Right
Key.W = Wiimote1.Up
Key.Dot = Wiimote2.B
Key.Slash = Wiimote2.A
Key.Up = Wiimote2.up
Key.Down = Wiimote2.down
Key.Left = Wiimote2.left
Key.Right = Wiimote2.right
Key.I = MapRange(Wiimote1.gz, 3,10, 0,1)
Key.K = MapRange(Wiimote1.gz, -3,-10, 0,1)
Key.J = MapRange(Wiimote1.gx, 2,9, 0,1)
Key.L = MapRange(Wiimote1.gx, -2,-9, 0,1)
Key.N = Wiimote1.a
Key.M = Wiimote1.b
Key.Z = Wiimote2.Home
Key.Enter = Wiimote1.Home |
|
| Back to top |
|
 |
holytomaho
Joined: 23 Jan 2008 Posts: 1
Digg It |
Posted: Wed Jan 23, 2008 11:35 am Post subject: can someone help me debugs this |
|
|
Can some one plxz help me debug my script the analog stick is super sensetive oh and its for a classic controll so i would be very happy if someone could debug this
key.A = true
key.A = false
key.A = Wiimote.Classic.A
endif
key.B = true
key.B = false
key.B = Wiimote.Classic.B
endif
key.T = true
key.T = false
key.T = Wiimote.Classic.Y
endif
key.A = true
key.A = false
key.A = Wiimote.Classic.A
endif
key.o = true
key.o = false
key.o = Wiimote.Classic.L
endif
key.M = true
key.M = false
key.M = Wiimote.Classic.R
endif
key.T = true
key.T = false
key.T = Wiimote.Classic.ZR
endif
key.S = Wiimote.classic.Plus
endif
if wiimote.Up
Up = true
else
Up = false
endif
if wiimote.Down
Down = true
else
Down = false
endif
if wiimote.Left
Left = true
else
Left = false
endif
if wiimote.Right
Right = true
else
Right = false
endif
key.D = Wiimote.Classic.RawJoy1X <= -35%
key.G = Wiimote.Classic.RawJoy1X >= 35%
key.R = Wiimote.Classic.RawJoy1Y <= -35%
key.F = Wiimote.Classic.RawJoy1Y >= 35%
endif
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 |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|