Help with simple plugin

Help each other out

Help with simple plugin

Postby WannaTheater on Tue Aug 12, 2008 9:57 pm

So I have managed to compile a fairly simple plugin written in VB which I can call from within XL. Now I am looking at how to execute Xlobby events from within the plugin code.

For example, in Xscript I could execute XL events using the following:

XLobby.ExecCommand("category", "refresh", "music")
XLobby.ExecCommand("xlobby", "show overlay", MyOverlay)
Xlobby.Invalidate()
etc

Are there prebuilt functions that can be used to accomplish the same things from within a plugin?

Thanks!
WannaTheater
 
Posts: 235
Joined: Thu Aug 24, 2006 11:35 am
Location: Florida

Re: Help with simple plugin

Postby WannaTheater on Tue Aug 12, 2008 11:48 pm

After some more searching I found the xHelper.SendCommand function.... I am now fully functional with my new plugin. :D
WannaTheater
 
Posts: 235
Joined: Thu Aug 24, 2006 11:35 am
Location: Florida

Re: Help with simple plugin

Postby S Pittaway on Wed Aug 13, 2008 7:34 am

have fun :)
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: Help with simple plugin

Postby lar282 on Wed Aug 13, 2008 10:24 am

You prob know already but there are two types u can use:

ArrayList lst = new ArrayList();
lst.Add(@"example");
lst.Add(@"example");
lst.Add(@"example");
xhelper.SendCommand("xlobby", "run event", lst);
lst.Clear();

and the single line

SendCommand("invalidate");
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Re: Help with simple plugin

Postby WannaTheater on Wed Aug 13, 2008 10:43 am

Thanks!

So would
lar282 wrote:You prob know already but there are two types u can use:

ArrayList lst = new ArrayList();
lst.Add(@"example");
lst.Add(@"example");
lst.Add(@"example");
xhelper.SendCommand("xlobby", "run event", lst);
lst.Clear();
;


be the same as

xHelper.SendCommand("example1")
xHelper.SendCommand("example2")
xHelper.SendCommand("example3")

i.e. sending 3 events to XL to be run sequentially?
WannaTheater
 
Posts: 235
Joined: Thu Aug 24, 2006 11:35 am
Location: Florida

Re: Help with simple plugin

Postby lar282 on Wed Aug 13, 2008 11:51 am

no
it will send one event but in a different form. Sometimes u have to use the arraylist method to sendcommand.
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Re: Help with simple plugin

Postby P3rv3rt B3ar on Wed Aug 13, 2008 12:25 pm

lar282 wrote:Sometimes u have to use the arraylist method to sendcommand.


Yes Arraylist version should be ur preferable one whenever parameter is not completely literal, otherwise ull run into nasty separator character bugs sooner or later...
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland