New Plugin: XScriptNG

Xlobby plugin development

New Plugin: XScriptNG

Postby spencer171 on Mon Apr 24, 2006 5:30 pm

I was using ptrinchi's XScript to do my scripting, and it was working very well. However, I ran into a few issues - primarily a memory "leak"... So, I decided to make my own replacement for the XScript plugin. XScriptNG is the product of that decision.

This plugin is a drop in replacement for the old Plugin, no script changes should be necessary. All you should have to do is change the plugin name in your events.

Features:
    *Compiles all scripts the first time they are run - eliminates the memory leak that was occurring with repeated executions of the same script
    *Supports VB.NET and C# - use the correct file extension (you can also set a default)
    *Adds a new configuration dialog allowing you to add your own references and namespaces which should be visible in your scripts.
    *Allows setting a "startup" script which will execute when the plugin is loaded.
    *Allows you to hook into XLobby events (currently only a few XLobby events are defined - hopefully, Steven will change that)
    *Scripts can now be loaded from the current skin directory, the XLobby root directory, and the old XScript scripts directory.
    *Additional functions added to the Xlobby interface - SetXlobbyVar, SendCommand with variable parameters.
    *Ability to support the root://, skin://, and directory:// shortcuts through the ResolvePath function
    *Ability to define additional classes
    *Ability to execute a code fragment (i.e. just put the code you want, and it will run, no messing around with functions, classes, and modules)


Please see the Help file found in the linked zip file for more information about the new functionality.

Also included in the zip file are several example files (in both C# and VB.NET) to help you get started using the functionality provided by this plugin.

Furthermore, I have also included the complete source to the plugin as well. It is under the BSD license (which basically means you can do what you want with it so long as the copyright stays in the source).

Unfortunately, I don't really have access to somewhere to upload this (I don't have the bandwidth necessary on my connection to do it myself). So, I have used a free site to host it. Hopefully, someone will be able to host this someplace more suitable - I apologize for the racier images (to my knowledge, no nudity) on the download page.
UPDATE: See Baddabing's Post below for new download link.

In any case, please let me know what you think. I may be slow to respond to questions, I am pretty busy with work.

Special thanks to dalanik for helping me test this new plugin.
Last edited by spencer171 on Mon Apr 24, 2006 6:59 pm, edited 1 time in total.
spencer171
 
Posts: 4
Joined: Sun Apr 09, 2006 6:04 pm

Postby BaddaBing on Mon Apr 24, 2006 6:26 pm

I have uploaded it to the xlobby server. You can now download it here: http://www.xlobby.com/files/spencer171/XScriptNG.zip
BaddaBing
 
Posts: 557
Joined: Fri Mar 26, 2004 2:39 pm
Location: DFW Texas

Postby Aaron on Mon Apr 24, 2006 11:40 pm

Any possibility that you could extend the plug-in to support other languages...

wsh, vbscript, jscript, python, java, etc?

this would certainly allow more flexibilty for people wanting to write XL extensions to be able to use the language they know.
Aaron
 
Posts: 299
Joined: Fri May 07, 2004 3:50 am

Postby P3rv3rt B3ar on Tue Apr 25, 2006 1:18 am

Oh and while u r at it...

Add Perl, Prolog, Lisp, Eiffel, Ada, APL, Cobol, Modula, Simula, Pascal and Fortran notations too!!!! :roll:
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby Aaron on Tue Apr 25, 2006 1:26 am

[quote="P3rv3rt B3ar"]Oh and while u r at it...

Add Perl, Prolog, Lisp, Eiffel, Ada, APL, Cobol, Modula, Simula, Pascal and Fortran notations too!!!! [/quote]

... nice smart a$$ remark.
If you are going to post at least try to help... if not, at least wait until you are on the form more then a few days, noobie.

I did not mean to add ALL other languages, I was asking what possibility there was to add other popular languages, especially those SUPPORTED by .NET
Aaron
 
Posts: 299
Joined: Fri May 07, 2004 3:50 am

Postby Colby on Tue Apr 25, 2006 1:30 am

Aaron wrote:
P3rv3rt B3ar wrote:Oh and while u r at it...

Add Perl, Prolog, Lisp, Eiffel, Ada, APL, Cobol, Modula, Simula, Pascal and Fortran notations too!!!!


... nice smart a$$ remark.
If you are going to post at least try to help... if not, at least wait until you are on the form more then a few days, noobie.



Speaking of A$$es. Aaron who are you????
Colby
 
Posts: 929
Joined: Mon Feb 02, 2004 7:42 am
Location: Brookline Station, MO, USA

Postby Aaron on Tue Apr 25, 2006 1:36 am

[quote="Colby"][quote="Aaron"][quote="P3rv3rt B3ar"]Oh and while u r at it...

Add Perl, Prolog, Lisp, Eiffel, Ada, APL, Cobol, Modula, Simula, Pascal and Fortran notations too!!!! [/quote]

