XBMC Control
From WiiLi
Xbox Media center Control will control XBMC through the network using XBMC's Web server. Your Browser has to be the top window on the pc running glovePIE. This script also has "Script switch" if you want to enable that feature you will need to download the Script switch script and set it up. I hope you enjoy this. Any issues let me know mydarxide (at) g mail (dot) com
// XBMC (Xbox Media Center) Control
// By DarXidE with script contributions from Rhys Legault
// Feel Free to Use, Modify and distribute
//Uses XBMC Web Server to control XBMC
//Web Server must be enabled on XBMC under network settings
//Set Xbox Ip Address to Var.xboxip and set your Internet browsers .exe
//location to var.browser
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
// Controls
// (Navigation "Mode")
// Navigate Dpad
// Select A
// Fullscreen Toggle Home
// B (Parent Dir) +
// Back (Prev Menu) -
// Add To Playlist 1
// View Playlist 2
//
// With B Held
// (Player "Mode")
// Play/Pause B & A
// Volume Down B & -
// Volume Up B & +
// Mute B & Home
// Fast Forward B & 1
// Rewind B & 2
// Hold Button 3 sec
// (Start/Shutdown "Mode")
// Left Click Menu Hold -
// Right Click (shutdown Menu) Hold +
// Launch Browser (on PC) Hold A
// Change to Different GlovePIE Script Hold Home
// Flick Controls
//
// Next Track Flick Right
// Previous Track Flick Left
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//Edit These To Suit Your Setup
//Ip Address For Your Xbox
var.xboxip = "Http://192.168.9.80"
// for file locations use DOS names GolvePIE doesn't like spaces
var.browser = "C:\Progra~1\mozill~1\Firefox.exe"
if !var.Initialize
//File Path to GlovePIE (use DOS names)
var.GlovePIEPath = "C:\GlovePIE030\GlovePIE.exe"
//Make sure script path begins with a dash "-" so script opens running
var.ScriptSwitchPath = "-C:\GlovePIE030\MyScripts\Switch\SS2.PIE"
var.Initialize = true
endif
//hold variables
if !var.init
var.HeldTime = 3s //this is how long to hold buttons to change function
var.init = true
endif
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
//Command Prefix
var.cmd = "/xbmcCmds/xbmcHttp?command="
//Player Commands
var.Play ="Action¶meter=79" //Play
Var.Paus ="Action¶meter=12" //Pause
Var.FF = "Action¶meter=77" //Fast Forward
Var.RW = "Action¶meter=78" //Rewind
Var.Next = "Action¶meter=14" //Next
Var.Prev = "Action¶meter=15" //Previous
var.mute = "Action¶meter=91" //Mute
Var.Volup = "Action¶meter=88" //Volume Up
Var.Voldo = "Action¶meter=89" //Volume Down
//Navigation Commands
Var.sel = "Action¶meter=7" //select item
Var.Pmnu = "Action¶meter=10" //Prev Menu
var.ParD = "Action¶meter=9" //Parent Dir
Var.Disp = "Action¶meter=18" //toggle fullscreen
Var.VPlyl ="Action¶meter=33" //view Playlist
Var.Addpl = "Action¶meter=34" //add to playtlist
//Button Variables
Var.up = "SendKey¶meter=270"
Var.down = "SendKey¶meter=271"
Var.Left = "SendKey¶meter=272"
Var.Right = "SendKey¶meter=273"
var.A = "SendKey¶meter=256"
Var.B = "SendKey¶meter=257"
Var.Y = "SendKey¶meter=259"
Var.X = "SendKey¶meter=258"
Var.start = "SendKey¶meter=274"
Var.Back = "SendKey¶meter=275"
Var.Lclick = "SendKey¶meter=276"
Var.Rclick = "SendKey¶meter=277"
Var.Black = "SendKey¶meter=260"
Var.White = "SendKey¶meter=261"
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
/////////////////
//Button Mappings
/////////////////
//up
if (wiimote.up)then
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.up)
key.Enter = true
key.enter = false
wait 500ms
endif
//down
if (wiimote.down)then
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.down)
key.Enter = true
key.enter = false
wait 500ms
endif
//Left
if (wiimote.left)then
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.left)
key.Enter = true
key.enter = false
wait 500ms
endif
//Right
if (wiimote.right)then
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.right)
key.Enter = true
key.enter = false
wait 500ms
endif
//Add to Playlist
if (wiimote.one)then
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.addpl)
key.Enter = true
key.enter = false
wait 500ms
endif
//View Playlist
if (wiimote.two)then
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.Vplyl)
key.Enter = true
key.enter = false
wait 500ms
endif
///////////
//A Button
///////////
//Select
if Released(Wiimote.A)
if !var.Held
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.sel)
key.Enter = true
key.enter = false
wait 500ms
else
var.Held = false
endif
else
//Launch Browser (on PC) (hold 3 sec)
if Pressed(HeldDown(Wiimote.A, var.HeldTime))
Execute(var.Browser)
var.Held = true
Endif
endif
////////
//Minus
////////
//Previous Menu
if Released(Wiimote.minus)
if !var.Held
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.pmnu)
key.Enter = true
key.enter = false
wait 500ms
else
var.Held = false
endif
else
//Left Click Menu (hold 3 sec)
if Pressed(HeldDown(Wiimote.Minus, var.HeldTime))
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.lclick)
key.Enter = true
key.enter = false
wait 1000ms
var.Held = true
endif
endif
///////
//Plus
///////
//Parent Dir
if Released(Wiimote.plus)
if !var.Held
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.pard)
key.Enter = true
key.enter = false
wait 500ms
else
var.Held = false
endif
else
//Right Click Menu
if Pressed(HeldDown(Wiimote.Plus, var.HeldTime))
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.rclick)
key.Enter = true
key.enter = false
wait 500ms
var.Held = true
endif
endif
///////
//Home
///////
//Display
if Released(Wiimote.home)
if !var.Held
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.Disp)
key.Enter = true
key.enter = false
wait 500ms
else
var.Held = false
endif
else
//Switch Script
if Pressed(HeldDown(Wiimote.home, var.HeldTime))
Execute(var.GlovePIEPath, var.ScriptSwitchPath)
ExitPIE
endif
endif
//////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
///////////////
//Button Combos
///////////////
var.Playpau = 0
//Play
if (wiimote.a and Wiimote.B)then
if (var.playpau = 0) then
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.Play)
key.Enter = true
key.enter = false
var.playpau = 1
wait 500ms
else
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.paus)
key.Enter = true
key.enter = false
var.playpau = 0
wait 500ms
endif
endif
//Volume Up
if (wiimote.Plus and Wiimote.B)then
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.volup)
key.Enter = true
key.enter = false
wait 500ms
endif
//Volume Down
if (wiimote.Minus and Wiimote.B)then
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.voldo)
key.Enter = true
key.enter = false
wait 500ms
endif
//Mute
if (wiimote.home and Wiimote.B)then
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.mute)
key.Enter = true
key.enter = false
wait 500ms
endif
//Fast Forward
if (wiimote.one and Wiimote.B)then
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.FF)
key.Enter = true
key.enter = false
wait 500ms
endif
//Rewind
if (wiimote.two and Wiimote.B)then
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.RW)
key.Enter = true
key.enter = false
wait 500ms
endif
////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//Ultimate Flick Script
//Created by Rhys Legault
PIE.SeqReadGap = 50ms
var.AccelerationThreshold = 1.5
var.ActionGap = 150ms
if var.WiimoteFlick = false
//Flick Wiimote up
if (Wiimote.gy > var.AccelerationThreshold, Wiimote.gy < -var.AccelerationThreshold)
var.WiimoteFlick = true
//
Press(Up)
wait var.HoldKey
Release(Up)
//
wait var.ActionGap
var.WiimoteFlick = false
//Flick Wiimote down
elseif (Wiimote.gy < -var.AccelerationThreshold, Wiimote.gy > var.AccelerationThreshold)
var.WiimoteFlick = true
//
Press(Down)
wait var.HoldKey
Release(Down)
//
wait var.ActionGap
var.WiimoteFlick = false
//Flick Wiimote left
//Previous Track
elseif (Wiimote.gx < -var.AccelerationThreshold, Wiimote.gx > var.AccelerationThreshold)
var.WiimoteFlick = true
//
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.Prev)
key.Enter = true
key.enter = false
wait 500ms
//
wait var.ActionGap
var.WiimoteFlick = false
//Flick Wiimote right
//Next Track
elseif (Wiimote.gx > var.AccelerationThreshold, Wiimote.gx < -var.AccelerationThreshold)
var.WiimoteFlick = true
//
Key.ctrl = true
key.L = true
key.L = false
Key.Ctrl = false
type(Var.xboxip)
type(Var.cmd)
type(Var.Next)
key.Enter = true
key.enter = false
wait 500ms
//
wait var.ActionGap
var.WiimoteFlick = false
endif
endif
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////

