Extra line feeds with aliases, triggers and world.send's
Posted by Rheede
on Mon 04 Nov 2002 05:11 AM
— 14 posts, 38,229 views.
I was wondering if there was a way to keep these ways of sending text to the mud from adding an extra line after them in the output window. I have a simple script for practicing my skills up to max(a for loop, actually), and after it sends all x number of times to the mud, I get x number of empty lines after it. I'm not entirely sure if these lines are sent to the mud or just displayed on my end.
I'm using MC 3.30 and I've noticed it with previous version of MC as well.
Thanks for your time,
Rheede
I can't reproduce this, maybe there is a problem in your script. Here is what I did in the Immediate window...
for i = 1 to 5
world.send "think hi there"
next
I get this response (with "echo commands" enabled) ...
think hi there
think hi there
think hi there
think hi there
think hi there
hi there
hi there
hi there
hi there
hi there
However there are no extra blank lines.
Actually.. I have noticed this as well.. One that does it with me is a single sub an some linked triggers. (Assuming you still have my files) they are all the triggers linked to the sub PartyTellIt. The triggers do not send anything, but call a sub that replaces any spaces in the trigger name and repeats it back as a world.colournote or sends a party tell command. It happens all of the time with this combination of triggers and sub (not sure if with all triggers, I stopped paying attention), but never with my potions alias, the timer for spell status or most any thing else. I have checked all the usually suspects, like the send fields, extra world.notes, etc. and there is no reason they should be doing it. :p
Of course for be this is just an oddity, not a serious mess like Rheede is talking about, but there is definitely something odd happening here that results in some, but not all trigger/sub combos producing these odd results.
Well, glad someone else had something similar. :)
The main probly I was getting was from my practice alias/script.
The script had the follow code:
Sub
i = 1
while i < 9
world.send "prac " & strWildCards(1)
loop
End Sub
That's the basic code, anyways.
I had an alias called do_prac *, and I would type in something like the following:
do_prac second
do_prac berserk
do_prac hand
all of these commands were sent at once, ie. multiline inputting. The result would be the designated number of prac such-n-such that was needed to raise to a certain level, and then a whole slew of carriage returns that followed for as many times as there were "prac such-n-such" lines.
Hope this helps out with any investigation that might be goin on regarding this. :p As Shodowfyr mentioned, it's not all that big of a deal, but just something that's a little annoying sometimes.
Thanks for your time,
Rheede
First I would check that in your alias "send" box you don't inadvertently have one or more blank lines. They can be hard to spot. Put the cursor in that box and backspace and delete until you are sure it is empty.
Second, I would check "Omit from output" on the alias. I suspect that the multi-line alias is contributing to the blank lines. When I tried what you described I got three blank lines, because I entered:
do_prac second
do_prac berserk
do_prac hand
By checking "omit from output" the blank lines were suppressed.
Thanks for the help, guys. What ya suggested, Nick, worked. No more extra carriage returns sent to the mud. It was the Omit from Output that was doing it.
On a side note, I had a thought that instead of just putting each do_prac on each line and then sending them all, I'd just do command stacking, but to my surprise, I got all these "Command not recognized" errors from the mud. How come your command stacking doesn't do aliases? Just a thought. ;)
Thanks again,
Rheede
Seemed to work for me. Check you have command stacking enabled, and that the command stack character is what you think it is.
Hmm.. In my case it is not an alias doing it and I can't exactly try the 'omit from output' trick, since I want the line that triggered to remain visible. :p Even assuming it would in fact do the same thing..
I've reinstalled everything on my PC. Might be quicker if you resend the relevant file, especially if you can isolate it down to a single on.
Right.. Will do.
Hey, since we're on the subject of Omit from output. I was wondering if there's a way to keep a trigger's text from goin to the output window, but the "trigger" text stay visible? If there is, I havn't found it. Also, was wondering if there was some way, like with my do_prac script, to keep the world.send text from being displayed. Again, if there is, I havn't found it.
Thought I'd ask. Thanks again for the help, guys.
Bobby
In both cases you could do a world.send inside a script, and before that save the "echo" flag, set it off, then restore it afterwards.
Quote:
The triggers do not send anything, but call a sub that replaces any spaces in the trigger name and repeats it back as a world.colournote or sends a party tell command.
OK, I see what you mean. If the script does a world.note you get a "free" extra line at the end. However if you do two notes, there is not a blank line between them, so the freebie seems to come only if there are any notes.
I'll look into it.
Right. Fixed that. Hope it doesn't have side-effects.
Basically when it got the newline it called the trigger scripts, which did their stuff, and then MUSHclient went on to actually display the newline, which was redundant because the world.note in the trigger had already caused the new line.