[b]... nice smart a$$ remark[/b].
If you are going to post at least try to help... if not, at least wait until you are on the form more then a few days, [b]noobie.[/b]

[/quote]

Speaking of A$$es. Aaron who are you????[/quote]

Colby, I try not to call people names like a child would. I was saying his remark was smart assed. Do you feel better about yourself by calling people names Colby... I hope you are proud.


Lets stay on topic please.
Aaron
 
Posts: 299
Joined: Fri May 07, 2004 3:50 am

Re: New Plugin: XScriptNG

Postby Bill Lott on Tue Apr 25, 2006 2:21 am

spencer171 wrote:I was using ptrinchi's XScript to do my scripting, and it was working very well. However, I ran into a few issues - primarily a memory "leak"... So, I decided to make my own replacement for the XScript plugin. XScriptNG is the product of that decision.

This plugin is a drop in replacement for the old Plugin, no script changes should be necessary. All you should have to do is change the plugin name in your events.

Features:
[list]*Compiles all scripts the first time they are run - eliminates the memory leak that was occurring with repeated executions of the same script


Any chance you could take a look at the plugin by the same author for Xap?

I'm having the memory "leak" issues with it and have been unable to contact the author. Steven has tried from his end to fix but the problem is within the plugin. Any help would be greatly appreciated.

THANKS!
Bill Lott
 
Posts: 293
Joined: Sun Sep 05, 2004 3:25 pm
Location: Louisville, KY

Postby spencer171 on Wed Apr 26, 2006 2:36 pm

Aaron -

It is possible to add support for additional languages. Looking at the list, it would seem that JScript would be the easiest. The other languages I am not entirely sure about, however.

For a language to be added to this plugin, it would need to support the ICodeCompiler interface and be able to compile source code to in-memory assemblies. I am not certain on the .NET support of most of the languages that you mention. If you know of specific versions of any of these languages that appear to support the full .NET interface, I would be happy to look into adding them.

Bill -

For this plugin, I had experience with doing this sort of thing before, and knew where the memory issue most likely was. I am not really familiar with the Xap plugin, and would not know where to look to solve the memory issues. If I had the source code, I could probably look at it, but in that case, I'm sure there is someone here more qualified to do so. Sorry that I can't be of assistance in this matter.
spencer171
 
Posts: 4
Joined: Sun Apr 09, 2006 6:04 pm

Postby P3rv3rt B3ar on Sun May 28, 2006 6:10 pm

Ok finally tried this out and it seems to me that i even got scripts, which i never get to work with old XScript, to function!! Its great plugin, accept my thanks for grade A community service.
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby tswhite70 on Sun May 28, 2006 8:07 pm

spencer171 - Thanks for the hard work updating this plugin. I've been using it with my InTheaters plugin and have one request from a developers point of view. Can you provide a command line option when calling the script to force a recompile? When troubleshooting my plugin and changing code I have to restart Xlobby to see my work - it would be a huge help to be able to just put something like /recompile in my parameters for the plugin call and a recompile would be forced each time the script is run.

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

Postby spencer171 on Sat Jun 03, 2006 11:03 pm

Sorry for the delay, I've been pretty busy at work. I think I can arrange something that would allow you to recompile the scripts everytime they are run. However, just to let you know, that will cause the memory issue to resurface, so I wouldn't recommend that it be done on a production system. I don't know exactly when I'll have time to do this, but I'll do my best to get it done soon.
spencer171
 
Posts: 4
Joined: Sun Apr 09, 2006 6:04 pm

Postby jbretsch on Fri Nov 17, 2006 1:30 am

A 'debug' checkmark in the plugin config screen could do it..
jbretsch
 
Posts: 33
Joined: Mon Sep 04, 2006 3:50 pm

Thin client, buttonid

Postby jbretsch on Sat Nov 18, 2006 3:53 pm

This is a great plugin. Not only can you do a lot of stuff such as conditional events etc, but it also reduces the total amout of events you have to write.

I have 1 problem and 1 question:

1) When I am using the thin client, any event updating the screen such as "goto screen" is executed on the server instead of the client.

2) Is there a way to know the id of the button press without transferring it as a parameter?
jbretsch
 
Posts: 33
Joined: Mon Sep 04, 2006 3:50 pm

Postby CarolinaGuy on Mon Dec 04, 2006 4:05 am

spencer171 - this is all new to me. Great instruction. I have your script installed and loaded Steven's Simplicity Default Skin.

I have IN Theater on the menu for movies & Refresh at the bottom of the screen.

I have struggle for several hours trying to figure out how to update the COUNTRY CODE & ZIP CODE.

Can you or someone on this forum point give me some instructions on updating these 2 parameters.

THANKS in advance.
CarolinaGuy
 
Posts: 35
Joined: Mon Dec 04, 2006 2:08 am

Next