Last command sent

Post Reply
macro
Posts: 7
Joined: Mon Jun 06, 2011 6:31 pm

Last command sent

Post by macro »

what would be the simplest way to capture the last command sent? i made an alias with a send for now, but that will only capture what i manually type and will send even when another alias triggers as well

here is what i have currently:

pattern: ^(.*)
Code: [show] | [select all] lua
lastcommand = matches[1]
send(lastcommand, false)
if there was a way of telling it, "i know you triggered, but still send it to the server if the others do not trigger" that would be enough

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

Re: Last command sent

Post by Heiko »

You have full control over what is actually being sent over the network because there is a system event that is being raised whenever data is going to be sent over the network. You can hook up an event handler function that explicitly allows or denies the data send request.

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

Re: Last command sent

Post by Vadi »


macro
Posts: 7
Joined: Mon Jun 06, 2011 6:31 pm

Re: Last command sent

Post by macro »

very awesome... does this also mean that 'command' is in the global variable list?

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

Re: Last command sent

Post by Vadi »

Yes, the variable is set when aliases are running

GErswin
Posts: 17
Joined: Fri Jun 09, 2017 6:12 am

Re: Last command sent

Post by GErswin »

Bumping this because I have a related question that's probably not worth its own thread.

When I start up Mudlet and connect to my MUD, the MUD immediately returns some errors about unrecognized commands being sent. Obviously Mudlet is sending something but I don't know what. What's the best way for me to see what commands Mudlet has sent since startup? I tried getLines but that only returns visible lines.

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Last command sent

Post by Nyyrazzilyss »


GErswin
Posts: 17
Joined: Fri Jun 09, 2017 6:12 am

Re: Last command sent

Post by GErswin »

Got it. That helped me to see what the issue was. Thanks!

Post Reply