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 

Why this script is not working???

 
Post new topic   Reply to topic    WiiLi.org Forum Index -> GlovePie
View previous topic :: View next topic  
Author Message
hkfuertes



Joined: 16 Feb 2008
Posts: 4

Digg It
PostPosted: Thu Jun 05, 2008 1:07 pm    Post subject: Why this script is not working???

i wana make a foobar2000 script without having it onscreen, it seems to be all ok, but still dont working... can anyone help me, the execute command is not working, i think thats the matter.

Quote:
var.root = "C:\Archivos de programa\foobar2000\foobar2000.exe"
var.playpause = var.root + "/playpause"
var.next = var.root + "/next"
var.prev = var.root + "/prev"
var.rand = var.root + "/rand"
var.show = var.root + "/show"
var.hide = var.root + "/hide"

key.Mute= Wiimote.Home
key.VolumeUp = wiimote.Plus
key.VolumeDown = wiimote.Minus
if Wiimote.Home then
wiimote.Rumble = 1
wait 10 ms
wiimote.rumble = 0
endif

if Wiimote.B then
execute (var.rnd)
wiimote.Rumble = 1
wait 10 ms
wiimote.rumble = 0
endif

if Wiimote.left then
execute (var.prev)
wiimote.Rumble = 1
wait 10 ms
wiimote.rumble = 0
endif

if Wiimote.Plus then
wiimote.Rumble = 1
wait 10 ms
wiimote.rumble = 0
endif

if Wiimote.Minus then
wiimote.Rumble = 1
wait 10 ms
wiimote.rumble = 0
endif

if Wiimote.A then
execute (var.playpause)
wiimote.Rumble = 1
wait 10 ms
wiimote.rumble = 0
endif

if Wiimote.right then
execute (var.next)
wiimote.Rumble = 1
wait 10 ms
wiimote.rumble = 0
endif

if Wiimote.One then
execute (var.hide)
wiimote.Rumble = 1
wait 10 ms
wiimote.rumble = 0
endif
if Wiimote.Two then
execute (var.show)
wiimote.Rumble = 1
wait 10 ms
wiimote.rumble = 0
endif

var.KITTspeed= 0.1

if wiimote.right or wiimote.left or wiimote.A or wiimote.B or wiimote.Plus or wiimote.Minus or wiimote.Home or wiimote.One or wiimote.Two then
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
endif

thankyou all very much
Back to top
View user's profile Send private message
AlMightyBob



Joined: 24 May 2008
Posts: 11

Digg It
PostPosted: Fri Jun 06, 2008 12:42 pm    Post subject:

If var.root is using back slashes then why are your other variables using forward slashes?
Back to top
View user's profile Send private message
hkfuertes



Joined: 16 Feb 2008
Posts: 4

Digg It
PostPosted: Fri Jun 06, 2008 8:29 pm    Post subject:

I took as reference the wiitunes that uses vbs scripts, to make this... Besides qhen y write in run command the value of any variable, it works, but with the wiimote it dosent!!!!

thank you for your answer

Ps: as everyone has notices im spanier, so sorry for my english
Back to top
View user's profile Send private message
AlMightyBob



Joined: 24 May 2008
Posts: 11

Digg It
PostPosted: Fri Jun 06, 2008 11:19 pm    Post subject:

The way you are trying to access the controls would only work in cmd or as part of a shortcut, which is pretty useless.

What you need to do is create keyboard hotkeys for each action that you want in Foobar2000 by going to the preferences:



Then make a new script like this which will be really simple.

Code:
// Play/Pause
Keyboard.Z = wiimote.A
wiimote.Rumble = 1
wait 10 ms
wiimote.rumble = 0


But this won't work if the window isn't onscreen. :/
Back to top
View user's profile Send private message
hkfuertes



Joined: 16 Feb 2008
Posts: 4

Digg It
PostPosted: Tue Jun 10, 2008 1:43 pm    Post subject:

im triyng to use cmd and bat scripts to do so functions, like :
Code:
@echo off
start ..\foobar2000.exe /playpause
end


And then in glovepie :
Quote:
var.root = "C:\Archivos de programa\foobar2000\GlovepieScripts\"
var.playpause = var.root + "PlayPause.bat"
var.next = var.root + "Next.cmd"
var.prev = var.root + "Prev.cmd"
var.rand = var.root + "Rand.cmd"
var.show = var.root + "Show.cmd"
var.hide = var.root + "Hide.cmd"
...

but foobar2000 does not matter what effor i do, it dosen matter.(Smile)
thank you for answer
Back to top
View user's profile Send private message
AlMightyBob



Joined: 24 May 2008
Posts: 11

Digg It
PostPosted: Wed Jun 11, 2008 1:51 am    Post subject:

I messed around with batch files for a while and found that to open foobar2000.exe you need to switch to the correct folder so for the PlayPause.bat you should use:

Code:
cd "C:\Archivos de programa\foobar2000"
foobar2000.exe /playpause
end


The first line switches directory and the second obviously opens the program and executes the desired command.

For the GlovePie script you would use the same as before:

Code:
var.root = "C:\Archivos de programa\foobar2000\GlovepieScripts\"
var.playpause = var.root + "PlayPause.bat"

if wiimote.A then
execute(var.playpause)
endif

...


I've tried it and it works. Smile
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
Page 1 of 1

 
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