Prompt Woes

Posted by Kairuni on Mon 30 Aug 2010 09:41 AM — 3 posts, 16,706 views.

#0
Been trying to help out someone who's blind with an interesting problem that they're having with their screenreader, for the past few days.

Without 'Convert IAC EOR/GA to new line' checked while playing IRE MUDs (Achaea/etc), the prompt line is not parsed for trigger matches until the next line comes in.

He has been using this to gag the prompt, but still have it at the bottom of the output so he can check his health, mana, endurance, and willpower.

Unfortunately, with how the IRE MUDs work, you often want to pull data from the prompt, and the difference between the time his triggers can pull data from the prompt and the time it takes him to hear his health can fairly easily get him killed.

DeleteLines cannot be called from a plugin callback, else I would simply delete a line if the prompt was the most recently displayed when one is received, or a packet is received, and using DeleteLines when you receive a line just deletes that line, not the one before it.

Goal is to keep the prompt at the bottom, but still allow it to be used for scripting purposes.

Any ideas?
Amended on Mon 30 Aug 2010 09:14 PM by Kairuni
Australia Forum Administrator #1
Well first I would enable the EOR/GA stuff. That way the trigger matches.

Second I would have some sort of trigger that matches the prompt, and simply reads out when the health changes (based on what it was before). Eg. "gained 5 hp"
Netherlands #2
Edit: Note to self - read the full topic instead of briefly skimming it. Still, it might be of some use.

I wrote a plugin for this same problem ages ago, be it for Aetolia.

It assumes prompts start out like H:1234 M:567. Assuming prompts are the same, you should be able to use it without a problem, but if they are not, you might want to change the trigger inside the plugin to match your prompt. If you do not know how to, feel free to ask here.

Template:saveplugin=PromptFix
To save and install the PromptFix plugin do this:
  1. Copy the code below (in the code box) to the Clipboard
  2. Open a text editor (such as Notepad) and paste the plugin code into it
  3. Save to disk on your PC, preferably in your plugins directory, as PromptFix.xml
    • The "plugins" directory is usually under the "worlds" directory inside where you installed MUSHclient.
  4. Go to the MUSHclient File menu -> Plugins
  5. Click "Add"
  6. Choose the file PromptFix.xml (which you just saved in step 3) as a plugin
  7. Click "Close"
  8. Save your world file, so that the plugin loads next time you open it.


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>

<muclient>
<plugin
   name="PromptFix"
   author="Worstje"
   id="2d63e3c55b2caec463c4e891"
   language="Lua"
   purpose="Fixing blank lines directly after a prompt."
   save_state="y"
   date_written="2007-02-28 21:34:19"
   requires="3.70"
   version="1.0"
   >

<description trim="y">
<![CDATA[

While the Configuration, Output, "Convert IAC EOR/GA to new line" setting makes
it possible to trigger on the prompt in MUSHclient, it also creates extra blank
lines as a by-product. This plugin fixes that.

Note: The option "Regular Expressions can match on an empty string", which can
be found under the "Global Preferences" General tab needs to be checked for
this plugin to work.

]]>
</description>

</plugin>

<triggers>
 <trigger
  enabled="y"
  keep_evaluating="y"
  match="^H\:([0-9]+) M\:([0-9]+) "
  regexp="y"
  script="GotPrompt"
  sequence="0"
 >
 </trigger>
 <trigger
  keep_evaluating="y"
  match=".*"
  name="got_other_line"
  regexp="y"
  script="GotOtherLine"
  group="prompt_cleanup"
  sequence="2"
 >
 </trigger>
 <trigger
  match="^$"
  name="empty_line"
  omit_from_output="y"
  regexp="y"
  script="GotEmptyLine"
  group="prompt_cleanup"
  sequence="1"
 >
 </trigger>
</triggers>

<!--  Script  -->

<script>
<![CDATA[

function GotPrompt(name, line, wildcs)
	world.EnableTriggerGroup("prompt_cleanup", 1)
end

function GotEmptyLine(name, line, wildcs)
	world.EnableTriggerGroup("prompt_cleanup", 0)
end -- GotEmptyLine

function GotOtherLine(name, line, wildcs)
	world.EnableTriggerGroup("prompt_cleanup", 0)
end -- GotOtherLine

]]>
</script>

</muclient>