Author Topic: Ability to add a delay?  (Read 7388 times)

0 Members and 1 Guest are viewing this topic.

vulcanjedi

  • $upporter
  • Sr. Member
  • *****
  • Posts: 213
  • Karma: 8
    • View Profile
Ability to add a delay?
« on: August 25, 2012, 12:04:06 AM »
I found a script that natively was intended to run as a service that monitors XBOX LIVE and it runs every x mins and tells you of new friends get online. Works relatively well.
Well I thought w/ VC it would be nice to be able to instantiate it anytime i wanted, cause when u do that I will find all the friends from a state like you just got on so you would see ALL your friends and not just those that have gotten on since the previous run. Thus if i just missed it or was eating, if i manually call the script I can see the online status of any friends that are on.

Well i got that well and good.
The problem is, I'm using the XBMCbuntu calling from a remote node so i have the XBMC notifications as the OSD
So when i say 'are any friends on xbox live"
it shows that on screen, and well the script ran and then u kinda of miss the first bit cause the OSD from VC hasn't transitioned away yet?
I didn't see if that was configurable, but can i add a delay so that i say "any friends on xbox live", wait 5 secs, call script?

xtermin8r

  • $upporter
  • Sr. Member
  • *****
  • Posts: 366
  • Karma: 9
  • Crunchie
    • View Profile
Re: Ability to add a delay?
« Reply #1 on: August 25, 2012, 12:26:23 AM »
Hi Vulcanjedi

If you require a delay then you can use the action vc.pause, you can find more info on vc.pause if you follow this link.
http://voxcommando.com/mediawiki/index.php?title=Actions#Pause
Neural Net Based Artificial Intelligence.

vulcanjedi

  • $upporter
  • Sr. Member
  • *****
  • Posts: 213
  • Karma: 8
    • View Profile
Re: Ability to add a delay?
« Reply #2 on: August 25, 2012, 12:35:59 AM »
Thanks! Ill see if i can figure it out :)
I've managed to get VC to open up my addon streams, but when I try to configure my XBMCbuntu node to do this runscript i get zilch.
I get zilch. from a URL works fine but from test executions in VC I dont think I am getting it to work?

URL
http://user:pass@node:port/xbmcCmds/xbmcHttp?command=ExecBuiltIn(runscript(/home/xbmc/.xbmc/addons/test-XBLFriends-8926e01/service.py))

from vc
runscript(/home/xbmc/.xbmc/addons/test-XBLFriends-8926e01/service.py)
« Last Edit: August 25, 2012, 01:06:40 AM by vulcanjedi »

xtermin8r

  • $upporter
  • Sr. Member
  • *****
  • Posts: 366
  • Karma: 9
  • Crunchie
    • View Profile
Re: Ability to add a delay?
« Reply #3 on: August 25, 2012, 01:01:37 AM »
hi
give me a moment to check it out.
« Last Edit: August 25, 2012, 01:07:00 AM by xtermin8r »
Neural Net Based Artificial Intelligence.

xtermin8r

  • $upporter
  • Sr. Member
  • *****
  • Posts: 366
  • Karma: 9
  • Crunchie
    • View Profile
Re: Ability to add a delay?
« Reply #4 on: August 25, 2012, 01:16:45 AM »
hi there

I can confirm that VC does launch python scripts without a problem.

This is the way i did it.
XBMC.ExecBuiltin RunScript(E:\xbmc-11.0\portable_data\addons\script.Hali.Automation\default.py)

[attachment=1]
xml file
[attachment=2]
Neural Net Based Artificial Intelligence.

vulcanjedi

  • $upporter
  • Sr. Member
  • *****
  • Posts: 213
  • Karma: 8
    • View Profile
Re: Ability to add a delay?
« Reply #5 on: August 25, 2012, 01:18:02 AM »
Oh xtermin8r i know it does i got it to do so on a Windows machine, just trying to get it to do so on my XBMCbuntu one for somethings just off..

xtermin8r

  • $upporter
  • Sr. Member
  • *****
  • Posts: 366
  • Karma: 9
  • Crunchie
    • View Profile
Re: Ability to add a delay?
« Reply #6 on: August 25, 2012, 01:32:35 AM »
i'm sorry i couldnt help, i have no experience with xbmcbuntu.
Neural Net Based Artificial Intelligence.

vulcanjedi

  • $upporter
  • Sr. Member
  • *****
  • Posts: 213
  • Karma: 8
    • View Profile
Re: Ability to add a delay?
« Reply #7 on: August 25, 2012, 01:39:42 AM »
nah i apprecraite the effort, these forums are pretty good. Yeah i have everything working, got the smart lists connected and everything, just can't figure out what I'm missing here. Especially since the URL approach does work.  I don't know Linux either...but I guess I'm learning:)

xtermin8r

  • $upporter
  • Sr. Member
  • *****
  • Posts: 366
  • Karma: 9
  • Crunchie
    • View Profile
