Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Plugins ➜ Hacking up a prompt to the keyboard

Hacking up a prompt to the keyboard

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


Posted by Sean Randall   United Kingdom  (14 posts)  Bio
Date Tue 15 Jan 2008 08:19 PM (UTC)

Amended on Tue 15 Jan 2008 08:25 PM (UTC) by Sean Randall

Message
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
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 15 Jan 2008 11:58 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Ian Kirker   (30 posts)  Bio
Date Reply #2 on Wed 16 Jan 2008 12:26 AM (UTC)

Amended on Wed 16 Jan 2008 12:27 AM (UTC) by Ian Kirker

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

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #3 on Wed 16 Jan 2008 01:35 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Sean Randall   United Kingdom  (14 posts)  Bio
Date Reply #4 on Wed 16 Jan 2008 11:31 AM (UTC)
Message
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.
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.


17,110 views.

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

Go to topic:           Search the forum


[Go to top] top

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