[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  Speaking MUD text

Speaking MUD text

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Pages: 1  2 

Posted by Thellasian   (9 posts)  [Biography] bio
Date Reply #15 on Thu 16 Apr 2009 05:13 PM (UTC)
Message
Hmm, how about this. Is it possible to create a trigger that sends a specific line that the server sends me to a different window in MUSH. and set the plugin to only run on that second window? So that when it sees (Web): on the screen it sends over to Window 2..and then the Reader reads it from that screen only?
[Go to top] top

Posted by Nick Gammon   Australia  (23,000 posts)  [Biography] bio   Forum Administrator
Date Reply #16 on Fri 17 Apr 2009 10:55 AM (UTC)
Message
I suppose, but I think this sounds like more work than simply making a trigger that speaks the lines you want, and omit the line that speaks everything that comes in.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Thellasian   (9 posts)  [Biography] bio
Date Reply #17 on Sat 18 Apr 2009 01:00 AM (UTC)
Message
hmm. The pulgin doesnt like to see lines that do not include the trigger file. Any line entered brings up a error....
[Go to top] top

Posted by Thellasian   (9 posts)  [Biography] bio
Date Reply #18 on Sat 18 Apr 2009 01:18 AM (UTC)
Message
fixed it..new error:
[string "Trigger: "]:1: '=' expected near '<eof>'


New Script:


</plugin>

<!-- Triggers -->

<aliases>
<alias script="togglespeaking" match="jfw" enabled="y" group="speech" omit_from_command_history="y" omit_from_log="y" omit_from_output="y" sequence="100">
</alias>
</aliases>

<triggers>
</triggers>

<!-- Script -->


<script>
<![CDATA[

dim sapiobject
dim speak 'do we want to speak?


sub toggleSpeaking (name, line, wc)
if speak = 1 then
speak = 0
sapiobject.Speak "sapi auto speak off.", 1
else
speak = 1
sapiobject.Speak "sapi auto speak on.",1
end if
end sub

sub OnPluginInstall
set sapiobject = CreateObject("SAPI.SpVoice")
sapiobject.Speak "sapi speaker is ready to rock!",1
speak = 1
end sub


sub OnPluginBroadcast (msg, id, name, text)
if msg = 222 then
sapiobject.Speak "%1",1
end if
end sub
]]>
</script>


</muclient>



Trigger:

<triggers>
<trigger
enabled="y"
ignore_case="y"
match="Web"
regexp="y"
send_to="12"
sequence="100"
>
<send>%0</send>
</trigger>
</triggers>


I believe the only prob is telling the trigger WHAT to send...so did %0 to send the whole line to the Sapi program. but thats when the errors appear. it no longer speaks all the time which is what I wanted....
[Go to top] top

Posted by Nick Gammon   Australia  (23,000 posts)  [Biography] bio   Forum Administrator
Date Reply #19 on Sun 19 Apr 2009 11:22 AM (UTC)
Message
You are sending what the MUD sent to script, which will generate script errors. You want to send something like:


sapiobject.Speak "%1",1


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


78,150 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]