Added script

This commit is contained in:
Robert MacGregor 2014-09-02 02:13:35 -04:00
parent fa724913e3
commit 18cccdeb7f

View file

@ -0,0 +1,35 @@
function tsExtensionLoop()
{
if (!$TSExtension::isActive)
{
error("TSExtension.cs - Unable to run loop! Is the DLL installed?");
return;
}
if (isEventPending($TSExtension::LastUpdateHandle))
cancel($TSExtension::LastUpdateHandle);
tsExtensionUpdate();
$TSExtension::LastUpdateHandle = schedule(32,0,"tsExtensionLoop");
}
if (!$TSExtension::isActive)
loadMod("TSExtension");
tsExtensionLoop();
// Test
function Whatever::onSocketCreationFailed(%this){ error("Failed to create Socket"); }
function Whatever::onConnectFailed(%this, %wsaError){ error(%wsaError); }
function Whatever::onConnected(%this){ echo("GOOD"); }
function Whatever::onDNSFailed(%this){ error("DNS Failed"); }
function Whatever::onDisconnect(%this){ echo("Disconnected"); }
function Whatever::onLine(%this, %line)
{
echo(%line);
%this.buffer = %this.buffer @ %line;
//if (trim(%line) $= "")
// %this.altDisconnect();
}