problems removing prompt

Post Reply
amertune
Posts: 5
Joined: Thu Aug 20, 2015 5:25 pm

problems removing prompt

Post by amertune »

I'm having trouble removing the prompt (or matching other lines) when I send commands in an alias/trigger, and possibly when I just rapidly send commands.

I've never had this problem in tintin++, all I did was set "#PROMPT {^\> $} {\> } 0;" and it always grabbed the prompt without any problems.

I have a trigger that calls deleteLine when it matches "^> $", and that works fine. The problem is that sometimes the next line of mud output gets put on the same line as the prompt.

For example, if I have an alias "pot" that does

send("get potion from cloak");
send("drink potion");
send("smash bottle");

Then I get output like

You get the potion from your cloak.
> You drink the potion.
> You smash the bottle into tiny pieces.

I tried to also use a replace to remove the first two characters, but it still causes matching problems. Sometimes it seems to do the replace twice and I see

You get the potion from your cloak.
o drink the potion.
...

It also causes matches to fail. If I try to have a trigger condition that matches from the beginning of a line, the prompt at the beginning changes the line and the condition doesn't match.

Any thoughts?

amertune
Posts: 5
Joined: Thu Aug 20, 2015 5:25 pm

Re: problems removing prompt

Post by amertune »

For posterity:

I figured this out. It seems that my mud is improperly sending the IAC GA.

I had two triggers, one which was a complete string match for "> " and deleted the line, and another which was a beginning of string match for "> " and replaced the characters. I believe that the problem with overdeletion was caused by both of the triggers running.

I replaced the second trigger with a regex which matched "> " followed by any character other than a newline "^(> )[^\n]", and this is working.

The only downside is that the "> " is still in the line when other triggers are running, so I'm going to have to work around it for every trigger that matches against the beginning of the line. It's the mud's fault, though, so there's not much that can be done about that.

Post Reply