 |
WiiLi.org a new revolution
|
| View previous topic :: View next topic |
| Author |
Message |
wiimouse1
Joined: 28 Mar 2008 Posts: 2
Digg It |
Posted: Sat Mar 29, 2008 12:59 am Post subject: |
|
|
Ended up making one myself. Here is the Wiimote script for PowerPoint presentation:
| Code: | if (wiimote.Up) then
if (helddown(wiimote.Up, 100 ms)) then
mouse.DirectInputY -= 10
else
mouse.DirectInputY -= 5
endif
endif
if (wiimote.Down) then
if (helddown(wiimote.Down, 100 ms)) then
mouse.DirectInputY += 10
else
mouse.DirectInputY += 5
endif
endif
if (wiimote.Left) then
if (helddown(wiimote.Left, 100 ms)) then
mouse.DirectInputX -= 10
else
mouse.DirectInputX -= 5
endif
endif
if (wiimote.Right) then
if (helddown(wiimote.Right, 100 ms)) then
mouse.DirectInputX += 10
else
mouse.DirectInputX += 5
endif
endif
key.Space = wiimote.Plus
key.BackSpace = wiimote.Minus |
|
|
| Back to top |
|
 |
Dr. Dos
Joined: 29 Dec 2007 Posts: 3
Digg It |
Posted: Sat Mar 29, 2008 7:51 am Post subject: |
|
|
And I have too much free time, behold my Morse code translator.
| Code: |
//Wiimote Morse Code Translator
//a completely useless program by Dr. Dos
//CONTROLS
//Plus or Z ------- Turn on Transmission Mode
//Minus or X ------- Turn off Transmission Mode
//A or . ------- Send a DOT
//B or - ------- Send a DASH
//
//A solid first LED means you are in transmission mode
//The other 3 lights indicate how long you have to input a dot or dash
//If the timer for inputting a dot/dash expires, a letter should be placed in debug
//If the timer expries and you haven't made any input at all an underscore is placed
//debug = var.trans + "/" + var.timer + "/" + var.message
if (Wiimote.Exists and var.trans=false) {
Wiimote.Led1= true
wait 250ms
Wiimote.Led1=false
wait 250ms
}
//Transmit OFF
if ((key.x==true) or (Wiimote.Minus=true)) {
var.trans = false
}.
//Transmit ON
if ((key.Z==true) or (Wiimote.Plus=true)) {
var.trans = true
var.message = 1
var.timer=50
var.semichars=0
}
if (var.trans = true) {
wiimote.Led1=true.
var.timer=var.timer - 1
}
if (var.timer >30) {
Wiimote.Led4 = false
Wiimote.Led2 = false
Wiimote.Led3 = false
}
if (var.timer <30) {
Wiimote.Led2 = true
}
if (var.timer <20) {
Wiimote.Led3 = true
}
if (var.timer <10) {
Wiimote.Led4 = true
}
if ((key.Dot = true) or (Wiimote.A=true)) {
var.message = (var.message * 10) + 3
var.semichars = var.semichars+1
Wiimote.Frequency = 50
wait 50ms.
Wiimote.Frequency = 0
wait 50ms
var.timer=50
}
if ((key.Minus = true) or (Wiimote.B=true)) {
var.message = (var.message * 10) + 2
var.semichars = var.semichars+1
Wiimote.Frequency = 100
wait 100ms.
Wiimote.Frequency = 0
var.timer=50
}
//Timer expires, process semichars as character
if ((var.timer < 1) or (var.semichars >=5 )) {
//Check for each possible letter! DOTS ARE 3, DASHES ARE 2..
if (var.message == 12) {
debug=debug + "T"
}
if (var.message == 122) {
debug=debug + "M"
}
if (var.message == 1222) {
debug=debug + "O"
}
if (var.message == 1223) {
debug=debug + "G"
}
if (var.message == 12232) {
debug=debug + "Q"
}
if (var.message == 12233) {
debug=debug + "Z"
}
if (var.message == 123) {
debug=debug + "N"
}
if (var.message == 1232) {
debug=debug + "K"
}
if (var.message == 1233) {
debug=debug + "D"
}
if (var.message == 12322) {
debug=debug + "Y"
}
if (var.message == 12323) {
debug=debug + "C"
}
if (var.message == 12332) {
debug=debug + "X"
}
if (var.message == 12333) {
debug=debug + "B"
}
if (var.message == 13) {
debug=debug + "E"
}
if (var.message == 132) {
debug=debug + "A"
}
if (var.message == 133) {
debug=debug + "I"
}
if (var.message == 1322) {
debug=debug + "W"
}
if (var.message == 1323) {
debug=debug + "R"
}
if (var.message == 13222) {
debug=debug + "J"
}
if (var.message == 13223) {
debug=debug + "P"
}
if (var.message == 13233) {
debug=debug + "L"
}
if (var.message == 1332) {
debug=debug + "U"
}
if (var.message == 1333) {
debug=debug + "S"
}
if (var.message == 13323) {
debug=debug + "F"
}
if (var.message == 13332) {
debug=debug + "V"
}
if (var.message == 13333) {
debug=debug + "H"
}
if ((var.message == 1) and (var.semichars == 0)) {
debug=debug + "_"
var.message = 1
}
var.timer=50
var.message = 1
var.semichars = 0
}
}
|
|
|
| Back to top |
|
 |
