Getting last command passed by user
Moderator: Eowul
Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
Getting last command passed by user
I was wondering if there was a way to retrieve the last command entered by the user. Does this get saved, kind of like args, in the background? If not, is there any temporary fixes that anyone can think of? I've tried making an empty alias that saved all args to a variable, but that did not work. Making a trigger that looks for an ">" in front of a statement to save it did not work either.
Re: Getting last command passed by user
A very late answer on what I found works.
The command triggered from the numpad directions does not get added to the history. Directions where the full word is typed in the command input and enter is pressed do get added to the history.
Code: Select all
var keys = Object.keys(mud.InputHistory.history);
var last = keys[keys.length-1];
gwc.output.append('last command: ' + mud.InputHistory.history[last]);
Re: Getting last command passed by user
That is for an alias right?
For some reason these commands confuse me a bit
For some reason these commands confuse me a bit
Re: Getting last command passed by user
The code will work in either an alias or a trigger
The difference between the two is that the code for a trigger is run in response to the client receiving a message from the mud server. An alias runs the code when the client receives a command from the player.
The difference between the two is that the code for a trigger is run in response to the client receiving a message from the mud server. An alias runs the code when the client receives a command from the player.
Re: Getting last command passed by user
there is a quicktyper dhorthand of %% that will autoexecute your lastcommand in a do
and it will say doing: whatever last command was.
so if your trying to redo your last command you can use %%.
however if you use %% in an alias it will have a substitute function
ie
alias hhug hug %% happily
and you "hhug friend" you will "hug friend happily"
thus it would be difficult to use %% in an in game alias fir last command reasons.
and it will say doing: whatever last command was.
so if your trying to redo your last command you can use %%.
however if you use %% in an alias it will have a substitute function
ie
alias hhug hug %% happily
and you "hhug friend" you will "hug friend happily"
thus it would be difficult to use %% in an in game alias fir last command reasons.
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/