Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ How can I temporarily omit something from the output, and replace it?

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

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


Posted by Windmill_Man   USA  (29 posts)  Bio
Date Wed 07 Apr 2010 11:28 PM (UTC)
Message
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.
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #1 on Thu 08 Apr 2010 12:24 AM (UTC)
Message
You could enable your gag-trigger while you're putting your herbs away, then re-disable it afterwards. Much easier to deal with, IMHO.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Windmill_Man   USA  (29 posts)  Bio
Date Reply #2 on Thu 08 Apr 2010 03:01 AM (UTC)
Message
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.
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #3 on Thu 08 Apr 2010 04:54 AM (UTC)
Message
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.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Windmill_Man   USA  (29 posts)  Bio
Date Reply #4 on Thu 08 Apr 2010 05:05 AM (UTC)
Message
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.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #5 on Thu 08 Apr 2010 05:07 AM (UTC)
Message
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).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Windmill_Man   USA  (29 posts)  Bio
Date Reply #6 on Thu 08 Apr 2010 05:42 AM (UTC)
Message
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...
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #7 on Thu 08 Apr 2010 06:46 AM (UTC)
Message
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.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Windmill_Man   USA  (29 posts)  Bio
Date Reply #8 on Thu 08 Apr 2010 06:51 AM (UTC)

Amended on Thu 08 Apr 2010 11:31 AM (UTC) by Windmill_Man

Message
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.
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.


29,025 views.

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

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.