Re: Ability to add a delay?
« Reply #8 on: August 25, 2012, 01:43:04 AM »
hi
If there is a problem with xbmcbuntu you can try checking the log files, if there are any. If not, see if there is a feature inside xbmcbuntu settings to enable debugging.
« Last Edit: August 25, 2012, 01:48:49 AM by xtermin8r »
Neural Net Based Artificial Intelligence.

vulcanjedi

  • $upporter
  • Sr. Member
  • *****
  • Posts: 213
  • Karma: 8
    • View Profile
Re: Ability to add a delay?
« Reply #9 on: August 25, 2012, 01:53:10 AM »
hi
If there is a problem with xbmcbuntu you can try checking the log files, if there are any. If not, see if there is a feature inside xbmcbuntu settings to enable debugging.
'
22:33:25 T:5754224   ERROR: Python script "home/xbmc/.xbmc/addons/test-service.XBLFriends-8926e01/service.py" does not exist
good call, unfortunately doesn't tell me much :P  wonder if its some escape character or somethign cause like i said again, the url works maybe some linux smarties will help me figure it out, I'll keep trying...
right now I still like this setup and it performs well this standard mic on my Mac. I hooked up a kinect and it was really really bad.
« Last Edit: August 25, 2012, 01:56:38 AM by vulcanjedi »

xtermin8r

  • $upporter
  • Sr. Member
  • *****
  • Posts: 366
  • Karma: 9
  • Crunchie
    • View Profile
Re: Ability to add a delay?
« Reply #10 on: August 25, 2012, 01:57:22 AM »
hi
It is very strange, like you said it does work using the url method. I am sure it's something trivial.
Neural Net Based Artificial Intelligence.

xtermin8r

  • $upporter
  • Sr. Member
  • *****
  • Posts: 366
  • Karma: 9
  • Crunchie
    • View Profile
Re: Ability to add a delay?
« Reply #11 on: August 25, 2012, 01:59:48 AM »
Hi

Quote
22:33:25 T:5754224   ERROR: Python script "home/xbmc/.xbmc/addons/test-service.XBLFriends-8926e01/service.py" does not exist

Aha something at last, looks like something to do with the path (just a guess).
Neural Net Based Artificial Intelligence.

xtermin8r

  • $upporter
  • Sr. Member
  • *****
  • Posts: 366
  • Karma: 9
  • Crunchie
    • View Profile
Re: Ability to add a delay?
« Reply #12 on: August 25, 2012, 02:01:45 AM »
Try the url method and have a look at the log.
Neural Net Based Artificial Intelligence.

vulcanjedi

  • $upporter
  • Sr. Member
  • *****
  • Posts: 213
  • Karma: 8
    • View Profile
Re: Ability to add a delay?
« Reply #13 on: August 25, 2012, 03:27:15 AM »
Hi

Aha something at last, looks like something to do with the path (just a guess).

thanks again xtermin8r; for anyone else interested
 "home/xbmc/.xbmc/addons/test-service.XBLFriends-8926e01/service.py"

I tried ./home/xbmc/.xbmc/addons/test-service.XBLFriends-8926e01/service.py
I tried "s and 's
but it was just /home/xbmc/.xbmc/addons/test-service.XBLFriends-8926e01/service.py
But as a great reminder, the log helped reaffirm a specific path problem and not a call problem and I believe I dont even need the delay but that command page is too a good reminder.

Great to be able to voice command what friends are online atm.  Yea.
 :o

xtermin8r

  • $upporter
  • Sr. Member
  • *****
  • Posts: 366
  • Karma: 9
  • Crunchie
    • View Profile
Re: Ability to add a delay?
« Reply #14 on: August 25, 2012, 04:39:48 AM »
Hi vulcanjedi

Are you saying  you have it working now.
Neural Net Based Artificial Intelligence.

vulcanjedi

  • $upporter
  • Sr. Member
  • *****
  • Posts: 213
  • Karma: 8
    • View Profile
Re: Ability to add a delay?
« Reply #15 on: August 25, 2012, 05:05:45 AM »
Hi vulcanjedi

Are you saying  you have it working now.

Yep.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Ability to add a delay?
« Reply #16 on: August 25, 2012, 07:33:27 AM »
What exactly did you change to get it to work?

In other words, how did you modify the path when going from an URL based approach to the VC call?

As far as I can tell you didn't change anything so why is it working  now?

vulcanjedi

  • $upporter
  • Sr. Member
  • *****
  • Posts: 213
  • Karma: 8
    • View Profile
Re: Ability to add a delay?
« Reply #17 on: August 25, 2012, 02:09:16 PM »
What exactly did you change to get it to work?

In other words, how did you modify the path when going from an URL based approach to the VC call?

As far as I can tell you didn't change anything so why is it working  now?

Hey guys sorry if I wasn't clear. I was actually having to work in Linux @ work yesterday and encountered some weird nuances too lol.
 "home/xbmc/.xbmc/addons/test-service.XBLFriends-8926e01/service.py"

