Page 1 of 1
info about command variables
Posted: Thu Dec 10, 2009 1:46 am
by Sikken
is it possible to add a substring to a voiced command? example : .bank 7, notice there is a space between the .bank, and the 7. hopefully this can allow a player to deposit x amount of gold bars, x substituted as 7 in my example. this could also work for .withdraw and many other commands.
it works with //recall characterName , so it should work for voiced, if i get it working, ill post it, but if someone has already tried this, can you please tell me any problems that i might encounter.
Re: info about command variables
Posted: Thu Dec 10, 2009 2:53 am
by Sikken
ok , for now i have resolved with a html text bow with buttons, 1,10,100 for depositing, and withdrawing my gold and adena ... but i am still lokking for a solution for this ^^ ... its not as easy as it sounds ^^
Re: info about command variables
Posted: Sat Dec 12, 2009 11:16 pm
by issle88
You can edit the way voicedcommandhandler works to set commands in the form of .command_arg1_arg2_art3 etc
Tokenize with _ as split indicator use the first substring as the command and parse the other three inside for the voicedcommand to be able to use them. Just a rough thought, didnt try it but it can ( and will ) work.
Re: info about command variables
Posted: Sun Dec 13, 2009 9:30 am
by janiii
Code: Select all
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
the string target is the string after command and can be used to check the parameters from the command. it has only a wrong name.. e.g. if you have ".bank 10" command then bank is command and "10" is the target.
that means that the voiced command has already support for parameters, you dont need to code anything else, just use the string target in your voiced command to check parameters.
Re: info about command variables
Posted: Sun Dec 13, 2009 11:46 am
by denser
viewtopic.php?f=69&t=14124
here is my contrin. i made it max for 4 banking - cos of bug with more than 2kkk adena.
it works on my live about 3 month

players a little happier till now