Judging by Rock's ChoiceOptionByName() I doubt there is a count for options.
Can you just use the option by name??
ChoiceOptionByName("first text you want")
ChoiceOptionByName("second text you want")
ChoiceOptionByName("third text you want")
That will try first, second and third regardless of if any actually work.
In order to actually respond with inteligence then you will probably have to do something like this.
Wrote this in a bit of a hurry but hopefully you get the idea
Code: Select all
optionnames = {}
local counter = 1
local option
repeat
option = RoMScript("GetSpeakOption("..counter..")")
if option then
table.insert(optionnames, option)
end
counter = counter + 1
until not option
for k,v in ipairs(optionnames) do
if FindNormalisedString(v,"first choice") then
RoMScript("ChoiceOption("..k..");"); yrest(1000);
return
end
if FindNormalisedString(v,"second choice") then
RoMScript("ChoiceOption("..k..");"); yrest(1000);
return
end
if FindNormalisedString(v,"third choice") then
RoMScript("ChoiceOption("..k..");"); yrest(1000);
end
end