I'm having trouble with a say trigger. I'd like quest givers to put out text I can click on to respond to their prompts, instead of having to copy/paste the text to respond.
I have this:
local saying = matches[3]
selectString(saying, 1)
replace("")
--echo("matched")
--echo(saying)
resetFormat()
setBold(true)
setUnderline(true)
fg("white")
echoLink(saying, [[send("say "..saying)]], "click to say", true)
but when I get yes/no prompts from quest givers, both links cause me to give the 'no' response. That saying variable seems to be overwriting on the second item.
My question is, how to I make each link use a fresh variable so that I can click yes?
Comments
You don't want the code to be send("say " .. saying) when the link is clicked. You want the code to be send("say Yes") or send("say No"). To do that: [[send("say ]] .. saying .. [[")]]. That creates a string with the value of saying when the trigger runs (i.e. either send("say Yes") or send("say No")) rather than using the variable later.
Results of disembowel testing | Knight limb counter | GMCP AB files