[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]  Strange trigger with prompt behavior?
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Strange trigger with prompt behavior?

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


Posted by Accolades   (6 posts)  [Biography] bio
Date Thu 18 Jul 2002 02:54 AM (UTC)
Message
Hey guys, I'm still on my quest to write code for my own external application for use with MUSHclient, although I've come across a strange occurance when setting up triggers.

The MUD I'm using for this is called "Act of War" It is your stereo-typical Diku-style MUD with those annoying prompts that flood your screen with your current HP/Mana/Movement, my goal is to code this into an external application so that I can get rid of the prompt. Unfortunately, when I try to Trigger on the prompt ( in this case lets just say <100hp 106mn 100mv> )

My trigger might look like <*hp*mn*mv> however, when I activate the trigger, it doesn't work as I expect. It DOES capture the prompt text I like, and it actually forces the prompt to act sort of like a prompt SHOULD act (ie. the prompt stays on the bottom of the output window instead of flooding it) I DO have "omit from output" selected, but something is very wrong. It's allowing the prompt to pass anyways. Any ideas on what might be going on here?

Thanks in advance
- Tim -
[Go to top] top

Posted by Magnum   Canada  (580 posts)  [Biography] bio
Date Reply #1 on Thu 18 Jul 2002 03:08 AM (UTC)
Message
Heh... I tried out a SMAUG based mud and found it way to spammy. I ended up quitting, which is too bad, because Realms of Despair is well established, and based in my home town (Toronto). Ah well... this is the script I wrote:

Sub Display_PromptLine (CallSource, OutputLine, arrWildcards)
	Dim ColourStack
	ColourStack = World.NoteColourFore
	World.NoteColourFore = &h82004B
	World.Note World.GetVariable("LastPrompt")
	World.NoteColourFore = ColourStack
End Sub

Sub Grab_Prompt (CallSource, OutputLine, arrWildcards)
	If World.GetVariable("LastPrompt") <> OutputLine Then
		World.SetVariable "LastPrompt", OutputLine
		Display_PromptLine "Grab_Prompt", OutputLine, arrWildcards
	End If
End Sub

The two subroutines were designed so that I would World.Note the promptline only if there was a change. By gagging the actual prompt with a trigger, this greatly reduced the spam... I ended up with the effect your described, the most recent prompt "stuck" to the bottom of the screen.

This happens because an endline (LF) character is not sent after the prompt, so it doesn't get gagged until there is some kind of update. In my case, I purposely echoed a copy of the old promptline... in your case, there is probably some subtle difference in the line that has in not trip your trigger(s).

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Thu 01 Aug 2002 01:00 AM (UTC)
Message
Quote:

(ie. the prompt stays on the bottom of the output window instead of flooding it)


This will always happen, as the trigger fires when the newline character (\n) arrives, and it doesn't on a prompt line (because the cursor is after the prompt). Thus, the prompt is omitted after another line arrives.

- Nick Gammon

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


4,294 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]