jjcomet
Joined: 23 Apr 2007 Posts: 87
Digg It |
Posted: Tue Apr 01, 2008 9:48 am Post subject: fairly good invisible keyboard |
|
|
here's a script that turns the wiimote into an invisible xylophone/marimba/keyboard; moving left descends the scale/moving right, ascends; not yet perfect, some repeated notes occur
| Code: |
midi.DeviceOut=2//choose your own midi out
debug=var.note
PIE.SeqReadGap=50ms
//start at 36
if var.note=0
var.note=(var.note)+36
endif
//right motion and not down
if (var.right=false)&&(var.left=false)&¬(Wiimote.gy <-0.1, Wiimote.gy >1)
if pressed((Wiimote.gx >0.2, Wiimote.gx <-1))
var.right=true
var.note++
if (var.note==30)or(var.note==32)or(var.note==34)or(var.note==37)or(var.note==39)or(var.note==42)or(var.note==44)or(var.note==46)or(var.note==49)or(var.note==51)//all on one line
var.note++
endif
wait 100ms
var.right=false
endif
endif
//left motion and not down
if (var.left=false)&&(var.right=false)&¬(Wiimote.gy <-0.1, Wiimote.gy >1)
if pressed((Wiimote.gx <-0.1, Wiimote.gx >1))
var.left=true
var.note--
if (var.note==30)or(var.note==32)or(var.note==34)or(var.note==37)or(var.note==39)or(var.note==42)or(var.note==44)or(var.note==46)or(var.note==49)or(var.note==51)
var.note--
endif
wait 100ms
var.left=false
endif
endif
//down flick
if (var.flick=false)
if pressed((Wiimote.gy <-0.15, Wiimote.gy >1.2))
var.flick=true
midi.FirstNote=-1
midi.FirstNote=var.note
wait 100ms
var.flick=false
endif
if pressed(var.flick=true)
wiimote.Leds=15
wait 350ms
wiimote.Leds=0
endif
endif
|
|
|
| Back to top |
|
 |
kappa
Joined: 11 Apr 2008 Posts: 12
Digg It |
Posted: Fri Apr 11, 2008 4:41 pm Post subject: |
|
|
hi if i can ask just quick question... how do i make my mouse cursor go to the center of screen when i press wimote.A and wimote.B together ?? _________________ xfire: bulletdeal |
|
| Back to top |
|
 |
