WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

A script ive been working on, need help.
Goto page Previous  1, 2
 
Post new topic   Reply to topic    WiiLi.org Forum Index -> GlovePie
View previous topic :: View next topic  
Author Message
Jehd



Joined: 26 Aug 2008
Posts: 3

Digg It
PostPosted: Wed Aug 27, 2008 10:08 am    Post subject:

Thanks, but ... it doesn't work : I can only have w and a
All codes I wrote are cancelled when I run yours

This is my code, can you replace this part :
Code:
/* The following is for turning wii button presses into keyboard presses and mouse clicks */
// WASD for fsp games
w = wiimote.Nunchuk.JoyY
s = wiimote.Nunchuk.JoyY
a = wiimote.Nunchuk.JoyX
d = wiimote.Nunchuk.JoyX

By your code please ?
Code:

    /* NOTE for this code to work right with the wiimote please
   read the following                                      */

// When configuring the offsets please put the wiimote flat and do not move it.
// These are offsets change them so that your debug output reads 0,28,0
// The debug output is at the top of this window.
// Ex if you get -7,33,-6 then change the offsets to 7,-5,6
var.xOffset = 0
var.yOffset = 0
var.zOffset = 0


// Change this if you would like your mouse to go faster
var.speed = 1

// change these to a higher number if your hands are not steady or lower if they are
var.xCutoff = 4
var.zCutoff = 4


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

// This is the code that moves your 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)

/* The following is for turning wii button presses into keyboard presses and mouse clicks */
// WASD for fsp games
w = wiimote.Nunchuk.JoyY
s = wiimote.Nunchuk.JoyY
a = wiimote.Nunchuk.JoyX
d = wiimote.Nunchuk.JoyX

// Press 1 on the wiimote to press e on the keyboard
, = Wiimote. One
// Press 2 on the wiimote to press control on the keyboard
; = Wiimote.Two

// B for left click and A for right click
mouse.LeftButton = Wiimote.B
mouse.RightButton = Wiimote.A

// Plus and Minus on the wiimote to use the scroll wheel
// get for scrolling though weapens in fsp games
mouse.WheelUp = Wiimote.Plus
mouse.WheelDown = Wiimote.Minus


// Rumbles wiimote when shift is pressed on your keyboard
Wiimote.Rumble = Shift

// Have some fun and press 1, 2, 3, and/of 4 to little up the lights on the wiimote
Wiimote.Led1 = four
Wiimote.Led2 = three
Wiimote.Led3 = two
Wiimote.Led4 = one

space = wiimote.Nunchuk.CButton

ctrl = wiimote.Nunchuk.ZButton

e = wiimote.Down

g = wiimote.Up

t = wiimote.Left

If Mouse.LeftButton then
   wiimote.Rumble = true
      wait 10 ms
   wiimote.Rumble = false
End If
Back to top
View user's profile Send private message
Maxadam5



Joined: 23 May 2008
Posts: 39

Digg It
PostPosted: Wed Aug 27, 2008 3:38 pm    Post subject:

here you go, but i would strongly recommend spending the extra 15 bucks on a wireless sensor bar or just make one for like 10 bucks it really makes playing fps's with a wiimote 100 times better just google search it

Code:

    /* NOTE for this code to work right with the wiimote please
   read the following                                      */

// When configuring the offsets please put the wiimote flat and do not move it.
// These are offsets change them so that your debug output reads 0,28,0
// The debug output is at the top of this window.
// Ex if you get -7,33,-6 then change the offsets to 7,-5,6
var.xOffset = 0
var.yOffset = 0
var.zOffset = 0


// Change this if you would like your mouse to go faster
var.speed = 1

// change these to a higher number if your hands are not steady or lower if they are
var.xCutoff = 4
var.zCutoff = 4


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

// This is the code that moves your 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)

/* The following is for turning wii button presses into keyboard presses and mouse clicks */
// WASD for fsp games
if nunchuk.joyy > .2
   Keyboard.S = 1
else if nunchuk.joyy < -.2
     Keyboard.W = 1
else
     Keyboard.S = 0
     Keyboard.W = 0
endif
if nunchuk.joyx > .2
   Keyboard.D = 1
else if nunchuk.joyx < -.2
     Keyboard.A = 1
else
     Keyboard.D = 0
     Keyboard.A = 0
endif

// Press 1 on the wiimote to press e on the keyboard
key.E= Wiimote. One
// Press 2 on the wiimote to press control on the keyboard
key.E = Wiimote.Two

// B for left click and A for right click
mouse.LeftButton = Wiimote.B
mouse.RightButton = Wiimote.A

// Plus and Minus on the wiimote to use the scroll wheel
// get for scrolling though weapens in fsp games
mouse.WheelUp = Wiimote.Plus
mouse.WheelDown = Wiimote.Minus


// Rumbles wiimote when shift is pressed on your keyboard
Wiimote.Rumble = Shift

// Have some fun and press 1, 2, 3, and/of 4 to little up the lights on the wiimote
Wiimote.Led1 = four
Wiimote.Led2 = three
Wiimote.Led3 = two
Wiimote.Led4 = one

space = wiimote.Nunchuk.CButton

ctrl = wiimote.Nunchuk.ZButton

e = wiimote.Down

g = wiimote.Up

t = wiimote.Left

If wiimote.B then
   wiimote.Rumble = true
   wait 10 ms
   wiimote.Rumble = false
End If

_________________
[img]C:\Users\Adam\Desktop\my sig.swf[/img]
Back to top
View user's profile Send private message
Jehd



Joined: 26 Aug 2008
Posts: 3

Digg It
PostPosted: Thu Aug 28, 2008 7:42 pm    Post subject:

Thaaaaaaaaaaaaaaaanks it works ^^
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> GlovePie All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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