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

Gammon Forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Prompt Woes
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Prompt Woes

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


Posted by Kairuni   (8 posts)  [Biography] bio
Date Mon 30 Aug 2010 09:41 AM (UTC)

Amended on Mon 30 Aug 2010 09:14 PM (UTC) by Kairuni

Message
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?
[Go to top] top

Posted by Nick Gammon   Australia  (21,321 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Mon 30 Aug 2010 10:10 AM (UTC)
Message
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"

- Nick Gammon

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

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #2 on Mon 30 Aug 2010 11:14 AM (UTC)

Amended on Mon 30 Aug 2010 11:16 AM (UTC) by Worstje

Message
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 between the lines below (to the Clipboard)
  2. Open a text editor (such as Notepad) and paste the plugin into it
  3. Save to disk on your PC, preferably in your plugins directory, as PromptFix.xml
  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"


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


3,205 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]