yes it would. lets for example say the command you wish to trigger off of is this
Bdf says, "!Dweia use Burning Coal"
first you would need to setup a capture, since you it is from one of your characters make sure the chat capture condition is in an All with a regex to limit only your character commands getting capture something like this
Code: Select all
Chat: (^(\[[A-z]+?\] |)You|.*\<Tell:IIDString:.+:(Char1|Char2|Char3)\>.+\<\\Tell\>) (say|says|tells you), \"!.*\"$
then after that is added to the all make the capture
Code: Select all
ChatCap (^(\[[A-z]+?\] |).*\<Tell:IIDString:.+:((?<tellchar>[^\<]*))\>.+\<\\Tell\>) (say|says|tells you), \"!(?<telltextone>.*) use (?<telltexttwo>.*)\"$
now this capture will only work for issuing a command for 1 character to use a specific item, npc or other named object. it will save 3 separate capturegroups when issued the command above, which will be equal to
getvar[capturegroup_tellchar]==Bdf
getvar[capturegroup_telltextone]==Dweia
getvar[capturegroup_telltexttwo]==Burning Coal
then in a separate rule in the condition compare the newly made variable with getcharstringprop[1] to make sure it matches the issued characters name so only the commanded character will use the item
Code: Select all
Expr getcharstringprop[1]==getvar[capturegroup_telltextone]
only Dweia in our example would trigger off the above condition and then go through with the action below
Code: Select all
ExprAct actiontryuseitem[wobjectfindininventorybynamerx[getvar[capturegroup_telltexttwo]]];clearvar[capturegroup_telltexttwo];clearvar[capturegroup_telltextone];clearvar[capturegroup_tellchar]
this will both execute the command then clear all of the captured variables.
Edit: fixed ChatCap condition regex