Revolution
Joined: 13 Apr 2008 Posts: 1
Digg It |
Posted: Sun Apr 13, 2008 2:41 am Post subject: |
|
|
Hey I found out about GlovePIE 2 days ago and decided to make some script.
| Code: |
// Wiimote mouse script and nunchuk for Windows desktop
// Requires a sensor bar
// I took some of the script from the IRmouse that comes with GlovePIE
// And added the rest
var.ButtonFreezeTime = 250ms
var.PointerBump = KeepDown(Pressed(wiimote.A),var.ButtonFreezeTime) or KeepDown(Pressed(wiimote.B),var.ButtonFreezeTime)
Wiimote.Led1 = true
Wiimote.Led3 = true
// Mouse movement
if wiimote.PointerVisible but not var.PointerBump then
mouse.x = wiimote.PointerX
mouse.y = wiimote.PointerY
end if
// Mouse Buttons
mouse.LeftButton = Wiimote.A and KeepDown(Wiimote.PointerVisible,0.5s)
mouse.RightButton = Wiimote.B and KeepDown(Wiimote.PointerVisible,0.5s)
mouse.MiddleButton = Wiimote.Home and KeepDown(Wiimote.PointerVisible,0.5s)
mouse.XButton1 = Wiimote.Minus
mouse.XButton2 = Wiimote.Plus
// keyboard movements
keyboard.right = Wiimote.right
keyboard.left = Wiimote.left
keyboard.enter = Wiimote.one
keyboard. backspace = Wiimote.two
keyboard. spacebar = Wiimote.A and Wiimote.B
// This highlights what ever program on your desktop you used last. so you can execute them with the 1 button
keyboard.Home = Wiimote.Home
// Mouse Wheel
if wiimote.Up then
mouse.WheelUp = true
wait 30ms
mouse.WheelUp = false
wait 30ms
end if
if wiimote.Down then
mouse.WheelDown = true
wait 30ms
mouse.WheelDown = false
wait 30ms
end if
Right = 1 > Wiimote1.Nunchuk.JoyX > 0.5
Left = -2 < Wiimote1.Nunchuk.JoyX < -0.10
down = 1 > Wiimote1.Nunchuk.JoyY > 0.5
up = -1 < Wiimote1.Nunchuk.JoyY < -0.5
//These are just for playing Flash or Java games on the web just change them to whatever buttons the game uses.
if Wiimote.Nunchuk.CButton {
Z = True
wait 5 ms
Z = False
}
if Wiimote.Nunchuk.ZButton {
S = True
wait 5 ms
S = False
} |
|
|
| Back to top |
|
 |
Daxter
Joined: 16 Apr 2008 Posts: 2
Digg It |
Posted: Wed Apr 16, 2008 6:21 pm Post subject: Lylat Wars Script |
|
|
Here's my first script
| Code: | //Lylat Wars: Star Fox 64 - by Daxter
//Supporting 2 different Control Modes
//Feel free to modify!
//
//If you're using Project 64, set controls to default with PPjoy axes as
//Analog Stick. In Normal Mode, just hold the Wiimote like always
//and in Sideways Mode,hold it like Excite Truck.
//Switch to Sideways Mode with + and to Normal Mode with -.
//
//Remaining Controls:
//Normal Mode | Sideways Mode | Function
//2 | B | Laser
//1 | A | Bomb
//Right | Up | Accelerate
//Left | Down | Brake
//Up | Left | Tilt Left/Roll Left
//Down | Right | Tilt Right/Roll Right
//A | 1 | 1st Person/3rd Person
//B | 2 | Accept Messages
//
//In Menu, hold B to use the D-pad.
//Switching
if Wiimote.Plus and (not var.Sideways)
Say("Sideways Mode")
var.Sideways = true
var.Normal = false
endif
if Wiimote.Minus and (not var.Normal)
Say("Normal Mode")
var.Normal = true
var.Sideways = false
endif
//Normal Mode
if var.Normal
PPJoy1.Analog1 = Wiimote1.Pitch / 20
PPJoy1.Analog0 = Wiimote1.Roll /30
X = Wiimote.B
C = Wiimote.A
PageDown = Wiimote.One
Home = Wiimote.Two
Delete = Wiimote.Up
S = Wiimote.Right
Z = Wiimote.Left
End = Wiimote.Down
Enter = Wiimote.Home
if (Wiimote.Right and Wiimote.B)
PPJoy1.Analog0 = 1
else if (Wiimote.Left and Wiimote.B)
PPJoy1.Analog0 = -1
else if (Wiimote.Up and Wiimote.B)
PPJoy1.Analog1 = 1
else if (Wiimote.Down and Wiimote.B)
PPJoy1.Analog1 = -1
endif
endif
//Sideways Mode
if var.Sideways
PPJoy1.Analog0 = Wiimote1.Pitch / 20
PPJoy1.Analog1 = -Wiimote1.Roll /30
X = Wiimote.Two
C = Wiimote.One
PageDown = Wiimote.A
Home = Wiimote.B
Enter = Wiimote.Home
Delete = Wiimote.Right
S = Wiimote.Down
Z = Wiimote.Up
End = Wiimote.Left
if (Wiimote.Down and Wiimote.B)
PPJoy1.Analog0 = 1
else if (Wiimote.Up and Wiimote.B)
PPJoy1.Analog0 = -1
else if (Wiimote.Left and Wiimote.B)
PPJoy1.Analog1 = 1
else if (Wiimote.Right and Wiimote.B)
PPJoy1.Analog1 = -1
endif
endif
|
|
|
| Back to top |
|
 |
