Hacking up a prompt to the keyboard

Posted by Sean Randall on Tue 15 Jan 2008 08:19 PM — 5 posts, 21,554 views.

United Kingdom #0
Hi all,

Several years ago when I used GMud, I modified my screen reader in the following way.
The reader would take a typical MUD prompt segmented in some way (with commas or whatever dividing the stats), and firstly and most importantly not read it. As blind MUDders we don't need our vital information read continuously after each command, it's way too distracting to be useful.
So my solution was to proverbially take each stat of the prompt and throw it into a variable, which could be echoed back via a keypress.

An example:
&90/100 HP,120/120 Mana,250 250 mv&

Note the ampersands - historically I used them to pad the prompt to be sure of a unique value. of course I couldn't use a trigger within the old client because there was no interface with a screen reader. Anyway if I were to press the first of my established keys after all this, I'd hear just the hitpoints echoed back at me and nothing else. Same goes for the next two. And there you had it: real time prompt information with the ability to dip into just the bits you want - skimreading for the blind, of a sort...

I never got to release the code because the average screen reader user did not want to mess about installing it - so now I've hacked up a substitute in MUSHclient.

It works, at present, as a script not a plugin:
  • I add a trigger to capture my prompt in whatever world I'm playing, and pass the name of a VBScript sub in the triggers "script" box.
  • This sub splits up the prompt with a defined character (comma, semicolon, dash or whatever), and puts the resulting text into a numbered sequence of world variables (prompt1, prompt2...).
  • Another sub assigns a constant list of accelerators to echo back those variables. In my text-to-speech plugins I chose a numeric to allow direct speech to be used with BroadcastPlugin. One of my accelerator's might look like:
    Ctrl+1 = /world.broadcastPlugin 8874, world.GetVariable("PromptCapture1")


There are several problems with this set-up I was hoping anyone could advise on:
  1. It's written in VBScript - but I guess that's just what I've grown up with! :(
  2. The accelerators work by virtue of scripting. This requires the scripting language and character be set (and the same) for each world.
  3. If it's turned into a plugIn the variables don't seem to work - i.e. they seem to be set in the plugIn but the accelerator's are trying to call them in the world.


Perhaps I'm missing something supremely obvious - is there a better way of doing what I want to? I envisaged a plugin loaded for any world. But perhaps I'm trying to modularise too far; after all, the trigger is in the world but the processing is in the script.

Anyway, although the thing is a bit of a cludge its there for those blind people who might benefit and those coders who might care to advise me of a decent way to go about upgrading it.

Http://www.randylaptop.com/article/MUSHclient
or directly,
http://www.randylaptop.com/get/MUSHclient/keyboardprompt.vbs
Amended on Tue 15 Jan 2008 08:25 PM by Sean Randall
Australia Forum Administrator #1
Quote:

If it's turned into a plugIn the variables don't seem to work - i.e. they seem to be set in the plugIn but the accelerator's are trying to call them in the world.


This should be easy to get to work as a plugin.

Just have the trigger in the plugin that captures the information (and sets a plugin variable) and an alias which speaks the variables when you want them. Then set up an accelerator to activate the alias.
#2
Nick is too fast for me, but I converted your script into a Lua plugin with an equivalent method to the one he mentioned, and none of the problems/issues you listed.

Though I've no idea what you're doing with your prompt triggers, if you're setting them in the plugin correctly, this should work. I think.

http://www.there.org.uk/folder/keyboardprompt.xml

I think your basic problem with the script you linked to is that Acelerators can only ever have world scope, never plugin scope - the Accelerator is trying to retrieve the variable from the world because that's where the little script snippet is being executed.
Amended on Wed 16 Jan 2008 12:27 AM by Ian Kirker
Australia Forum Administrator #3
Yes, I agree. To put it another way, the plugin should have done the GetVariable, not the accelerator, which is grabbing the world's variable.
United Kingdom #4
Nick and ian,

Thanks much for correcting me. Lua looks like something well worth learning!

I don't actually know how many blind users will find this thing useful - but I do and so sincere thanks to ian for the recode.

Sean.