<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[LiveScratcher forums - All Forums]]></title>
		<link>http://www.livescratcher.com/forum/</link>
		<description><![CDATA[LiveScratcher forums - http://www.livescratcher.com/forum]]></description>
		<pubDate>Sun, 01 Aug 2010 05:37:16 -0400</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[[?&#93; DirectUI and event handler]]></title>
			<link>http://www.livescratcher.com/forum/showthread.php?tid=7</link>
			<pubDate>Wed, 02 Sep 2009 00:44:05 -0400</pubDate>
			<guid isPermaLink="false">http://www.livescratcher.com/forum/showthread.php?tid=7</guid>
			<description><![CDATA[Hi<br />
<br />
I've been playing around with LiveScratcher and was wondering if it's possible to attach an event handler to a previously created button (using the LiveScratcher.DirectUI package, of course), that way I would be able to perform certain commands when the user clicks the created button<br />
<br />
<br />
Thanks in advance <img src="http://www.livescratcher.com/forum/images/smilies/biggrin.gif" style="vertical-align: middle;" border="0" alt="Big Grin" title="Big Grin" />]]></description>
			<content:encoded><![CDATA[Hi<br />
<br />
I've been playing around with LiveScratcher and was wondering if it's possible to attach an event handler to a previously created button (using the LiveScratcher.DirectUI package, of course), that way I would be able to perform certain commands when the user clicks the created button<br />
<br />
<br />
Thanks in advance <img src="http://www.livescratcher.com/forum/images/smilies/biggrin.gif" style="vertical-align: middle;" border="0" alt="Big Grin" title="Big Grin" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[LiveScratcher.DirectUI]]></title>
			<link>http://www.livescratcher.com/forum/showthread.php?tid=6</link>
			<pubDate>Fri, 17 Jul 2009 07:14:15 -0400</pubDate>
			<guid isPermaLink="false">http://www.livescratcher.com/forum/showthread.php?tid=6</guid>
			<description><![CDATA[The DirectUI package is currently a work in progress, and may change completely at some point.<br />
<br />
I'm not going to post a full list of functions and how they work here, but you can take a look with code like:<br />
for (var i in DirectUI) Console.print("Found: "+i);<br />
for (var i in DirectUI.Value) Console.print("Found: Value."+i);<br />
etc.<br />
<br />
<br />
A test package I used for testing that might help to get started follows:<br />
<div class="geshicode_h" style='padding: 5px; background-color: #DFDFDF; border: 1px solid #AAAAAA;'>JAVASCRIPT Code
	<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB;'><code><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> getGlobal<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> registerDependencies<span style="color: #009900;">&#40;</span>packageapi<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> g<span style="color: #339933;">=</span>getGlobal<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> dependencies<span style="color: #339933;">=</span>packageapi.<span style="color: #660066;">getDependencies</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #000066; font-weight: bold;">in</span> dependencies<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span>dependencies<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> shortname<span style="color: #339933;">=</span><span style="color: #000066;">name</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">pop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		g<span style="color: #009900;">&#91;</span>shortname<span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span>packageapi.<span style="color: #660066;">getExport</span><span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> myXml<span style="color: #339933;">=</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\</span>
&lt;element resid=ExtraCheckboxResID class=&quot;UserOptionsItem&quot; layout=BorderLayout()&gt;<span style="color: #000099; font-weight: bold;">\</span>
	&lt;element layoutpos=left layout=FillLayout()&gt;<span style="color: #000099; font-weight: bold;">\</span>
		&lt;Checkbox id=atom(idDisableStuffplugChk) text=&quot;&#x26;Disable StuffPlug&quot; accname=&quot;&#x26;Disable StuffPlug&quot; accdesc=&quot;Disable StuffPlug&quot; tooltip=false shortcut=82 accdefaction=&quot;Press&quot; Class=&quot;CheckBox&quot; Padding=Rect(0,2,0,2) Margin=rect(4,3,4,3) Layout=BorderLayout() TextPadding=Rect(2,2,2,2) TextAlign=20&gt;<span style="color: #000099; font-weight: bold;">\</span>
			&lt;ButtonIcon LayoutPos=left/&gt;<span style="color: #000099; font-weight: bold;">\</span>
			&lt;ButtonText LayoutPos=client Margin=Rect(1,0,0,0)/&gt;<span style="color: #000099; font-weight: bold;">\</span>
		&lt;/Checkbox&gt;<span style="color: #000099; font-weight: bold;">\</span>
	&lt;/element&gt;<span style="color: #000099; font-weight: bold;">\</span>
&lt;/element&gt;<span style="color: #000099; font-weight: bold;">\</span>
'</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> createFromXml<span style="color: #339933;">=</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> tested<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">function</span> DirectUICallback<span style="color: #009900;">&#40;</span>resid<span style="color: #339933;">,</span>root<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>resid<span style="color: #339933;">==</span><span style="color: #3366CC;">&quot;logonFrameResID&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> userOptionsGroup<span style="color: #339933;">=</span>root.<span style="color: #660066;">FindDescendent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;idUserOptionsGroup&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>userOptionsGroup<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #003366; font-weight: bold;">var</span> c<span style="color: #339933;">=</span>createFromXml.<span style="color: #660066;">ExtraCheckboxResID</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			userOptionsGroup.<span style="color: #660066;">Add</span><span style="color: #339933;">&#x26;</span>copy<span style="color: #339933;">;;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">throw</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;userOptionsGroup not found&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> parseXML<span style="color: #009900;">&#40;</span>xml<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> parser<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> UIFileParser.<span style="color: #660066;">Parser</span><span style="color: #009900;">&#40;</span>xml<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> compiled<span style="color: #339933;">=</span>parser.<span style="color: #660066;">compile</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> ret<span style="color: #339933;">=</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> callback<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> UIFileParser.<span style="color: #660066;">ToDUICallback</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #000066; font-weight: bold;">in</span> compiled.<span style="color: #660066;">elements</span><span style="color: #009900;">&#41;</span>
		ret<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span>compiled.<span style="color: #660066;">elements</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>callback<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">return</span> ret<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onInitialize<span style="color: #009900;">&#40;</span>packageapi<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	registerDependencies<span style="color: #009900;">&#40;</span>packageapi<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Console.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Console.<span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;TestPackage loaded&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Console.<span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Checkbox parsing:&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	createFromXml<span style="color: #339933;">=</span>parseXML<span style="color: #009900;">&#40;</span>myXml<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	DirectUI.<span style="color: #660066;">RegisterEventHandler</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>onCreatedElement<span style="color: #339933;">:</span> DirectUICallback <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onDeinitialize<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #009900;">&#125;</span></pre></code></div><br /></div>]]></description>
			<content:encoded><![CDATA[The DirectUI package is currently a work in progress, and may change completely at some point.<br />
<br />
I'm not going to post a full list of functions and how they work here, but you can take a look with code like:<br />
for (var i in DirectUI) Console.print("Found: "+i);<br />
for (var i in DirectUI.Value) Console.print("Found: Value."+i);<br />
etc.<br />
<br />
<br />
A test package I used for testing that might help to get started follows:<br />
<div class="geshicode_h" style='padding: 5px; background-color: #DFDFDF; border: 1px solid #AAAAAA;'>JAVASCRIPT Code
	<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB;'><code><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> getGlobal<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> registerDependencies<span style="color: #009900;">&#40;</span>packageapi<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> g<span style="color: #339933;">=</span>getGlobal<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> dependencies<span style="color: #339933;">=</span>packageapi.<span style="color: #660066;">getDependencies</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #000066; font-weight: bold;">in</span> dependencies<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span>dependencies<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> shortname<span style="color: #339933;">=</span><span style="color: #000066;">name</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">pop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		g<span style="color: #009900;">&#91;</span>shortname<span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span>packageapi.<span style="color: #660066;">getExport</span><span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> myXml<span style="color: #339933;">=</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\</span>
&lt;element resid=ExtraCheckboxResID class=&quot;UserOptionsItem&quot; layout=BorderLayout()&gt;<span style="color: #000099; font-weight: bold;">\</span>
	&lt;element layoutpos=left layout=FillLayout()&gt;<span style="color: #000099; font-weight: bold;">\</span>
		&lt;Checkbox id=atom(idDisableStuffplugChk) text=&quot;&Disable StuffPlug&quot; accname=&quot;&Disable StuffPlug&quot; accdesc=&quot;Disable StuffPlug&quot; tooltip=false shortcut=82 accdefaction=&quot;Press&quot; Class=&quot;CheckBox&quot; Padding=Rect(0,2,0,2) Margin=rect(4,3,4,3) Layout=BorderLayout() TextPadding=Rect(2,2,2,2) TextAlign=20&gt;<span style="color: #000099; font-weight: bold;">\</span>
			&lt;ButtonIcon LayoutPos=left/&gt;<span style="color: #000099; font-weight: bold;">\</span>
			&lt;ButtonText LayoutPos=client Margin=Rect(1,0,0,0)/&gt;<span style="color: #000099; font-weight: bold;">\</span>
		&lt;/Checkbox&gt;<span style="color: #000099; font-weight: bold;">\</span>
	&lt;/element&gt;<span style="color: #000099; font-weight: bold;">\</span>
&lt;/element&gt;<span style="color: #000099; font-weight: bold;">\</span>
'</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> createFromXml<span style="color: #339933;">=</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> tested<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">function</span> DirectUICallback<span style="color: #009900;">&#40;</span>resid<span style="color: #339933;">,</span>root<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>resid<span style="color: #339933;">==</span><span style="color: #3366CC;">&quot;logonFrameResID&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> userOptionsGroup<span style="color: #339933;">=</span>root.<span style="color: #660066;">FindDescendent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;idUserOptionsGroup&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>userOptionsGroup<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #003366; font-weight: bold;">var</span> c<span style="color: #339933;">=</span>createFromXml.<span style="color: #660066;">ExtraCheckboxResID</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			userOptionsGroup.<span style="color: #660066;">Add</span><span style="color: #339933;">&</span>copy<span style="color: #339933;">;;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">throw</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;userOptionsGroup not found&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> parseXML<span style="color: #009900;">&#40;</span>xml<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> parser<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> UIFileParser.<span style="color: #660066;">Parser</span><span style="color: #009900;">&#40;</span>xml<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> compiled<span style="color: #339933;">=</span>parser.<span style="color: #660066;">compile</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> ret<span style="color: #339933;">=</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> callback<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> UIFileParser.<span style="color: #660066;">ToDUICallback</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #000066; font-weight: bold;">in</span> compiled.<span style="color: #660066;">elements</span><span style="color: #009900;">&#41;</span>
		ret<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span>compiled.<span style="color: #660066;">elements</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>callback<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">return</span> ret<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onInitialize<span style="color: #009900;">&#40;</span>packageapi<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	registerDependencies<span style="color: #009900;">&#40;</span>packageapi<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Console.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Console.<span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;TestPackage loaded&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Console.<span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Checkbox parsing:&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	createFromXml<span style="color: #339933;">=</span>parseXML<span style="color: #009900;">&#40;</span>myXml<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	DirectUI.<span style="color: #660066;">RegisterEventHandler</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>onCreatedElement<span style="color: #339933;">:</span> DirectUICallback <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onDeinitialize<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #009900;">&#125;</span></pre></code></div><br /></div>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Missed Something]]></title>
			<link>http://www.livescratcher.com/forum/showthread.php?tid=5</link>
			<pubDate>Fri, 17 Jul 2009 06:24:30 -0400</pubDate>
			<guid isPermaLink="false">http://www.livescratcher.com/forum/showthread.php?tid=5</guid>
			<description><![CDATA[I've followed the instructions, but I must of missed something, is there anyway I can check if LiveScratcher is loaded, or any sort of debug log to see what I've missed?]]></description>
			<content:encoded><![CDATA[I've followed the instructions, but I must of missed something, is there anyway I can check if LiveScratcher is loaded, or any sort of debug log to see what I've missed?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[LiveScratcher.PlusCom]]></title>
			<link>http://www.livescratcher.com/forum/showthread.php?tid=4</link>
			<pubDate>Fri, 17 Jul 2009 06:15:56 -0400</pubDate>
			<guid isPermaLink="false">http://www.livescratcher.com/forum/showthread.php?tid=4</guid>
			<description><![CDATA[Used to lay a (string-only) bridge between Plus! and LiveScratcher scripts.<br />
in LiveScratcher call:<br />
<div class="geshicode_h" style='padding: 5px; background-color: #DFDFDF; border: 1px solid #AAAAAA;'>JAVASCRIPT Code
	<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB;'><code><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> onReceive<span style="color: #009900;">&#40;</span>txt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;NOTIMPL&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> onClosed<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> onConnect<span style="color: #009900;">&#40;</span>channel<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
channel.<span style="color: #660066;">onReceive</span><span style="color: #339933;">=</span>onReceive<span style="color: #339933;">;</span>
channel.<span style="color: #660066;">onClosed</span><span style="color: #339933;">=</span>onClosed<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
PlusCom.<span style="color: #660066;">register</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">,</span>onConnect<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></code></div><br /></div><br />
With a callback function taking one argument (the created channel object).<br />
Then in Plus! call:<br />
<div class="geshicode_h" style='padding: 5px; background-color: #DFDFDF; border: 1px solid #AAAAAA;'>JAVASCRIPT Code
	<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB;'><code><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> channel<span style="color: #339933;">=</span><span style="color: #009900;">&#123;</span>
OnReceive<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>text<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;NOTIMPL&quot;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
OnClose<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
Interop.<span style="color: #660066;">Call</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;PlusCom.dll&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;Connect&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">,</span>channel<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></code></div><br /></div><br />
This will call the "onConnect" callback with a newly created channel object.<br />
The channel object has 2 methods:<ul>
<li>close or Close (first from LS, second from Plus!)</li>
<li>send or Send<br />
</li></ul>
and 2 callbacks:<ul>
<li>onReceive or OnReceive</li>
<li>onClosed or OnClosed<br />
</li></ul>
<br />
Events from Plus! should be set before Connect call (so that send from the LS callback works), Events from LiveScratcher should be set as soon as possible in the callback function. Events can be changed later on.<br />
<br />
Note: the return value from onReceive or OnReceive will be converted to a string and returned from send or Send on the other side.]]></description>
			<content:encoded><![CDATA[Used to lay a (string-only) bridge between Plus! and LiveScratcher scripts.<br />
in LiveScratcher call:<br />
<div class="geshicode_h" style='padding: 5px; background-color: #DFDFDF; border: 1px solid #AAAAAA;'>JAVASCRIPT Code
	<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB;'><code><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> onReceive<span style="color: #009900;">&#40;</span>txt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;NOTIMPL&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> onClosed<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> onConnect<span style="color: #009900;">&#40;</span>channel<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
channel.<span style="color: #660066;">onReceive</span><span style="color: #339933;">=</span>onReceive<span style="color: #339933;">;</span>
channel.<span style="color: #660066;">onClosed</span><span style="color: #339933;">=</span>onClosed<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
PlusCom.<span style="color: #660066;">register</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">,</span>onConnect<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></code></div><br /></div><br />
With a callback function taking one argument (the created channel object).<br />
Then in Plus! call:<br />
<div class="geshicode_h" style='padding: 5px; background-color: #DFDFDF; border: 1px solid #AAAAAA;'>JAVASCRIPT Code
	<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB;'><code><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> channel<span style="color: #339933;">=</span><span style="color: #009900;">&#123;</span>
OnReceive<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>text<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;NOTIMPL&quot;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
OnClose<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
Interop.<span style="color: #660066;">Call</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;PlusCom.dll&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;Connect&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">,</span>channel<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></code></div><br /></div><br />
This will call the "onConnect" callback with a newly created channel object.<br />
The channel object has 2 methods:<ul>
<li>close or Close (first from LS, second from Plus!)</li>
<li>send or Send<br />
</li></ul>
and 2 callbacks:<ul>
<li>onReceive or OnReceive</li>
<li>onClosed or OnClosed<br />
</li></ul>
<br />
Events from Plus! should be set before Connect call (so that send from the LS callback works), Events from LiveScratcher should be set as soon as possible in the callback function. Events can be changed later on.<br />
<br />
Note: the return value from onReceive or OnReceive will be converted to a string and returned from send or Send on the other side.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[LiveScratcher.Console]]></title>
			<link>http://www.livescratcher.com/forum/showthread.php?tid=3</link>
			<pubDate>Fri, 17 Jul 2009 04:59:22 -0400</pubDate>
			<guid isPermaLink="false">http://www.livescratcher.com/forum/showthread.php?tid=3</guid>
			<description><![CDATA[Only export is the Console object. Methods:<ul>
<li>add(text)</li>
<li>print(text) //Alias for "add"</li>
<li>addNotification(text)</li>
<li>addWarning(text)</li>
<li>addError(text)</li>
<li>show()</li>
<li>hide()<br />
</li></ul>
]]></description>
			<content:encoded><![CDATA[Only export is the Console object. Methods:<ul>
<li>add(text)</li>
<li>print(text) //Alias for "add"</li>
<li>addNotification(text)</li>
<li>addWarning(text)</li>
<li>addError(text)</li>
<li>show()</li>
<li>hide()<br />
</li></ul>
]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[First public test available!]]></title>
			<link>http://www.livescratcher.com/forum/showthread.php?tid=2</link>
			<pubDate>Fri, 17 Jul 2009 04:54:41 -0400</pubDate>
			<guid isPermaLink="false">http://www.livescratcher.com/forum/showthread.php?tid=2</guid>
			<description><![CDATA[So here it is. LiveScratcher. Nowhere near ready, but open for public testing nevertheless.<br />
<br />
First off: If you're not a scripter/developer, and don't intend to be, go away now <img src="http://www.livescratcher.com/forum/images/smilies/tongue.gif" style="vertical-align: middle;" border="0" alt="Tongue" title="Tongue" /> shoo! This is really not intended to be of any use to normal users. It's also not some kind of continuation of StuffPlug, so don't bother if you're looking for that.<br />
<br />
Good, you're still reading. That means you must either be a developer, or a very stubborn user intending to be one some day. So let's get started. There is no installer yet (and it isn't too high on my priority list either, so don't wait up for one), so you'll have to do this all manually. And it's all modular, so it might take a little effort to get all packages in place, sorry about that <img src="http://www.livescratcher.com/forum/images/smilies/wink.gif" style="vertical-align: middle;" border="0" alt="Wink" title="Wink" /><br />
<br />
First, let's install the base system:<ul>
<li>Get <a href="http://www.livescratcher.com/basepackages/base.zip" target="_blank">base.zip</a>.</li>
<li>Unzip it to "C:\Program Files\LiveScratcher\" or another directory of your liking (in all documentation I'll assume you have it installed in the default directory, you'll have to adjust the paths yourself)</li>
<li>Move the "msacm32.dll" file to your messenger directory (mostly "C:\Program Files\Windows Live\Messenger\". If you've previously installed StuffPlug3, it should already be there</li>
<li>Open regedit (start-&gt;run-&gt;regedit)  and go to HKEY_LOCAL_MACHINE\Software\iAvatars.com\CooperativeLoader. if it doesn't exist, create it.</li>
<li>Create a new string value with the name "LiveScratcher" and the value "C:\Program Files\LiveScratcher\Preloader.LiveScratcher.dll".</li>
<li>Congratulations! LiveScratcher should now be set up!<br />
</li></ul>
<br />
Now, remember that part about LiveScratcher being modular? Yeah, turns out that LiveScratcher by itself isn't much use. At all. It does nothing. So how do I make it useful? Add packages! <img src="http://www.livescratcher.com/forum/images/smilies/smile.gif" style="vertical-align: middle;" border="0" alt="Smile" title="Smile" /><br />
All base packages can be found <a href="http://www.livescratcher.com/basepackages/" target="_blank">here</a><br />
So how do I install a package? Here's how:<ul>
<li>Open the XML file (e.g. BasicClasses.xml). If only text shows up (for example, when using Google Chrome) right-click and hit view source.</li>
<li>Note the name (it's in Package\Information\Name, in this case "LiveScratcher.BasicClasses")</li>
<li>Take note of the \Package\Dependencies part. In this case it's empty, but any packages listed there should be installed before the package can work.</li>
<li>Create a directory in the packages directory by that name (in this case "C:\Program Files\LiveScratcher\Packages\LiveScratcher.BasicClasses\")</li>
<li>Download the zip file referenced in the XML at \Package\Information\PackageDataURL (in this case <a href="http://www.livescratcher.com/basepackages/BasicClasses.zip" target="_blank">this file</a>)</li>
<li>Extract the zip file to the directory you created earlier. package.xml should be in the root of that directory.</li>
<li>Hurrah! another victory! Now you installed a package!<br />
</li></ul>
<br />
For now, I suggest you just install all packages in the basepackages directory and go from there.<br />
<br />
So now we have a bunch of packages installed, and it still doesn't do anything. Annoying, isn't it ?<br />
So here's where we start scripting <img src="http://www.livescratcher.com/forum/images/smilies/smile.gif" style="vertical-align: middle;" border="0" alt="Smile" title="Smile" /><ul>
<li>Create a new directory in the packages directory, and name it "TestPackage".</li>
<li>In the directory, create a new XML file named "package.xml" with the following contents:<br />
<div class="geshicode_h" style='padding: 5px; background-color: #DFDFDF; border: 1px solid #AAAAAA;'>XML Code
	<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB;'><code><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Package<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Information<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>TestPackage<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Test author<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1.0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>A small test package.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Information<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Contents<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Main.js<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Contents<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Dependencies<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>LiveScratcher.Console<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Dependencies<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Package<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></code></div><br /></div></li>
<li>Create a JS file named "Main.js" with the following contents:<br />
<div class="geshicode_h" style='padding: 5px; background-color: #DFDFDF; border: 1px solid #AAAAAA;'>JAVASCRIPT Code
	<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB;'><code><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> getGlobal<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> registerDependencies<span style="color: #009900;">&#40;</span>packageapi<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> g<span style="color: #339933;">=</span>getGlobal<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> dependencies<span style="color: #339933;">=</span>packageapi.<span style="color: #660066;">getDependencies</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #000066; font-weight: bold;">in</span> dependencies<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span>dependencies<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> shortname<span style="color: #339933;">=</span><span style="color: #000066;">name</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">pop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		g<span style="color: #009900;">&#91;</span>shortname<span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span>packageapi.<span style="color: #660066;">getExport</span><span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onInitialize<span style="color: #009900;">&#40;</span>packageapi<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	registerDependencies<span style="color: #009900;">&#40;</span>packageapi<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Console.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Console.<span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Hello world!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></code></div><br /></div></li>
<li>Re-start messenger</li>
<li>You should now be greeted with a text window saying "Hello world!" <img src="http://www.livescratcher.com/forum/images/smilies/smile.gif" style="vertical-align: middle;" border="0" alt="Smile" title="Smile" /><br />
</li></ul>
<br />
Well, that's the basics. One last trick, if you hold the left alt, shift, and control keys while messenger is starting, LiveScratcher will not be loaded (it'll beep quickly once it's skipped). That should come in handy when testing, for example you could run one messenger instance without LiveScratcher to chat, and have another one that you're constantly restarting to test stuff <img src="http://www.livescratcher.com/forum/images/smilies/tongue.gif" style="vertical-align: middle;" border="0" alt="Tongue" title="Tongue" /><br />
<br />
On a final note: If you're ever uncertain about something, want to know something about a package, or want to know about what's coming up, please do not hesitate to ask on these forums.]]></description>
			<content:encoded><![CDATA[So here it is. LiveScratcher. Nowhere near ready, but open for public testing nevertheless.<br />
<br />
First off: If you're not a scripter/developer, and don't intend to be, go away now <img src="http://www.livescratcher.com/forum/images/smilies/tongue.gif" style="vertical-align: middle;" border="0" alt="Tongue" title="Tongue" /> shoo! This is really not intended to be of any use to normal users. It's also not some kind of continuation of StuffPlug, so don't bother if you're looking for that.<br />
<br />
Good, you're still reading. That means you must either be a developer, or a very stubborn user intending to be one some day. So let's get started. There is no installer yet (and it isn't too high on my priority list either, so don't wait up for one), so you'll have to do this all manually. And it's all modular, so it might take a little effort to get all packages in place, sorry about that <img src="http://www.livescratcher.com/forum/images/smilies/wink.gif" style="vertical-align: middle;" border="0" alt="Wink" title="Wink" /><br />
<br />
First, let's install the base system:<ul>
<li>Get <a href="http://www.livescratcher.com/basepackages/base.zip" target="_blank">base.zip</a>.</li>
<li>Unzip it to "C:\Program Files\LiveScratcher\" or another directory of your liking (in all documentation I'll assume you have it installed in the default directory, you'll have to adjust the paths yourself)</li>
<li>Move the "msacm32.dll" file to your messenger directory (mostly "C:\Program Files\Windows Live\Messenger\". If you've previously installed StuffPlug3, it should already be there</li>
<li>Open regedit (start-&gt;run-&gt;regedit)  and go to HKEY_LOCAL_MACHINE\Software\iAvatars.com\CooperativeLoader. if it doesn't exist, create it.</li>
<li>Create a new string value with the name "LiveScratcher" and the value "C:\Program Files\LiveScratcher\Preloader.LiveScratcher.dll".</li>
<li>Congratulations! LiveScratcher should now be set up!<br />
</li></ul>
<br />
Now, remember that part about LiveScratcher being modular? Yeah, turns out that LiveScratcher by itself isn't much use. At all. It does nothing. So how do I make it useful? Add packages! <img src="http://www.livescratcher.com/forum/images/smilies/smile.gif" style="vertical-align: middle;" border="0" alt="Smile" title="Smile" /><br />
All base packages can be found <a href="http://www.livescratcher.com/basepackages/" target="_blank">here</a><br />
So how do I install a package? Here's how:<ul>
<li>Open the XML file (e.g. BasicClasses.xml). If only text shows up (for example, when using Google Chrome) right-click and hit view source.</li>
<li>Note the name (it's in Package\Information\Name, in this case "LiveScratcher.BasicClasses")</li>
<li>Take note of the \Package\Dependencies part. In this case it's empty, but any packages listed there should be installed before the package can work.</li>
<li>Create a directory in the packages directory by that name (in this case "C:\Program Files\LiveScratcher\Packages\LiveScratcher.BasicClasses\")</li>
<li>Download the zip file referenced in the XML at \Package\Information\PackageDataURL (in this case <a href="http://www.livescratcher.com/basepackages/BasicClasses.zip" target="_blank">this file</a>)</li>
<li>Extract the zip file to the directory you created earlier. package.xml should be in the root of that directory.</li>
<li>Hurrah! another victory! Now you installed a package!<br />
</li></ul>
<br />
For now, I suggest you just install all packages in the basepackages directory and go from there.<br />
<br />
So now we have a bunch of packages installed, and it still doesn't do anything. Annoying, isn't it ?<br />
So here's where we start scripting <img src="http://www.livescratcher.com/forum/images/smilies/smile.gif" style="vertical-align: middle;" border="0" alt="Smile" title="Smile" /><ul>
<li>Create a new directory in the packages directory, and name it "TestPackage".</li>
<li>In the directory, create a new XML file named "package.xml" with the following contents:<br />
<div class="geshicode_h" style='padding: 5px; background-color: #DFDFDF; border: 1px solid #AAAAAA;'>XML Code
	<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB;'><code><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Package<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Information<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>TestPackage<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Test author<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1.0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>A small test package.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Information<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Contents<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Main.js<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Contents<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Dependencies<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>LiveScratcher.Console<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Dependencies<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Package<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></code></div><br /></div></li>
<li>Create a JS file named "Main.js" with the following contents:<br />
<div class="geshicode_h" style='padding: 5px; background-color: #DFDFDF; border: 1px solid #AAAAAA;'>JAVASCRIPT Code
	<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB;'><code><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> getGlobal<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> registerDependencies<span style="color: #009900;">&#40;</span>packageapi<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> g<span style="color: #339933;">=</span>getGlobal<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> dependencies<span style="color: #339933;">=</span>packageapi.<span style="color: #660066;">getDependencies</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #000066; font-weight: bold;">in</span> dependencies<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span>dependencies<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> shortname<span style="color: #339933;">=</span><span style="color: #000066;">name</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">pop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		g<span style="color: #009900;">&#91;</span>shortname<span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span>packageapi.<span style="color: #660066;">getExport</span><span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onInitialize<span style="color: #009900;">&#40;</span>packageapi<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	registerDependencies<span style="color: #009900;">&#40;</span>packageapi<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Console.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Console.<span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Hello world!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></code></div><br /></div></li>
<li>Re-start messenger</li>
<li>You should now be greeted with a text window saying "Hello world!" <img src="http://www.livescratcher.com/forum/images/smilies/smile.gif" style="vertical-align: middle;" border="0" alt="Smile" title="Smile" /><br />
</li></ul>
<br />
Well, that's the basics. One last trick, if you hold the left alt, shift, and control keys while messenger is starting, LiveScratcher will not be loaded (it'll beep quickly once it's skipped). That should come in handy when testing, for example you could run one messenger instance without LiveScratcher to chat, and have another one that you're constantly restarting to test stuff <img src="http://www.livescratcher.com/forum/images/smilies/tongue.gif" style="vertical-align: middle;" border="0" alt="Tongue" title="Tongue" /><br />
<br />
On a final note: If you're ever uncertain about something, want to know something about a package, or want to know about what's coming up, please do not hesitate to ask on these forums.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[LiveScratcher.Messenger]]></title>
			<link>http://www.livescratcher.com/forum/showthread.php?tid=1</link>
			<pubDate>Fri, 17 Jul 2009 04:54:02 -0400</pubDate>
			<guid isPermaLink="false">http://www.livescratcher.com/forum/showthread.php?tid=1</guid>
			<description><![CDATA[The Messenger package contains 4 object types, and 1 event handler type. Here is a quick list of the types and their functions/properties, and a quick example below.<br />
<ul>
<li>Messenger<ul>
<li>autoSignin()</li>
<li>signout()</li>
<li>openConversation(contact) //contact can be either a Contact object or a string email-address</li>
<li>getContact(contact) //contact can be a string or a Contact object (in which case the same contact is returned)</li>
<li>version //string, e.g. "14.0.1234", read only</li>
<li>versionComparable //number representation of version (major&lt;&lt;24 | minor &lt;&lt;16 | build), can be compared like numbers, read only</li>
<li>versionMajor //number, e.g. 14, read-only</li>
<li>versionMinor //number, e.g. 0, read-only</li>
<li>versionBuild //number, e.g. 1234, read-only</li>
<li>getConversations() //returns Array of Conversation objects</li>
<li>receiveFileDirectory //string, directory for received files</li>
<li>getContactList() //returns Array of Contact objects, contact list</li>
<li>myEmail //string, Current user e-mail address, read-only</li>
<li>mySigninName //Same as above</li>
<li>myStatus //Status object indicating your current status, read-write</li>
<li>myFriendlyName //String, current friendly name, read-write</li>
<li>myPersonalStatusMessage //String, current PSM, read-write</li>
<li>myCurrentMedia //String, current media, read-write</li>
<li>myDisplayPicture //String, path to current display picture, read-write</li>
<li>contactListWndHandle //Number, HWND to contact list, read-only</li>
<li>isInitialized //Boolean, indicates if messenger is loaded. read-only</li>
<li>addEventHandler(object) //Add event handler, returns a cookie that should be kept for removeEventHandler</li>
<li>removeEventHandler(cookie) //Remove previously added event handler</li>
<li>showToast(object) //Shows a toast, might crash if used too early. Use carefully before sign-in, see below for properties the object should have.</li>
<li>Contact //Contact constructor, new Messenger.Contact("test@test.com) is same as Messenger.getContact</li>
<li>Conversation //Conversation constructor, only useful for (x instanceof Messenger.Conversation)</li>
<li>Status //Status constructor, use for x instanceof Messenger.Status</li>
<li>Status.Online //All statusses to compare to. All statusses should be here, use for (var i in Messenger.Status) Console.print(i); to get all.</li>
<li>Status["Online"&#93; //Same as above<br />
</li></ul></li>
<li>Contact (All properties are read-only with the exception of isBlocked)<ul>
<li>signinName //Sign-in name, same as e-mail address except for Yahoo contacts, where it's yahoo:email@address.com</li>
<li>email //String</li>
<li>friendlyName //String</li>
<li>personalStatusMessage //String</li>
<li>currentMedia //String</li>
<li>displayPicture //String</li>
<li>isBlocked //Boolean, read-write</li>
<li>status //Status object<br />
</li></ul></li>
<li>Conversation<ul>
<li>sendText(text)</li>
<li>inviteParticipant(contact) //Should be Contact object or string</li>
<li>getParticipants() //Returns Array of Contact's</li>
<li>close()</li>
<li>wndHandle //Number, read-only<br />
</li></ul></li>
<li>Status (all properties read-only)<ul>
<li>name //String, e.g. "Be right back"</li>
<li>protocolName //String, e.g. "BRB"</li>
<li>isLocal //Boolean, is this a local-only status like Appear offline or Findig server?</li>
<li>isSignedin //Is this status signed in?</li>
<li>isAvailable //Is this status equivalent to the WLM9 available?</li>
<li>isBusy //See above</li>
<li>isAway //See above<br />
</li></ul></li>
<li>Events (an event handler can contain the following functions)<ul>
<li>onInitialize()</li>
<li>onDeinitialize()</li>
<li>onSigninStart(email)</li>
<li>onSignedin()</li>
<li>onSigninFailed()</li>
<li>onSignout</li>
<li>onContactListAdded(contact)</li>
<li>onContactListRemoved(contact)</li>
<li>onConversationCreated(conversation)</li>
<li>onConversationDestroyed(conversation)</li>
<li>onMyStatusChanged(status)</li>
<li>onMyFriendlyNameChanged(name)</li>
<li>onMyPersonalStatusMessageChanged(psm)</li>
<li>onMyCurrentMediaChanged(media)</li>
<li>onContactFriendlyNameChanged(contact,name)</li>
<li>onContactPersonalStatusMessageChanged(contact,psm)</li>
<li>onContactCurrentMediaChanged(contact,media)</li>
<li>onContactSignedin(contact)</li>
<li>onContactSignedout(contact)</li>
<li>onContactStatusChanged(contact,status)</li>
<li>onContactBlocked(contact)</li>
<li>onContactUnblocked(contact)</li>
<li>onConversationContactJoin(conversation,contact)</li>
<li>onConversationContactLeave(conversation,contact)<br />
</li></ul></li>
<li>Toast-object (A toast object should contain the following properties or functions)<ul>
<li>text //String, text for on the toast</li>
<li>clickCmd //String, possible URL/Program that should be executed when clicked</li>
<li>optionsCmd //String, possible URL/Program that should be executed when "Options" is clicked</li>
<li>onClosed(reason) //reason is a string reason why the toast was closed</li>
<li>onClicked() //Toast was clicked</li>
<li>onOptionsClicked() //"Options" link on toast was clicked.<br />
</li></ul>
</li></ul>
<br />
Example: (don't forget to add LiveScratcher.Console and LiveScratcher.Messenger as dependencies)<br />
<div class="geshicode_h" style='padding: 5px; background-color: #DFDFDF; border: 1px solid #AAAAAA;'>JAVASCRIPT Code
	<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB;'><code><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//Global functions</span>
<span style="color: #003366; font-weight: bold;">function</span> getGlobal<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> registerDependencies<span style="color: #009900;">&#40;</span>packageapi<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> g<span style="color: #339933;">=</span>getGlobal<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> dependencies<span style="color: #339933;">=</span>packageapi.<span style="color: #660066;">getDependencies</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #000066; font-weight: bold;">in</span> dependencies<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span>dependencies<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> shortname<span style="color: #339933;">=</span><span style="color: #000066;">name</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">pop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		g<span style="color: #009900;">&#91;</span>shortname<span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span>packageapi.<span style="color: #660066;">getExport</span><span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #006600; font-style: italic;">//Signout toast</span>
<span style="color: #003366; font-weight: bold;">function</span> SignoutToast<span style="color: #009900;">&#40;</span>contact<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">contact</span><span style="color: #339933;">=</span>contact<span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">text</span><span style="color: #339933;">=</span>contact.<span style="color: #660066;">friendlyName</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; has just signed out.&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
SignoutToast.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">onOptionsClicked</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	Console.<span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Can't do that yet, sorry!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
SignoutToast.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">onClicked</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	Messenger.<span style="color: #660066;">openConversation</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">contact</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//Messenger events</span>
<span style="color: #003366; font-weight: bold;">function</span> MessengerEvents<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
MessengerEvents.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">onInitialize</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	Console.<span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Messenger version &quot;</span><span style="color: #339933;">+</span>Messenger.<span style="color: #660066;">version</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; initialized&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
MessengerEvents.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">onSignedin</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	Console.<span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Hello &quot;</span><span style="color: #339933;">+</span>Messenger.<span style="color: #660066;">myFriendlyName</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
MessengerEvents.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">onContactSignedout</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>contact<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	Messenger.<span style="color: #660066;">showToast</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> SignoutToast<span style="color: #009900;">&#40;</span>contact<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #006600; font-style: italic;">//Initialize function</span>
<span style="color: #003366; font-weight: bold;">var</span> MessengerEventsCookie<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">function</span> onInitialize<span style="color: #009900;">&#40;</span>packageapi<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	registerDependencies<span style="color: #009900;">&#40;</span>packageapi<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	MessengerEventsCookie<span style="color: #339933;">=</span>Messenger.<span style="color: #660066;">addEventHandler</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> MessengerEvents<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onDeinitialize<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	Messenger.<span style="color: #660066;">removeEventHandler</span><span style="color: #009900;">&#40;</span>MessengerEventsCookie<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></code></div><br /></div>]]></description>
			<content:encoded><![CDATA[The Messenger package contains 4 object types, and 1 event handler type. Here is a quick list of the types and their functions/properties, and a quick example below.<br />
<ul>
<li>Messenger<ul>
<li>autoSignin()</li>
<li>signout()</li>
<li>openConversation(contact) //contact can be either a Contact object or a string email-address</li>
<li>getContact(contact) //contact can be a string or a Contact object (in which case the same contact is returned)</li>
<li>version //string, e.g. "14.0.1234", read only</li>
<li>versionComparable //number representation of version (major&lt;&lt;24 | minor &lt;&lt;16 | build), can be compared like numbers, read only</li>
<li>versionMajor //number, e.g. 14, read-only</li>
<li>versionMinor //number, e.g. 0, read-only</li>
<li>versionBuild //number, e.g. 1234, read-only</li>
<li>getConversations() //returns Array of Conversation objects</li>
<li>receiveFileDirectory //string, directory for received files</li>
<li>getContactList() //returns Array of Contact objects, contact list</li>
<li>myEmail //string, Current user e-mail address, read-only</li>
<li>mySigninName //Same as above</li>
<li>myStatus //Status object indicating your current status, read-write</li>
<li>myFriendlyName //String, current friendly name, read-write</li>
<li>myPersonalStatusMessage //String, current PSM, read-write</li>
<li>myCurrentMedia //String, current media, read-write</li>
<li>myDisplayPicture //String, path to current display picture, read-write</li>
<li>contactListWndHandle //Number, HWND to contact list, read-only</li>
<li>isInitialized //Boolean, indicates if messenger is loaded. read-only</li>
<li>addEventHandler(object) //Add event handler, returns a cookie that should be kept for removeEventHandler</li>
<li>removeEventHandler(cookie) //Remove previously added event handler</li>
<li>showToast(object) //Shows a toast, might crash if used too early. Use carefully before sign-in, see below for properties the object should have.</li>
<li>Contact //Contact constructor, new Messenger.Contact("test@test.com) is same as Messenger.getContact</li>
<li>Conversation //Conversation constructor, only useful for (x instanceof Messenger.Conversation)</li>
<li>Status //Status constructor, use for x instanceof Messenger.Status</li>
<li>Status.Online //All statusses to compare to. All statusses should be here, use for (var i in Messenger.Status) Console.print(i); to get all.</li>
<li>Status["Online"] //Same as above<br />
</li></ul></li>
<li>Contact (All properties are read-only with the exception of isBlocked)<ul>
<li>signinName //Sign-in name, same as e-mail address except for Yahoo contacts, where it's yahoo:email@address.com</li>
<li>email //String</li>
<li>friendlyName //String</li>
<li>personalStatusMessage //String</li>
<li>currentMedia //String</li>
<li>displayPicture //String</li>
<li>isBlocked //Boolean, read-write</li>
<li>status //Status object<br />
</li></ul></li>
<li>Conversation<ul>
<li>sendText(text)</li>
<li>inviteParticipant(contact) //Should be Contact object or string</li>
<li>getParticipants() //Returns Array of Contact's</li>
<li>close()</li>
<li>wndHandle //Number, read-only<br />
</li></ul></li>
<li>Status (all properties read-only)<ul>
<li>name //String, e.g. "Be right back"</li>
<li>protocolName //String, e.g. "BRB"</li>
<li>isLocal //Boolean, is this a local-only status like Appear offline or Findig server?</li>
<li>isSignedin //Is this status signed in?</li>
<li>isAvailable //Is this status equivalent to the WLM9 available?</li>
<li>isBusy //See above</li>
<li>isAway //See above<br />
</li></ul></li>
<li>Events (an event handler can contain the following functions)<ul>
<li>onInitialize()</li>
<li>onDeinitialize()</li>
<li>onSigninStart(email)</li>
<li>onSignedin()</li>
<li>onSigninFailed()</li>
<li>onSignout</li>
<li>onContactListAdded(contact)</li>
<li>onContactListRemoved(contact)</li>
<li>onConversationCreated(conversation)</li>
<li>onConversationDestroyed(conversation)</li>
<li>onMyStatusChanged(status)</li>
<li>onMyFriendlyNameChanged(name)</li>
<li>onMyPersonalStatusMessageChanged(psm)</li>
<li>onMyCurrentMediaChanged(media)</li>
<li>onContactFriendlyNameChanged(contact,name)</li>
<li>onContactPersonalStatusMessageChanged(contact,psm)</li>
<li>onContactCurrentMediaChanged(contact,media)</li>
<li>onContactSignedin(contact)</li>
<li>onContactSignedout(contact)</li>
<li>onContactStatusChanged(contact,status)</li>
<li>onContactBlocked(contact)</li>
<li>onContactUnblocked(contact)</li>
<li>onConversationContactJoin(conversation,contact)</li>
<li>onConversationContactLeave(conversation,contact)<br />
</li></ul></li>
<li>Toast-object (A toast object should contain the following properties or functions)<ul>
<li>text //String, text for on the toast</li>
<li>clickCmd //String, possible URL/Program that should be executed when clicked</li>
<li>optionsCmd //String, possible URL/Program that should be executed when "Options" is clicked</li>
<li>onClosed(reason) //reason is a string reason why the toast was closed</li>
<li>onClicked() //Toast was clicked</li>
<li>onOptionsClicked() //"Options" link on toast was clicked.<br />
</li></ul>
</li></ul>
<br />
Example: (don't forget to add LiveScratcher.Console and LiveScratcher.Messenger as dependencies)<br />
<div class="geshicode_h" style='padding: 5px; background-color: #DFDFDF; border: 1px solid #AAAAAA;'>JAVASCRIPT Code
	<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB;'><code><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//Global functions</span>
<span style="color: #003366; font-weight: bold;">function</span> getGlobal<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> registerDependencies<span style="color: #009900;">&#40;</span>packageapi<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> g<span style="color: #339933;">=</span>getGlobal<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> dependencies<span style="color: #339933;">=</span>packageapi.<span style="color: #660066;">getDependencies</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #000066; font-weight: bold;">in</span> dependencies<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span>dependencies<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> shortname<span style="color: #339933;">=</span><span style="color: #000066;">name</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">pop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		g<span style="color: #009900;">&#91;</span>shortname<span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span>packageapi.<span style="color: #660066;">getExport</span><span style="color: #009900;">&#40;</span><span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #006600; font-style: italic;">//Signout toast</span>
<span style="color: #003366; font-weight: bold;">function</span> SignoutToast<span style="color: #009900;">&#40;</span>contact<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">contact</span><span style="color: #339933;">=</span>contact<span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">text</span><span style="color: #339933;">=</span>contact.<span style="color: #660066;">friendlyName</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; has just signed out.&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
SignoutToast.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">onOptionsClicked</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	Console.<span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Can't do that yet, sorry!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
SignoutToast.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">onClicked</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	Messenger.<span style="color: #660066;">openConversation</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">contact</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//Messenger events</span>
<span style="color: #003366; font-weight: bold;">function</span> MessengerEvents<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
MessengerEvents.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">onInitialize</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	Console.<span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Messenger version &quot;</span><span style="color: #339933;">+</span>Messenger.<span style="color: #660066;">version</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot; initialized&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
MessengerEvents.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">onSignedin</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	Console.<span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Hello &quot;</span><span style="color: #339933;">+</span>Messenger.<span style="color: #660066;">myFriendlyName</span><span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
MessengerEvents.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">onContactSignedout</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>contact<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	Messenger.<span style="color: #660066;">showToast</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> SignoutToast<span style="color: #009900;">&#40;</span>contact<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #006600; font-style: italic;">//Initialize function</span>
<span style="color: #003366; font-weight: bold;">var</span> MessengerEventsCookie<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">function</span> onInitialize<span style="color: #009900;">&#40;</span>packageapi<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	registerDependencies<span style="color: #009900;">&#40;</span>packageapi<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	MessengerEventsCookie<span style="color: #339933;">=</span>Messenger.<span style="color: #660066;">addEventHandler</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> MessengerEvents<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> onDeinitialize<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	Messenger.<span style="color: #660066;">removeEventHandler</span><span style="color: #009900;">&#40;</span>MessengerEventsCookie<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></code></div><br /></div>]]></content:encoded>
		</item>
	</channel>
</rss>