Yep, fair enough.
Couch spuds rule!!
Here's a script I have just knocked up - it's untested I'm afraid, as I am literally being dragged out of the door at this moment to go on holiday, but here it is:
CODE
import xbmcgui, xbmc
from re import search, DOTALL
from string import split, replace
from os.path import getsize
from socket import *
# GET ACTIONCODES FROM KEYMAP.XML
ACTION_SELECT_ITEM = 7
# THE PATH TO BACKGROUND IMAGE
background = "q:\\scripts\\shutdownremote\\background.png"
s = socket(AF_INET, SOCK_STREAM)
class CShutdown:
def __init__(self):
self.addControl(xbmcgui.ControlImage(0,0,800,600, background))
self.strActionInfo = xbmcgui.ControlLabel(240, 200, 200, 200, '', 'font13', '0xFFFFFF99')
self.addControl(self.strActionInfo)
self.strActionInfo.setLabel('Clicking [OK] will send message')
def onAction(self, action):
if action == ACTION_SELECT_ITEM:
# put the ip address of the listener in here.
# make the listener listen on port 8100, and wait for a msg
# that says 'shutdown'.
s.connect(('192.168.1.200', 8100))
s.send('shutdown\r\n')
if action == ACTION_PREVIOUS_MENU:
self.close()
shutmedown = CShutdown()
shutmedown.doModal()
Save the file as something like 'shutdownremote.py' and put it in your scripts dir.
Also, shove a background.png image in your "scripts\\shutdownremote" folder for the background to work. (create the folders if they don't exist!)
Don't forget, Python uses indentation to determin the start/end of blocks - this might need reformatting.
If it doesn't work, post it in the Python Scripting forum, as it will just be that I have missed something silly.
If no-one can fix it by the time I get back, then I will do it. It may, however, just work fine :-)
Good luck.