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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

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

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Speaking MUD text
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sun 19 Apr 2009 11:22 AM (UTC)  quote  ]
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

Posted by Thellasian   (9 posts)  [Biography] bio
Date Sat 18 Apr 2009 01:18 AM (UTC)  quote  ]
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 Thellasian   (9 posts)  [Biography] bio
Date Sat 18 Apr 2009 01:00 AM (UTC)  quote  ]
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 Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Fri 17 Apr 2009 10:55 AM (UTC)  quote  ]
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 Thu 16 Apr 2009 05:13 PM (UTC)  quote  ]
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 Thellasian   (9 posts)  [Biography] bio
Date Thu 16 Apr 2009 05:10 PM (UTC)  quote  ]
Message
Heh, there in lies the problem. No idea bout triggers in general. I tried to set it using a general <Triggers> <trigger/> command but it refused to apply to that trigger only.
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Thu 16 Apr 2009 07:53 AM (UTC)  quote  ]
Message
I would install SAPI at some stage (eg. in your script file) like this:


set sapiobject = CreateObject("SAPI.SpVoice")




Then make a trigger that does "send to script", which matches the things you want to speak, and in the script:


sapiobject.Speak "%1",1


- Nick Gammon

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

Posted by Thellasian   (9 posts)  [Biography] bio
Date Thu 16 Apr 2009 01:53 AM (UTC)  quote  ]

Amended on Thu 16 Apr 2009 04:26 AM (UTC) by Thellasian

Message
Hmm...Ok im usin what im findin here but im a idiot when it comes to this stuff...For the MUSH can somone make a script that only reads lines after "(Web): #######" where anything after the (WEB): is spoken? Just wanted to try this for fun and after 5 hours im tired and dun wanna mess with it if I dont ahve to. Thanks.

Edit: ohh and im usin Vista if that matters.

2nd edit: I am using the program from http://mushclient.com/mushclient/plugins/sapi.xml To attempt to get it to work. But I cannot seem to figure out how to tell the sub command to only activate on (WEB): promts and repeat what comes after the prompt when recieved from the World. Any ideas?

Example

wt but my triggers arent working.
(Web): You say, "But my triggers arent working."
H:2113 M:1385 B:100% [c eb]


Want reading to start after (Web): and end on ." at the end of the line.......but it likes to start reading at the prompt of H: and end on the end of the line above it.
[Go to top] top

Posted by Onoitsu2   USA  (246 posts)  [Biography] bio
Date Sun 04 Mar 2007 10:22 AM (UTC)  quote  ]

Amended on Sun 04 Mar 2007 10:23 AM (UTC) by Onoitsu2

Message
I do believe that I have made a VERY simple TTS plugin, that can be implemented into virtually ANY scripting scheme, it uses CallPlugin to set the options for a TTS message, and has 2 queues, normal and alert, which will interrupt a normal item and will then replay the interrupted normal item from the beginning. EACH Message can have a different voice and rate, that is set just PRIOR to the actual message to be spoken. So 3 CallPlugin commands in a row in any 1 trigger or alias can mean... Rate Voice Message, Voice Rate Message, Rate Message, Voice Message, or just Message (which will run at default rate 0, and whatever the default voice is set to within the plugin via an alias).

I also have a sub in it that will "Reformat" some symbolic words/meanings and neologisms that are now quite common.

the url is: www.torasin.com/~venificius/MUSHclient_ttsVB.xml

I tried posting it but is 8471 Chars long says SciTE.

You can also get it via my Zip or Installer Versions of my Plugins...

ZIP'd Plugins - www.torasin.com/~venificius/AardwolfMC_Plugins.zip

Installer Version - www.torasin.com/~venificius/Aardwolf_MC_Plugins.exe

THE SERVER IS SADLY VERY CASE SENSITIVE!!!! So please copy the links EXACTLY as I have posted them

Laterzzz,
Onoitsu2
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Fri 02 Mar 2007 04:42 AM (UTC)  quote  ]
Message
You can detect the Lua version from the _VERSION variable, and modify the behaviour of your script slightly accordingly.

- Nick Gammon

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

Posted by Onoitsu2   USA  (246 posts)  [Biography] bio
Date Thu 01 Mar 2007 11:23 PM (UTC)  quote  ]
Message
No I mean 3.74, which is the version I use regularly, and I do so, so that I can guarantee that my plugins will be several versions backwards compatible, as MANY people that use my plugins are still using version between 3.74 and 3.78.

From my understanding from the posts about LUACOM the entry point had been moved between versions 5.0 and 5.1 of LUA, and in that having happened that will require 2 different versions of my plugin then. And that is something I have been able to avoid, even with the slight differences between 5.0 and 5.1 of LUA.

Thanks,
Onoitsu2
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Wed 28 Feb 2007 08:43 PM (UTC)  quote  ]

Amended on Thu 01 Mar 2007 08:40 PM (UTC) by Nick Gammon

Message
Do you mean 3.84? The latest version?

I have positively tested it to work OK under 3.84, using this slightly revised script (changed loadlib to package.loadlib, and the entry point name in the DLL has changed):


assert (package.loadlib ("luacom.dll","luacom_open")) ()

-- Instantiate a SAPI voice object
talk = assert (luacom.CreateObject ("SAPI.SpVoice"), "cannot open SAPI")

-- Method call
talk:Speak ("hi there")


You also need the luacom.dll designed to work with Lua 5.1. That is available in this directory:

http://www.gammon.com.au/files/mushclient/lua5.1_extras/

See the readme.txt file for more details.

- Nick Gammon

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

Posted by Onoitsu2   USA  (246 posts)  [Biography] bio
Date Wed 28 Feb 2007 12:52 PM (UTC)  quote  ]
Message
I am in the process of making a plugin in VBScript, that will allow altering of speed of the text, and also possibly some customization of the voice used.

I am making it in VBScript cause I am unsure if version 3.74 of mushclient will cooperate with the LUA com interface, and if someone can tell me that it positively does, then I will consider converting it into an LUA plugin then.


I will post results when more developed, so probably later tonight :)

Laterzzz,
Onoitsu2
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Fri 09 Jun 2006 05:38 AM (UTC)  quote  ]
Message
Quote:

P.S. I am confused - doesn't asynchronous mean "do in order", as opposed to "do in parallel"? In other words, doesn't async in this context mean exactly the opposite of what it really means?


It means "not synchronized" - that is, the speech (in this case) is not synchronized to waiting for the command to end.

I looked up the definition in Google, and this was part of the answer:


Refers to events that are not synchronized, or coordinated, in time. ... Starting the next operation before the current one is completed.


- Nick Gammon

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

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Thu 01 Jun 2006 09:29 PM (UTC)  quote  ]
Message
Yes, destroying the object with "talk = 0" probably makes it hard for it to do asynchronous speaking.

The method I used in the other post, using Lua, shows how you just create the object the first time you need it.

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=6593

- 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.


13,269 views.

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

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]