I’m assuming you are using adv3Lite, as you shouldn’t be having this problem in adv3.
Eric Eve, a very long time ago, made an extension for adv3 called TCommand, which he incorporated into adv3Lite. Included with that extension was code to convert X, Give Me Y to Ask X for Y. Below is the code that came with that extension, with only the include lines changed.
/* Converts X, GIVE ME Y into ASK X FOR Y */
runOrder = 90
local workStr = str.toLower;
local iGive = workStr.find('give');
if(iGive == nil)
local iComma = workStr.find(',');
local iGiveMe = workStr.find('give me');
local iToMe = workStr.find('to me');
if(iComma == nil || (iGiveMe == nil && iToMe == nil))
local npcName = workStr.substr(1, iComma-1);
objectName = workStr.substr(iGiveMe + 8);
if(iGive == nil || iGive > iToMe || iGive < iComma)
objectName = workStr.substr(iGive + 5, iToMe - iGive - 6);
str = 'ask ' + npcName + ' for ' + objectName;
str = rexReplace(pat, str, npcName + '\'s', ReplaceAll);
pat = static new RexPattern('%<your%>')
This should work as long as the player refers to themself as
me in the command.