Strange trigger with prompt behavior?

Posted by Accolades on Thu 18 Jul 2002 02:54 AM — 3 posts, 17,425 views.

#0
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 -
Canada #1
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).
Australia Forum Administrator #2
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.