XScript, a new plugin

Xlobby plugin development

XScript, a new plugin

Postby ptrinchi on Thu Nov 24, 2005 10:59 am

You find Xlobby wonderful but for you, some little functions are missing?
You want to add condition to your event like if XXX then YYY but it was impossible?
You wanted to make plugin but it’s too difficult for you?

I have a solution made for you :wink: … the VB.NET SCRIPT Interpreter plugin!!!!!

It’s simple, it allow you to add all the functionality you want by coding few VB code lines in a text file. More powerful, it let you use all the Xlobby functions and variables: :D

- You can use internals variables for example Xlobby.GetXlobbyVar("category>movies>name") or Xlobby.GetXlobbyVar("plugin>weather>current>temp ")

- You can execute all the internals commands for example Xlobby.ExecCommand("xlobby", "goto screen", "menu")

Only one event function for calling scripts in Xlobby. Just put the Name of the script and is parameters in the Variables field like example.txt MaVar1 MaVar2. All your scripts must be in the plugin\Xscript\scripts directory.

So good code…

http://www.france.xlobby.com/forum/ptrinchi/XScript.zip
ptrinchi
 
Posts: 108
Joined: Fri Sep 10, 2004 8:52 pm
Location: France

Postby hvs69 on Mon Nov 28, 2005 8:17 pm

WOW, This will open up endless possibilities. I think I will have to learn VB pretty soon.

Ptrinchi, you are simply great.
:)
hvs69
 
Posts: 219
Joined: Wed Feb 11, 2004 8:06 am

Postby rika on Mon Nov 28, 2005 8:33 pm

Dito
Thanks!!!

Rika
rika
 
Posts: 401
Joined: Fri Apr 02, 2004 5:43 am
Location: Sweden

Postby erikt on Tue Dec 06, 2005 6:09 pm

This is great! I just started working with VBS and this turns up, nice timing!

So, I've got a question if you don't mind...
I've got a VBS script that performs some file I/O (converts a DVDProfiler
XML into an Xlobby XML), and I figured I'd try it out with your plugin.
After adding a whole slew of Dim statements, I'm getting an error regarding
the strict option not allowing late binding. The code in question is:
Code: Select all
Dim FSOlog as object
Dim LogID as object
FSOlog = CreateObject("Scripting.FileSystemObject")
LogID = FSOlog.CreateTextFile(Logfile)

It is the last line of code that is causing the error.

I've searched msdn and the web for a way to avoid late binding, but have
not found an answer. Any help would be greatly appreciated!

Thanks,
erikt
erikt
 
Posts: 81
Joined: Tue Nov 09, 2004 1:49 pm
Location: Ottawa, Ontario, Canada

Postby erikt on Tue Dec 06, 2005 8:08 pm

Sorry about replying to my own post, but I figured out the problem and I
think I discovered a bug/limitation.

The light went on when I realized this isn't VBScript but VB.NET, so I
stopped using the FileSystemObject object and discovered the simpler
FileOpen, FilePut, FileClose commands.

However, my script takes 6 parameters, several of them long strings
(directory paths). It looks like I'm hitting a limitation on either the number
of parameters I can pass, or the total length of these parameters. Is there
a way to increase this limit?

Thanks,
erikt
erikt
 
Posts: 81
Joined: Tue Nov 09, 2004 1:49 pm
Location: Ottawa, Ontario, Canada

Postby ptrinchi on Thu Dec 08, 2005 8:37 am

However, my script takes 6 parameters, several of them long strings (directory paths). It looks like I'm hitting a limitation on either the number of parameters I can pass, or the total length of these parameters. Is there a way to increase this limit?
The plugin have no limitation (I just remind you that if you have a parameter that contains blank just put it into "" like "C:\Program Files\")
Perhaps, Xlobby on the Variables field onto plugin command fixes the limitation of the length.

If you know how to put your variables in Xlobby then you will be able to read them in the script with Xlobby.GetXlobbyVar("%MyCat>MyName%") for example without pass them into parameters.
ptrinchi
 
Posts: 108
Joined: Fri Sep 10, 2004 8:52 pm
Location: France

Postby erikt on Thu Dec 08, 2005 2:18 pm

ptrinchi wrote:Perhaps, Xlobby on the Variables field onto plugin command fixes the limitation of the length.

I suspect this is the case. No big deal, I'll either go with your suggestion
and store the parameters in an Xlobby variable, or I'll use a .ini file.

Thanks,
erikt
erikt
 
Posts: 81
Joined: Tue Nov 09, 2004 1:49 pm
Location: Ottawa, Ontario, Canada

Postby Heiko on Fri Jan 06, 2006 5:55 am

Thanks Ptrinchi again for that wonderful plugin! Now I can realize all the things I've ever missed in XLobby. It's a break trough :-) Would be nice, to trigger XLobby Events form a script. Is that possible?
I'd tried to trigger a homeseer event with the XLobby.ExecCommand, but it does not work for me:
Code: Select all
XLobby.ExecCommand("Plugin","Command","xAP-XLobby~homeseer command:TriggerEvent~MyHsEvent" )

