I didnt read all that above but fortunately I've already made something that does exactly what you want. This is a cut down version with just 2 examples, it also has all that runOnChat and clk stuff you need. The full version has like 100 preset sentences and instrumental stuff.
Code:
@name Playzr's Talkatron Tutorial
@inputs
@outputs
@persist Said:string
@trigger all
interval(1)
runOnChat(1)
# E:lastSaid() S Returns what the given player last said
# E:lastSaidWhen() N Returns when the given player last said something
# lastSpoke() E Returns the entity of the last player to speak
# runOnChat(N) 1 will cause the chip to run on chat events, 0 stops the chip from running on chat events, only needs to be called once (not every execution)
# chatClk() N Returns 1 if the chip is being executed because of a chat event, 0 otherwise
# chatClk(E) N Returns 1 if the chip is being executed because of a chat event by the given player, 0 otherwise
# soundPlay(N,N,S) soundPlay(int Index, int Duration, string Path to File)
# soundPitch(1, 100)
if(chatClk(owner())){
Said = owner():lastSaid():lower()
soundPitch(1, 100)
if(Said:find("where") & Said:find("?")){ owner():soundPlay(1,6,"vo/k_lab/kl_thenwhere.wav") }
if(Said:find("dunno")){ owner():soundPlay(1,6,"vo/k_lab/kl_wishiknew.wav") }
}
Bookmarks