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.
 Entire forum ➜ MUSHclient ➜ Suggestions ➜ Plugin Callback

Plugin Callback

Posting of new messages is disabled at present.

Refresh page


Posted by Tspivey   Canada  (54 posts)  Bio
Date Sun 02 Jul 2006 07:11 PM (UTC)
Message
In converting people over to Mushclient, we noticed that tab completion doesn't have a plugin callback. I am suggesting something similar to the following:
A function that takes 2 parameters: the word you typed before pressing tab, and the word that it got replaced with.
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #1 on Mon 03 Jul 2006 06:33 AM (UTC)

Amended on Mon 03 Jul 2006 07:03 AM (UTC) by Nick Gammon

Message
You mean with the option to change that replacement?

eg.


function OnPluginTabCompletion (before, after)

 if before == "foo" then
  return "bar"
 else
  return after
 end -- if

end -- OnPluginTabCompletion 

- Nick Gammon

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

Posted by Sean Randall   United Kingdom  (14 posts)  Bio
Date Reply #2 on Mon 03 Jul 2006 08:08 AM (UTC)
Message
Hi,
new on the scene here but also a blind Mushclient user (or soon to be, just as soon as I figure out the nuances of ShareIt).

Replacing would be nice - but it's like the argument for doing the same with the OnPluginLineReceived function on the plugins page - neat if you could do it, but for blind users who use screen reading software, the power is to intercept and announce the new word, more than changing what it does.

When I first started MUDding, I scripted the screen reader to work with the client.
This meant that you had to be in the clients window all the time, only certain things would be read, any pop-up windows (from the client or other programs) would interfeer, and if you come back to the Mud after answering something else - like an IM - the screen reader would think there'd been an entire redraw of the screen and read absolutely everything again.

Nowadays of course with Mushclient's superb balance of power and ease-of-use, you can script the client to work with the screen reader: I have a Mudding page at my site aimed toward blind users.
I have a feeling the content there will change to Mushclient specific info and or plugins within the next couple of weeks.

Er well sorry for ranting on - first post and all that, so hello and it's nice to be around.
Great program, very friendly to use and I think I've stated my case why I particularly would use the tab completion callback.

Sean.
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #3 on Mon 03 Jul 2006 01:03 PM (UTC)
Message
Ah that makes sense. You simply want to know if you pressed "ki" <tab> whether you will get "kick" or "kill" or something?

I don't see a big problem in doing that. :)

Quote:

I have a Mudding page at my site aimed toward blind users.


I would be interested to read that. Positive feedback is an encouragement to developers to add support to their programs.

BTW, I'm not sure how easy the GUI interface is to use if you can't see much or at all. I never use screen reading software so I have no idea how well it represents dialog boxes with lots of checkbuttons etc.

The ideas presented in this thread might help:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=7123&page=999999

For example, assuming you install into your script space the script ItemToTable (near the bottom of the page), and use the tprint function provided in the supplied exampscript.lua file, then you could simply examine a trigger by typing:


t = ItemToTable ("trigger", "exits")
tprint (t)


In this case my trigger was called "exits". This would display (and thus have read out to you):


"enabled"="y"
"custom_colour"="2"
"name"="exits"
"sequence"="100"
"match"="Obvious exits:"


Now assuming you also install the functions mentioned in the first post on that page, you can change a value (like the enabled flag) and replace the trigger:


t.enabled = false
LuaAddTrigger (t)


This effectively would let you add or modify triggers, aliases and timers using a command-line type interface. I'm not sure if that is easier or not, but the option is there.




To find the names of all your triggers, you can do a simple script in Lua:


table.foreachi (GetTriggerList (), print)


You could start getting fancy and make an alias that gets the trigger list and filters it against a supplied regexp, to filter down to a handful.

- Nick Gammon

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

Posted by Sean Randall   United Kingdom  (14 posts)  Bio
Date Reply #4 on Mon 03 Jul 2006 01:18 PM (UTC)
Message
To be honest, I haven't even made any triggers or aliases yet.

The simple reason is, the only things I've done so far with Mushclient is to program on a MOO - not something that requires extensive tweeking insofar as modifying a client is concerned.

I did write a quick VBScript (I need to learn Lua properly) to send the MOO output to a notepad (listing code with a screen reader tends to rap).
Other than that, I've been limited to useing the nice features of mushclient, without actually needing to write any triggers or such.

I guess the UI would work fine - everything else does, including the plugin wizard and all the configuration screens.
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #5 on Tue 04 Jul 2006 11:13 PM (UTC)
Message
I have added a plugin callback to version 3.75 that has a single argument, the replacement text after tab completion. Basically you can use that to speak the replacement text. You could also modify it if you wanted (eg. by using a dialog box) to change the replacement text.

- Nick Gammon

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

Posted by Tspivey   Canada  (54 posts)  Bio
Date Reply #6 on Wed 05 Jul 2006 12:35 AM (UTC)
Message
Great. Would there be a simple way to get the text before tab completion, also? That'd help with modification.
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #7 on Wed 05 Jul 2006 01:30 AM (UTC)
Message
Quote:

Would there be a simple way to get the text before tab completion, also?


It is fiddly to do because of internal design reasons. If it was desperately needed it could be done, however ...

Quote:

... but for blind users who use screen reading software, the power is to intercept and announce the new word, more than changing what it does ...


It seems to me that the main requirement is to know what the replacement word is. Thus assuming you can't see the screen, and you type "foo<tab>" an announcement that you will get "foot" would help, otherwise, you simply cancel (Ctrl+Z) and type something else.

- Nick Gammon

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

Posted by Sean Randall   United Kingdom  (14 posts)  Bio
Date Reply #8 on Wed 05 Jul 2006 10:50 AM (UTC)
Message
Never have I seen a developer so responsive - fantastic.
Are there betas of 3.75 I can play with, or did I miss an announcement?
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #9 on Wed 05 Jul 2006 09:28 PM (UTC)
Message
Not yet, check the main page of this forum:

http://www.gammon.com.au/forum/bbshowpost.php?bbsection_id=1

That is where new verions are mentioned (near the top), also:

http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=1

The "News and Updates" forum is where the announcement will be made.

Quote:

Would there be a simple way to get the text before tab completion, also?


I have added a couple of new selectors to GetInfo, so that you can find the start and end column of the current selection. If you really wanted to, you could work out what the tab completion text (prior to completion) must be by taking that in conjunction GetCommand.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


26,233 views.

Posting of new messages is disabled at present.

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.