Any suggestions for me?
thanks!
Heiko
 
Posts: 50
Joined: Thu Oct 28, 2004 10:39 am
Location: Germany

Postby vicom on Fri Jan 06, 2006 12:20 pm

Is it possible to get a list of all Xlobby methods?

eg: Xlobby.ActiveScreen()
Xlobby.ExecCommand
Xlobby.GetXlobbyVar
etc....

I would appreciate it...I have huge plans using this awesome plugin
vicom
 
Posts: 206
Joined: Tue Apr 20, 2004 6:16 am
Location: South Africa

Postby ptrinchi on Sat Jan 07, 2006 9:53 am

vicom >
- Xlobby.ActiveScreen() return a string with the name of the active screen.
- Xlobby.IsConnectedToInternet() return a string like True or False.
- Xlobby.GetXlobbyVar(xxxxx) return a string with the value of the Xlobby xxxxx variable. You can use every variables available, internals like %movies>parameter% and external (plugin) like %plugin>xap-xlobby>state>A1%
- Xlobby.Invalidate() to ask xlobby to redraw the active screen.
- Xlobby.ExecCommand(type, command, param) to execute a xlobby command. Type is a string with the name of the commaand group like Xlobby, category or music, command is the name of the command in the specified group like goto screen, execute or play and param is a string with all the parameters separated with a ~. For example with a goto screen menu. Xlobby.ExecCommand("xlobby","goto screen","menu")
That all.

Heiko > you code normaly should work :? Perhaps the problem is the cast try this :
Code: Select all
XLobby.ExecCommand("plugin","command","xAP-XLobby~Homeseer Command:TriggerEvent~MyHsEvent" )
ptrinchi
 
Posts: 108
Joined: Fri Sep 10, 2004 8:52 pm
Location: France

Postby vicom on Sat Jan 07, 2006 10:07 am

thanx for info :-)
vicom
 
Posts: 206
Joined: Tue Apr 20, 2004 6:16 am
Location: South Africa

Postby Heiko on Sat Jan 07, 2006 11:33 am

Heiko > you code normaly should work :? Perhaps the problem is the cast try this :
Code: Select all
XLobby.ExecCommand("plugin","command","xAP-XLobby~Homeseer Command:TriggerEvent~MyHsEvent" )


hmm... can't get it. This is the hole script wich works except the third ExecCommand Statement:
Code: Select all
Module Script
Public Sub Main()
Dim Var1 as string
   var1=Xlobby.GetXlobbyvar("category>ferien>status")
   if var1="aktiv"
      XLobby.ExecCommand("category", "variable set", "ferien~status~inaktiv")
      XLobby.ExecCommand("category", "variable set", "ferien~sign~")
      XLobby.ExecCommand("plugin","command","xAP-XLobby~Homeseer Command:TriggerEvent~FerienAktiv")
   end if
   if var1="inaktiv"
      XLobby.ExecCommand("category", "variable set", "ferien~status~aktiv")
      XLobby.ExecCommand("category", "variable set", "ferien~sign~b")
      XLobby.ExecCommand("plugin","command","xAP-XLobby~Homeseer Command:TriggerEvent~FerienInAktiv")
   end if
End Sub
End Module

If I fire the HSEvent via the xAP-XLobby plugin it works. I tried all lower / uppercase combinations with no result :o
Heiko
 
Posts: 50
Joined: Thu Oct 28, 2004 10:39 am
Location: Germany

Postby m_ski on Mon Jan 09, 2006 1:10 pm

I don't think you can execute commands in a plugin that are from another plugin...

http://www.xlobby.com/forum/viewtopic.php?t=3547&highlight=plugin+command
m_ski
 
Posts: 204
Joined: Wed Dec 08, 2004 7:57 am
Location: Kent, United Kingdom

Postby Heiko on Mon Jan 09, 2006 3:26 pm

Thanks m_ski, but I think that's not the point. As you see in Ptrinchis post above, it's possible to interactive with other plugins from the XScript plugin:

- Xlobby.GetXlobbyVar(xxxxx) return a string with the value of the Xlobby xxxxx variable. You can use every variables available, internals like %movies>parameter% and external (plugin) like %plugin>xap-xlobby>state>A1%
Heiko
 
Posts: 50
Joined: Thu Oct 28, 2004 10:39 am
Location: Germany

Postby ptrinchi on Tue Jan 10, 2006 2:22 pm

Heiko, I will make a double debug on XScript and Xap-Xlobby as soon as I get enouth time... :wink:

...see you soon.
ptrinchi
 
Posts: 108
Joined: Fri Sep 10, 2004 8:52 pm
Location: France

Next