Closed UnbanTwin closed 8 years ago
I am trying to make a command that allows player to transfer gold to each other, so lets say the command looks like this:
transfer [amount] [player]
How do I get the second argument, would I do command.arg[1]
Hoping to get back to you on everything sometime today (Friday).
Just seeing this response; so the command object passed into each command looks like:
{ cmd: '', // {cast} spark boar msg: '', // cast {spark boar} arg: '', // cast {spark} boar input: '', // cast spark {boar ...} number: 1, // augment target -- cast spark 2.boar roomObj: roomObj // optional -- allows for commands to skip redundant room lookup }
As such the 'player' name, your third word, would be on command.input. This next commit will implement the 'give' command which will cover this case.
Provide an example of what you're aiming to do please.