How can I temporarily omit something from the output, and replace it?

Posted by Windmill_Man on Wed 07 Apr 2010 11:28 PM — 9 posts, 30,789 views.

USA #0
Some of my anti-theft triggers/aliases spam a lot to increase effectiveness. The problem is, they can spam up to 100 lines (over 50 excluding the prompt)!

For example, one of my aliases, named "herbaway", spams the command "INR ALL PLANT" 19 (the number of total herbs) times. My idea to cut the spam would be to omit the lines "You see no ink in your inventory" and replace all 19 lines it with something like "Herbaway: Putting all herbs in the Rift.".

I could set up a trigger to omit the "You see no plant in your inventory" lines and then have my original alias show "Herbaway: Putting all herbs in the Rift" in the output. That would be easy enough, but this would omit ALL the lines... not JUST the ones caused by the alias.

What could I do? The priority is to remove the spam... I don't NEED to replace it. I just think it might be weird not to have anything shown in the output at all.
USA #1
You could enable your gag-trigger while you're putting your herbs away, then re-disable it afterwards. Much easier to deal with, IMHO.
USA #2
Maybe it'd be easier if I asked how I could enable/disable individual triggers in a trigger or alias.

I can't enable/disable manually while being in the middle of an attempted robbery. Sorry, I should have made it clearer.
USA #3
Ah. You need to name it (the Label field in the GUI editor), and then use the label in EnableTrigger("name", true or false). Same for aliases, but EnableAlias().

Have you tried browsing the Help -> Function List dialog? You can filter it: say you enter "alias" in the field, then it'll list all functions containing the word "alias" in the name. Most functions are named well enough for this to work, and others you can most likely navigate to from within the help documentation that pops up when you click an entry in the list.
USA #4
Thank you very much.

I should have checked for that. I guess I sorta lost hope in the help file since everything I've needed to know hasn't been there, but here. Next time I'll look there first.
Australia Forum Administrator #5
Indeed, Twisol. And a simple thing might be to do something like this (in your alias):


for i = 1, 19 do
  Send "INR ALL PLANT"
end -- for

EnableTrigger ("omit_my_herb_stuff", true)

DoAfterSpecial (2, ' EnableTrigger ("omit_my_herb_stuff", false) ', sendto.script)


That would enable the trigger that omits the spam, and then re-disable it 2 seconds later (hopefully that is enough time for the messages to appear, if not you can tweak that).
USA #6
That works like a charm. The prompt itself still spams... but the script cuts out half of the total spam and it's a lot easier to tell the difference between the prompt and the other stuff. Thanks again Nick.

It feels like MUSHclient is a lot more instant when sending commands with aliases and triggers than Nexus. Could just be me though...
Australia Forum Administrator #7
Windmill_Man said:

That works like a charm. The prompt itself still spams...


Use SendNoEcho instead of Send - that won't echo what it sent.

Template:function=SendNoEcho
SendNoEcho

The documentation for the SendNoEcho script function is available online. It is also in the MUSHclient help file.

USA #8
Oh, thanks! I actually was tinkering with the SetEchoInput function. I put "SetEchoInput (false)" at the beginning of each script and "SetEchoInput (true)" at the end. It was working pretty well. This simplifies things though!

With tweaking... I managed to cut out the command echos and multiples of the prompt. The 100+ lines of spamming has been reduced to 15 lines! That's really good in my opinion. I could reduce it more... but it'd be a bit more complicated and not really worth it.