I tried ./home/xbmc/.xbmc/addons/test-service.XBLFriends-8926e01/service.py
I tried encapsulating with "s and 's
but it was just /home/xbmc/.xbmc/addons/test-service.XBLFriends-8926e01/service.py

So at work I needed  to preface a folder with ./ once when dealing with the entire root folder structure but here, I only needed a single (seemingly benign) front forward slash. (no leading (period))
Still a bit confused on why the URL works with the path w/o the "/" while in VC I had to put it in there.
But I have encountered some URL encoding differences before when testing commands via a browser vs trying them in my other various scripting. Whats nice/interesting is in VC so far I haven't seen the need to URL encode stuff.

Its a bit quirky dealing with my existing setup from a VM hosting Win7 to a linux node, but wow the Kinect was picking up so much ambient vibrations and was unusable is my very brief tests...and the other solutions that require push to talk don't really gel well with me atm.
The problem with my approach at the moment, is it makes it a bit hard to test on another machine such as a windows box as I have to go change some of the commands first and try to recall those :)

But at the moment I'm activated and very happy.
I have VC instantiating the 1st party addons like TED, Food network, Youtube...etc, being able to pass more arguments like the show specifically a dynamic youtube search would be great but not sure thats possible yet. ( i know theres the sendkeys aproach, not sure i love that, and don't think applicable on my linux config, more important cause dynamic search would help curb desire to login to youtube since accounts freetext in config files :()
Calling my XBOX Live friends script in tandem with the fact it runs as a service, so I can see what friends are online atm.
Got the smart playlists working via remote smb sharing. Never knew of the smart playlists but as cool as they are i would think they are severely restricting without something like VC, with VC leveraging them its extremely versatile / powerful.
Can't wait to learn more how the gui/command structure works and refine and help build some more stuff.

xtermin8r

  • $upporter
  • Sr. Member
  • *****
  • Posts: 366
  • Karma: 9
  • Crunchie
    • View Profile
Re: Ability to add a delay?
« Reply #18 on: August 25, 2012, 04:55:52 PM »
@vulcanjedi

Good explanation, well done.  :clap
Neural Net Based Artificial Intelligence.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Ability to add a delay?
« Reply #19 on: August 25, 2012, 05:13:24 PM »
Quote
I have VC instantiating the 1st party addons like TED, Food network, Youtube...etc, being able to pass more arguments like the show specifically a dynamic youtube search would be great but not sure thats possible yet. ( i know theres the sendkeys aproach, not sure i love that, and don't think applicable on my linux config, more important cause dynamic search would help curb desire to login to youtube since accounts freetext in config files )
@vulcanjedi
You can use "InputKeys.TextEntry" with a "payloadDictation" in a command. This allowed you all what you say to insert in youtube-search field. I've tested it with "chrome browser" and it works (mostly  ;)  )

[attachment=1]

[attachment=2]
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Ability to add a delay?
« Reply #20 on: August 25, 2012, 06:50:09 PM »
There is a way to do a youtube search, a good way, but it requires a special script.  Rather than just make a single script for doing this one thing though, I'm thinking it would be nice to have something more flexible that can do a number of things.  I'm going to work on it a bit and hopefully release something soon.

Once you see what I am doing, I think it should be easy enough for people to add their own functionality to extent it a bit and as usual, hopefully people will share their discoveries with the community.

I don't actually know why, but for certain types of calls to scripts, or to activatewindow I just can't figure out how to get it to work by calling execbuiltin from VC, but I can get it to work from a python script.  I am also able to call my own python scripts using variables so the basic idea is

- call my script with the parameter we want to search for
- the python script opens youtube with the search parameter

and it works, no waiting or having to do keyboard emulation etc.  Well, we have to wait for the search results to show up, but I mean no waiting for 4 seconds and then trying to enter text and then waiting again for results.

vulcanjedi

  • $upporter
  • Sr. Member
  • *****
  • Posts: 213
  • Karma: 8
    • View Profile
Re: Ability to add a delay?
« Reply #21 on: August 25, 2012, 06:58:35 PM »
There is a way to do a youtube search, a good way, but it requires a special script.  Rather than just make a single script for doing this one thing though, I'm thinking it would be nice to have something more flexible that can do a number of things.  I'm going to work on it a bit and hopefully release something soon.

Once you see what I am doing, I think it should be easy enough for people to add their own functionality to extent it a bit and as usual, hopefully people will share their discoveries with the community.

I don't actually know why, but for certain types of calls to scripts, or to activatewindow I just can't figure out how to get it to work by calling execbuiltin from VC, but I can get it to work from a python script.  I am also able to call my own python scripts using variables so the basic idea is

- call my script with the parameter we want to search for
- the python script opens youtube with the search parameter

and it works, no waiting or having to do keyboard emulation etc.  Well, we have to wait for the search results to show up, but I mean no waiting for 4 seconds and then trying to enter text and then waiting again for results.


That sounds like a great approach and also I think would be more universally helpful for those of us with non Windows instances of XBMC too.  Great guess I need to try to start learning python now too  :bonk
Look forward to you sharing your results ...