How do I gag the output of commands from scripts?

Post Reply
Ornir
Posts: 31
Joined: Thu Apr 07, 2011 8:15 am

How do I gag the output of commands from scripts?

Post by Ornir »

I have a situation where I am sending a command to the mud from a script and the output of that command will generate data that I want to present to the user in a formatted way. For example:

*# CW Mana:Cold>xp
info mmc.XPCounter:update: %x %t %X %T.

--> Gained xp: 460 tp: 0
--> Session xp: 1707 tp: 0
--> Needed xp: 0 tp: 1418

The alias is xp, and it sends a call to a function that sends the command: info mmc.XPCounter:update: %x %t %X %T.
I have a trigger that matches the output of that command and gives me information about XP. That trigger then calls another function that string.format's the information you see above.

I think it is ugly that that "info mmc.XPCounter:update: %x %t %X %T." string is echoed to the main window in this case and would like to gag it. Any ideas?

Thanks.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: How do I gag the output of commands from scripts?

Post by Heiko »

The send() function has an optional parameter to not print the command on the screen. If you use this option you can then echo your replacement command.

Ornir
Posts: 31
Joined: Thu Apr 07, 2011 8:15 am

Re: How do I gag the output of commands from scripts?

Post by Ornir »

Perfect, thanks!

Post Reply