XScript, a new plugin

Xlobby plugin development

Postby Heiko on Wed Jan 11, 2006 3:41 am

thanks ptrinchi!
it's not an urgent topic. Steven is back and I think there are a lot of other things to do / test next days :)
Heiko
 
Posts: 50
Joined: Thu Oct 28, 2004 10:39 am
Location: Germany

Postby dalanik on Thu Jan 26, 2006 3:16 pm

Hello,

I've been trying to implement some stuff through this great plugin. It works fine, except for one thing which I can't figure out... I'm not even sure this is XLobby/XScript problem, since I managed to make it work (in 1 case only)

I try to run extermal programs from XScript, and as in MSDN reference I use Shell() to run the program. I tried with MPC, Zoom, DVDDecrypter and several other programs, but it never works. They simply don't run, and I never get to the next line in script after Shell() command (I've put msgbox after Shell() command and it never gets displayed)

I finaly copied and pasted M$'s code to run calculator, and guess what? It runs fine every time.

So why would

ProcID = Shell("C:\Windows\system32\calc.exe", AppWinStyle.NormalFocus)

run, but

ProcID = Shell("C:\Program Files\MPC\mplayer.exe", AppWinStyle.NormalFocus)

not?

Any clues? Help greatly appreciated! :-)

D.
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby alaricljs on Fri Jan 27, 2006 3:34 am

I'll take a guess dalanik, but the only difference I see between those 2 isa space in the path to the one that won't work.

Could someone share some web sites or resources in regard to learning/using VB.net? All I really need to learn is basic structure and logic but I haven't found anything basic on the net as yet.


Thanks.
alaricljs
 
Posts: 82
Joined: Wed Nov 17, 2004 6:46 pm

Postby dalanik on Fri Jan 27, 2006 8:26 am

alaricljs wrote:I'll take a guess dalanik, but the only difference I see between those 2 isa space in the path to the one that won't work.
Thanks.


You're ofcourse right, but path is enclosed in quoutes?
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby m_ski on Fri Jan 27, 2006 12:01 pm

Try this website for extracts from VB.NET books.

http://www.publicjoe.f9.co.uk/vbnet/samples/ebook.html
m_ski
 
Posts: 204
Joined: Wed Dec 08, 2004 7:57 am
Location: Kent, United Kingdom

Postby hvs69 on Fri Jan 27, 2006 6:41 pm

dalanik wrote:
alaricljs wrote:I'll take a guess dalanik, but the only difference I see between those 2 isa space in the path to the one that won't work.
Thanks.


You're ofcourse right, but path is enclosed in quoutes?


If space is the problem than c:\Progra~1\MPC\mplayer.exe should work. Try it out.
hvs69
 
Posts: 219
Joined: Wed Feb 11, 2004 8:06 am

Postby alaricljs on Fri Jan 27, 2006 7:34 pm

ptrinchi:

How do I pull a variable set with xlobby's "save to variable" command?

Thanks
alaricljs
 
Posts: 82
Joined: Wed Nov 17, 2004 6:46 pm

Postby alaricljs on Fri Jan 27, 2006 7:40 pm

Ok, been away a long time, I got it...

%variable>foo%


duuuh!
alaricljs
 
Posts: 82
Joined: Wed Nov 17, 2004 6:46 pm

Is System.Drawing available?

Postby tswhite70 on Sat Jan 28, 2006 11:12 pm

ptrinchi -

Love the plugin, it's fantastic. But I've been trying to use the System.Drawing namespace unsuccessfully. Is it available through your plugin?

Thanks!
tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby ptrinchi on Sun Jan 29, 2006 5:23 pm

I'm sorry but I can't help you much on VB programming instructions...

This plugin only embeds the Microsoft VB Script objects. That means, all you can do with VB.NET can be made in the script.

Just one recommandation, don't use the implicite declaration like File.Exists("myfile.avi") but explicite declaration like System.IO.File.Exists("MyFile.avi")

Good luck...
ptrinchi
 
Posts: 108
Joined: Fri Sep 10, 2004 8:52 pm
Location: France

Postby Heiko on Thu Feb 09, 2006 8:18 am

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

...see you soon.


@ptrinchi: any news with that topic? I'm sad that I can't trigger any hs-event from a script. :)
Heiko
 
Posts: 50
Joined: Thu Oct 28, 2004 10:39 am
Location: Germany

Postby dalanik on Mon Feb 27, 2006 3:17 pm

This plugin is awesome! It really opens up so many possibilities, and I'm trying to use 'em :-) Again, thanx for awesome plugin!

Just one thing, IMHO, would make portability of the skin better, if script files could be located inside the SKIN folder.

i.e.

right now, it's c:\program files\xlobby\plugins\xscript\scripts.

if you could make it c:\program files\xlobby\skins\skinname\scripts

where skinname is actual skin's folder.

it would make life easier on sharing skins, since everything would be in the same folder.

maybe look in \plugins\xscript\scripts and if not found there, then at \skins\skinname\scripts ?

D.
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Memory Issue

Postby spencer171 on Sun Apr 09, 2006 6:47 pm

ptrinchi -

I'm pretty sure that you have an issue with this plugin and memory usage. Everytime a script is executed, the memory used by xlobby goes up.

I assume that you are creating an in memory assembly from the source code using the CodeCompiler. The problem is that everytime you load the generated assembly, it will add the assembly to the running program's (xlobby) AppDomain, thereby increasing memory usage. There is no way to unload assemblies from an AppDomain.

There are two solutions to this issue that I can think of at the moment. The first is to generate an actual dll file with the same filename as the script (just with a .dll extension). Then load this dll and use the compiled version instead of generating the assembly in memory each time the script is run. It would also make the execution faster as well. You would probably want to have a monitor on the script file so if it changes you would recompile (so you can still change the script while running and have the changes reflected by xlobby). Another solution would be to load the dynamic code into another AppDomain - something that would not be trivial to do correctly.

If you would like some help with fixing this, please let me know. I do like the idea of this plugin, and the work so far has been great. Hopefully, we can get this issue resolved so xlobby can be run without issue with this program active.

As a side note, I only noticed this problem because I am running a script every 10 seconds and left it going overnight. For occasional script executions, it doesn't really matter.
spencer171
 
Posts: 4
Joined: Sun Apr 09, 2006 6:04 pm

Postby Aaron on Mon Apr 10, 2006 4:42 pm

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

...see you soon.


@ptrinchi: any news with that topic? I'm sad that I can't trigger any hs-event from a script. :)


I'm interested in this too. I just posted a semi-LONG post on Homeseer integration with XL in the Announcements forum, under X-10 Integration.

EASY Homeseer integration with XL is very much needed. I'm hoping Steven addresses this directly. We'd get a large portion of the HS crowd using XL if he does!
Aaron
 
Posts: 299
Joined: Fri May 07, 2004 3:50 am

Postby dalanik on Tue Apr 11, 2006 10:24 am

I'd be interested as well to see the memory issue solved. I use XScript a lot, and the problems I reported elsewhere of XLobby crashing when left on for several hours (pvernight) might be related to XScript, not XVis as I thought! :-) I actually have a script which is cycling screens, and everytime I run it and leave it long enough, I find XLobby dead :-)

D.
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

PreviousNext