<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Monday, July 09, 2007, 5:15 PM -->
<!-- MuClient version 4.01 -->

<!-- Plugin "TTS_jFW" generated by Plugin Wizard -->

<!--
Features to add: 
reading of chat.
Ability to make certain strings interrupt.
-->

<muclient>
<plugin
   name="TTS_jFW"
   author="Tyler Spivey/Oriol Gomez"
   id="d56716d986c08af57cb69f34"
   language="VBscript"
   purpose="Enables Your primary TTS system to become JFW"
   date_written="2008-11-20 09:41:14"
   requires="4.01"
   version="2.0"
   >
<description trim="y">
<![CDATA[
This Plugin lets you use JFW (or JAWS) as your primary text-to-speech system with MUSHclient.  it has one command, TTS, which you can type in a world to toggle reading of new text.
The plugin currently reads inbound text from your connected world, and tab-completion.  It will work even if you are outside of the MUSHclient window.
]]>
</description>

</plugin>


<!--  Get our standard constants -->

<include name="constants.vbs"/>

<!--  Aliases  -->

<aliases>
  <alias
   match="tts_stop"
   enabled="y"
   send_to="12"
   sequence="100"
  >
<send>TTSObject.StopSpeech</send>
  </alias>
  <alias
   match="tts_interrupt *"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>ttsObject.SayString "      %1",1</send>
  </alias>
<alias
   match="tts_note *"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>ttsObject.SayString "      %1",0</send>
  </alias>

  <alias
   script="TTSToggle"
   match="tts"
   enabled="y"
   group="TTS"
   omit_from_command_history="y"
   omit_from_log="y"
   omit_from_output="y"
   sequence="100"
  >
  </alias>
</aliases>

<!--  Script  -->


<script>
<![CDATA[
Accelerator "shift+Ctrl+f12", "tts"
'setup some variables - the tts object, and the toggle for reading.
dim TTSObject
dim TTSReadNew
'first decide whether or not to read incoming text, with an alias.
sub TTSToggle (name, line, x)
if TTSReadNew = 1 then
TTSReadNew = 0
TTSObject.sayString "      Incoming text will not be read.", 1
else
TTSReadNew = 1
TTSObject.sayString "      Incoming text will now be read.",1
end if
end sub
'when the plugIn is first installed, initiate the tts.
sub OnPluginInstall
on error resume next
set TTSObject = CreateObject("FreedomSci.JawsAPI")
if err.number <> 0 then
set TTSObject = CreateObject("jfwapi")
end if
on error goto 0
TTSObject.sayString "      TTS ready.  Using JAWS.",1
TTSReadNew = 1
end sub
'this event fires when new text is drawn from the mud.
sub OnPluginScreendraw (t, log, line)
if (t = 0 or t = 1)  and TTSReadNew = 1 then
TTSObject.sayString "      " & line, 0
end if
end sub
'this event is called when a broadcastPlugin event occurs.
sub OnPluginBroadcast (msg, id, name, text)
if msg = 887then
TTSObject.sayString "      " & text,0
elseIf msg = 8874 then
TTSObject.sayString "      " & text,1
end if
end sub

'this event is called when the user presses tab and a completion is called.
sub onPluginTabComplete(s)
TTSObject.sayString "      " & s, 0
end sub
]]>
</script>


<!--  Plugin help  -->

<aliases>
  <alias
   script="OnHelp"
   match="TTS_jFW:help"
   enabled="y"
  >
  </alias>
</aliases>

<script>
<![CDATA[
Sub OnHelp (sName, sLine, wildcards)
  world.Note world.GetPluginInfo (world.GetPluginID, 3)
End Sub
]]>
</script> 

</muclient>