Darkpower
Joined: 20 Apr 2008 Posts: 2
Digg It |
Posted: Sun Apr 20, 2008 2:55 am Post subject: |
|
|
Here is one of my first scripts. It’s for the online game Rumble fighter.
I took parts of the Mouse script for the wiimote so you can move your mouse in game.
YOU MIGHT have to set up your controls in game or in the script the controls are set by default.
| Code: | //Written by Darkpower
//V.01
//Rumble fighter
//It has some small bugs that I need to fix
//Character down movement
//Sometimes slow response
//Any other bugs found is appreciated
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
Up = wiimote.Up
Down = wiimote.Down
Left = wiimote.Left
Right = wiimote.Right
if Wiimote.home
if doubleclicked(Wiimote.home)
ExitPie
else
wait 200 ms
ExitProgram
endif
endif
var.trimx = 6
var.trimy = -31
var.trimz = 6
Key.space = wiimote.A
Key.b = Wiimote.2
Key.v = Wiimote.1
Key.c = Wiimote.nunchuk.zbutton
Key.x = wiimote.Nunchuk.Cbutton
Key.z = Wiimote.B
Mouse.LeftButton = Wiimote.minus
up and c = wiimote.up
left and x = wiimote.Left
right and x = wiimote.Right
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 100 ms
var.kitt = (var.kitt + 1) % 8
endif
if Wiimote.B then
if var.rmbl = false
wiimote.Rumble = 1
wait 50 ms
wiimote.Rumble = 0
endif
var.rmbl = true
else
var.rmbl = false
endif
var.x = Wiimote.RawForceX + var.trimx
var.y = Wiimote.RawForceY + var.trimy
var.z = Wiimote.RawForceZ + var.trimz
var.sense0 = 1000
var.thresh0x = 2
var.thresh0y = 1
var.sense = 300
var.threshx = 10
var.threshy = 5
var.sense2 = 100
var.thresh2x = 15
var.thresh2y = 8
var.sense3 = 50
var.thresh3x = 20
var.thresh3y = 12
if var.x > var.thresh0x
mouse.x = mouse.x - 1/var.sense0
endif
if var.x < -var.thresh0x
mouse.x = mouse.x + 1/var.sense0
endif
if var.z > var.thresh0y
mouse.y = mouse.y - 1/var.sense0
endif
if var.z < -var.thresh0y
mouse.y = mouse.y + 1/var.sense0
endif
if var.x > var.threshx
mouse.x = mouse.x - 1/var.sense
endif
if var.x < -var.threshx
mouse.x = mouse.x + 1/var.sense
endif
if var.z > var.threshy
mouse.y = mouse.y - 1/var.sense
endif
if var.z < -var.threshy
mouse.y = mouse.y + 1/var.sense
endif
if var.x > var.thresh2x
mouse.x = mouse.x - 1/var.sense2
endif
if var.x < -var.thresh2x
mouse.x = mouse.x + 1/var.sense2
endif
//yaxis
if var.z > var.thresh2y
mouse.y = mouse.y - 1/var.sense2
endif
if var.z < -var.thresh2y
mouse.y = mouse.y + 1/var.sense2
endif
if var.x > var.thresh3x
mouse.x = mouse.x - 1/var.sense3
endif
if var.x < -var.thresh3x
mouse.x = mouse.x + 1/var.sense3
endif
if var.z > var.thresh3y
mouse.y = mouse.y - 1/var.sense3
endif
if var.z < -var.thresh3y
mouse.y = mouse.y + 1/var.sense3
endif
debug = var.x + " " + var.y + " " + var.z |
|
|
| 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
|