Alias echo gagging?

Post Reply
Alaran
Posts: 27
Joined: Sat Dec 19, 2009 2:51 pm

Alias echo gagging?

Post by Alaran »

Hi,

I just wanted to make a little alias that would replace "get item" with "palm item". So I made this

Pattern: ^(g|get)(\s([\w]+))
Script: send("palm " .. matches[4])

As far as I can tell it works, BUT it looks like this:

475h, 464e, 5f, 130m, 49g xb-
g item
palm item
I see no "item" to take.
475h, 464e, 4f, 130m, 49g xb-

So the "get" is substituted, but still echoed to my screen. Is there any way to just remove the "g item" echo from my screen? To make it look like this:


475h, 464e, 5f, 130m, 49g xb-
palm item
I see no "item" to take.
475h, 464e, 4f, 130m, 49g xb-

I tried with selectString and deleteLine but that always deleted from the Mud output, not from my input.

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

Re: Alias echo gagging?

Post by Heiko »

Turn off command echos in preferences and print your own.
You could use moveCursor() and replace the command print, but the result would not be rendered on the screen in alias scripts. The new 1.1.0 development branch has a new robust display that renders all changes to the buffer, but for the time being you'll have to turn off command echos and echo those that you want to echo explicitely.

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Alias echo gagging?

Post by Vadi »

Try send("palm " .. matches[4], false)

Alaran
Posts: 27
Joined: Sat Dec 19, 2009 2:51 pm

Re: Alias echo gagging?

Post by Alaran »

Well I like command echos generally. Tells me what's going on if I ever read my logs. I went with Vadi's suggestion, simple and easy. Thanks loads! I definitely need to look into the moveCursor thing too..

And since I don't want to start yet another thread.. I have two more questions:

a) Is it possible to start logging automatically on logon? So I don't have to hit that button all the time, I keep forgetting.

b) Is it possible to change the location where logs are being saved? I'd like them somewhere else than in my ~/.config/mudlet .. etc. It's not really that easily accessible if I need to look at something quickly.

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Alias echo gagging?

Post by Vadi »

I think there is startLogging... but I don't remember how to stop it. I don't think that it yet takes arguments as path, unfortunately.

Iocun
Posts: 174
Joined: Wed Dec 02, 2009 1:45 am

Re: Alias echo gagging?

Post by Iocun »

If I remember correctly, it's startLogging(true) to start it, and startLogging(false) to stop the logging.

Alaran
Posts: 27
Joined: Sat Dec 19, 2009 2:51 pm

Re: Alias echo gagging?

Post by Alaran »

That worked. Thanks a lot! :)

Post Reply