VoxCommando
Help and Support (Using VoxCommando) => Other Plugins => Topic started by: StrikemanXL on July 02, 2013, 03:34:51 PM
-
Hi guys. Iv just purchased vox commando because its so awesum :)
Iv set up gmail and xbmc ect just fine but Im having a little problem with Ggcal. It tells me there is an event but unlike Gmail that gives me a list of received mail ect I just get "TTS: 3 events " from my GgCal.GetToday action.
Iv tried using the variables but its still come up the same :( Maybe Iv missed some thing in the Ggcal plugin setup? Thanks
-
Hello Extra Large Strikeman,
Welcome to VC.
That action results multiple results as "matches" which can be accessed as {Match.1} {Match.2} etc. Same idea as multiple regex matches.
You have a few options on how to deal with these, but the simplest is to use Results.MatchConcat
here's an example:
<?xml version="1.0" encoding="utf-16"?>
<command id="1078" name="TV this week" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>GgCal.GetRange</cmdType>
<cmdString>0&&7&&TV</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<cmdString>{LastResult}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.MatchConcat</cmdType>
<cmdString>{CR}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.AddText</cmdType>
<cmdString>{LastResult}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase optional="true">What's on</phrase>
<phrase>TV this week</phrase>
</command>
-
Here's another way:
This one loops the action the correct number of times. {#M} gives you the number of matches and {i} gives you the loop iteration number, so the first time the action is executed {i} is 1, then 2 etc.
<?xml version="1.0" encoding="utf-16"?>
<command id="1089" name="TV this week (action loop)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>GgCal.GetRange</cmdType>
<cmdString>0&&7&&TV</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<cmdString>{LastResult}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.AddText</cmdType>
<cmdString>TV show: {Match.{i}}</cmdString>
<cmdRepeat>{#M}</cmdRepeat>
</action>
<phrase optional="true">What's on</phrase>
<phrase>TV this week</phrase>
</command>
-
and finally, the most powerful method using Results.MatchToEvent
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="calendar match events" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="1116" name="TV this week (by events)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>GgCal.GetRange</cmdType>
<cmdString>0&&7&&TV</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<cmdString>{LastResult}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.MatchToEvent</cmdType>
<cmdString>calevent&&4</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase optional="true">What's on</phrase>
<phrase>TV this week</phrase>
</command>
<command id="1117" name="deal with calendar event" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>Results.SetLastResult</cmdType>
<cmdString>{1}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.RegExReplace</cmdType>
<cmdString>(\d+)x(\d+)&&season $1, episode $2</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<cmdString>{LastResult}&&-200</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>TTS.SpeakSync</cmdType>
<cmdString>{LastResult}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<event>calevent</event>
</command>
</commandGroup>
This method allows you to do more complex macros for each element in the set of matches. In this example, my TV calendar returns the shows as: Dexter 4x5 and so I can use regex replace to turn that into Dexter Season 4, Episode 5.
-
Easy as pie ;D Thanks mate.
02/07/2013 23:12:49 463 doCommand:Events this week (action loop)
02/07/2013 23:12:49 463 action repeat set to: 1
02/07/2013 23:12:49 464 Action: GgCal.GetRange - 0&&7&&StrikemanXL
02/07/2013 23:12:49 780 action repeat set to: 1
02/07/2013 23:12:49 781 Action: OSD.ShowText - 3 events
02/07/2013 23:12:49 813 action repeat set to: 3
02/07/2013 23:12:49 813 Action: OSD.AddText - Calendar Events: Tuesday 20:18 Vox commando Rocks!!
02/07/2013 23:12:49 843 Action: OSD.AddText - Calendar Events: Tuesday 22:18 ghgkhgkhghgk
02/07/2013 23:12:49 871 Action: OSD.AddText - Calendar Events: Wednesday 09:30 google calendar :)
02/07/2013 23:12:49 900 action repeat set to: 3
02/07/2013 23:12:49 901 Action: TTS.Speak - Tuesday 20:18 Vox commando Rocks!!
02/07/2013 23:12:49 943 Action: TTS.Speak - Tuesday 22:18 ghgkhgkhghgk
02/07/2013 23:12:49 981 Action: TTS.Speak - Wednesday 09:30 google calendar :)
-
Hey,
I added quite a few calendars to Google calendar (e.g. The Walking dead form tvcountdown.com) and they show up under "more calendars" (if i guess the eng translation right).
I can get the events from "my calendars" but not from "more calendars".
Is there a workaround to get the "external" calendars?
Cheers Sunny
PS: Sorry for the endless seeming questions, but It's your fault, that you created such a nice prog ;) with many possibilities
-
Yes. I know. I am an idiot and a masochist. :bonk
I have several calendars and use them without any problems. I'm not familiar with tvcountdown.com so I don't know what kind of calendars they are but if they are public calendars that belong to someone else, and not your calendars, then I guess that is the problem.
-
I don't think that's the problem. At least, I just imported a tvcountdown.com calendar to my Google calendars and it showed up in my VC GgCal feeds as soon as I refreshed the list.
-
Yeah, me too. Works great.
-
I also get a Connection Error, when i press the green "refresh" or "reconnect" arrows.
I also renamed the tvcountdown cals (e.g. "The walking dead", "Falling Skies" etc.)
In my "Feeds to Scan" List there is a tvcountdown.com calendar, which should be renamed, am I right?
cheers, Sunny
-
Connection error doesn't sound good. That's a mystery.
Maybe you have too many calendars. You can put all your TV shows into a single calendar.
I did not rename the tvcountdown.com calendar and it shows up in my feeds fine.
-
I was able to recreate your connection error. The problem comes from renaming someone else's feed. Gooogle doesn't really rename it so it still shows up as the original feed name. Now when you add another feed from the same service, it has the same "true" name as one that is already in your calendar, and I guess this is what is creating the error.
So just remove all the calendars (unsubscribe) from tvcountdown.com and then combine them all into a single calendar and don't rename it and you should be fine.
-
schweet, works now =)
thx again!
-
So ...
I'd like to have an eventlist for (e.g.) today from all of my calendars.
I came up with a pretty long, and slow, "actionlist" which works, but definetly can be optimized in one way or another.
- GgCal.GetDay:0&&CalendarName (Get the Evens from calendar X)
- Results.MatchConcat:{CR} (Concatenates all matches into a single string that is stored in {LastResult})
- Results.StoreLast:VarName (Stores my {Lastresult} into a variable)
- If (A)==(B) {var.VarName} is empty -> then do nothing
- else display {var.VarName}
If you want to have a summary of all calendars (in my case 8) for (e.g.) today this "actionlist" is getting pretty long.
Is there an other way to "string" them together?
I already tried to sepreate the calendars by comma (,) or | but it doesn't work.
Cheers, Sunny
(https://voxcommando.com/forum/proxy.php?request=http%3A%2F%2Fwww.en4ce.com%2Fimg%2Fheutige_termine1.JPG&hash=795c414c1e816c34a0b336a44650356f983b9403)
(https://voxcommando.com/forum/proxy.php?request=http%3A%2F%2Fwww.en4ce.com%2Fimg%2Fheutige_termine2.JPG&hash=d8ca867b423a02cc4aab24d9a2d660b35639a4dc)
-
I think you are doing it the correct way. You just have an unusually large number of calendars (I think).
By the way you can just copy your command from the tree editor and then paste it into a code block on the forum when composing your message. Probably easier for you than doing screen captures, and MUCH easier for others who want to experiment with your command without having to recreate the whole thing by hand.
-
Your solution is tidy, even if long.
Since the plugin really only allows you to retrieve information from one feed at a time, I think your command approach makes sense.
When you say that it's slow, do you mean that it's slow to create the code, or that it is slow to execute?
Another way you might consider doing this is to create a command group. Within the group, keep each calendar's feedback in its own command, but allow each command to trigger the next. To add more calendars later, you can clone the last command in your group and alter the clone as needed.
I tested this with just 3 calendars and it executes quite efficiently, but I don't have a lot of calendar events so it's difficult to know for sure.
Possible benefits of this approach are:
(1) you can change some of the details for individual calendar commands without having to scroll through a big long command;
(2) you could clone individual commands, substitute in trigger phrases and delete the trigger events, so that when you want to, you can ask for results from particular calendars rather than all calendars at once.
You, James or others may see disadvantages to my approach, or ways to improve upon it. Here is an example with 3 calendars:
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="Today's events" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="485" name="Today's MyCal1 events" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>GgCal.GetDay</cmdType>
<cmdString>0&&MyCal1</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<if ifBlockDisabled="False" ifNot="True">
<ifType>(A)==(B)</ifType>
<ifParams>{LastResult}&&no events</ifParams>
<then>
<action>
<cmdType>Results.MatchConcat</cmdType>
<cmdString>{CR}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<cmdString>MyCal1: {LastResult}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else />
</if>
<action>
<cmdType>VC.TriggerEvent</cmdType>
<cmdString>MyCal2</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>What's happening today, Tell me today's events</phrase>
</command>
<command id="488" name="Today's MyCal2 events" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>VC.Pause</cmdType>
<cmdString>2000</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>GgCal.GetDay</cmdType>
<cmdString>0&&MyCal2</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<if ifBlockDisabled="False" ifNot="True">
<ifType>(A)==(B)</ifType>
<ifParams>{LastResult}&&no events</ifParams>
<then>
<action>
<cmdType>Results.MatchConcat</cmdType>
<cmdString>{CR}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<cmdString>MyCal2: {LastResult}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else />
</if>
<action>
<cmdType>VC.TriggerEvent</cmdType>
<cmdString>MyCal3</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<event>MyCal2</event>
</command>
<command id="552" name="Today's MyCal3 events" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>VC.Pause</cmdType>
<cmdString>3000</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>GgCal.GetDay</cmdType>
<cmdString>0&&MyCal3</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<if ifBlockDisabled="False" ifNot="True">
<ifType>(A)==(B)</ifType>
<ifParams>{LastResult}&&no events</ifParams>
<then>
<action>
<cmdType>Results.MatchConcat</cmdType>
<cmdString>{CR}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<cmdString>MyCal3: {LastResult}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else>
<action>
<cmdType>OSD.ShowText</cmdType>
<cmdString>No new TV today</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
</else>
</if>
<action>
<cmdType>VC.TriggerEvent</cmdType>
<cmdString>NextCal</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>Today's MyCal3 events</phrase>
<event>MyCal3</event>
</command>
</commandGroup>
I honestly don't know if this is a better solution or even a good one. I simply offer it as an alternative. Let the debates begin! ::hmm
-
OK. I was inspired by nime5ter.
this method is probably the easiest to maintain.
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="What's happening today" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="553" name="updateAcal" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>GgCal.GetDay</cmdType>
<cmdString>0&&{1}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)<(B)</ifType>
<ifParams>0&&{#M}</ifParams>
<then>
<action>
<cmdType>Results.MatchConcat</cmdType>
<cmdString>{CR}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.SetVar</cmdType>
<cmdString>allEvents&&{Var.allEvents}{CR}{1}:{CR} {LastResult}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else />
</if>
<event>updateAcal</event>
</command>
<command id="554" name="call for updates" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>Results.SetVar</cmdType>
<cmdString>allEvents&&Calendar info:</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.TriggerEvent</cmdType>
<cmdString>updateAcal&&Birthdays</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.TriggerEvent</cmdType>
<cmdString>updateAcal&&tvcountdown.com</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>VC.TriggerEvent</cmdType>
<cmdString>updateAcal&&James Richards</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<cmdString>{Var.allEvents}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>What's happening today, Tell me today's events</phrase>
</command>
</commandGroup>
-
Whoa man. You're blowin' my mind.
-
From a programmer's point of view it is a relatively straightforward thing. We are just using VC.TriggerEvent the same way we could use a subroutine.
(https://voxcommando.com/forum/index.php?action=dlattach;topic=1127.0;attach=2102;image)
This command gets called once for each calendar and it adds to the variable "allEvents"
(https://voxcommando.com/forum/index.php?action=dlattach;topic=1127.0;attach=2104;image)
-
Since earlier there was discussion of using VC to learn Python, here is something similar to what James just did above, but using some very basic Python (it requires that the Python plugin is installed).
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="What's happening today" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="553" name="iterate Calendar feeds" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>PY.ExecFile</cmdType>
<cmdString>{Path.VC}\PY\CalendarFeed.py</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>What's happening today?</phrase>
</command>
<command id="559" name="Reads feeds (OSD)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="True" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>VC.Pause</cmdType>
<cmdString>2000</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.SetVar</cmdType>
<cmdString>thisFeed&&{1}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>GgCal.GetDay</cmdType>
<cmdString>0&&{1}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)<(B)</ifType>
<ifParams>0&&{#M}</ifParams>
<then>
<action>
<cmdType>Results.MatchConcat</cmdType>
<cmdString>{CR}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<cmdString>{var.thisFeed}:{CR}{LastResult}</cmdString>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else />
</if>
<event>DaysEvents</event>
</command>
</commandGroup>