function MakeChoice1(num) local notAcceptedQuests,incompleteQuests,completedQuests = RoMScript("GetNumQuest(1),GetNumQuest(2),GetNumQuest(3)") if num <= notAcceptedQuests then local questOnBoard, daily, qgroup = RoMScript("GetQuestNameByIndex(1, "..num..")") print("Command is: AcceptQuestByName. Quest name is: \""..questOnBoard.."\"") elseif num <= incompleteQuests + notAcceptedQuests then local questOnBoard, daily, qgroup = RoMScript("GetQuestNameByIndex(2, "..(num-notAcceptedQuests)..")") print("Command is: CompleteQuestByName. Quest name is: \""..questOnBoard.."\"") elseif num <= completedQuests + notAcceptedQuests + incompleteQuests then local questOnBoard, daily, qgroup = RoMScript("GetQuestNameByIndex(3, "..(num-notAcceptedQuests-incompleteQuests)..")") print("Command is: CompleteQuestByName. Quest name is: \""..questOnBoard.."\"") else -- must be option num = num-notAcceptedQuests-incompleteQuests-completedQuests local option = RoMScript("GetSpeakOption("..num..")") if option then print("Command is: ChoiceOptionByName. Option name is: \""..option.."\"") else print("Invalid number specified") end end end function MakeChoice2(num) local name, typ, index = RoMCode("n="..num.." c=0 for k,v in pairs(g_SpeakFrameData.option) do if v.objtype~=1 then c=c+1 if c==n then a={v.title,v.type,v.id} break end end end") if typ == 1 then printf("Command is: AcceptQuestByName.") elseif typ == 2 or typ == 3 then printf("Command is: CompleteQuestByName.") elseif typ == 56 then printf("Command is: ChoiceOptionByName.") else print("Invalid number specified") return end print(" Name is: \""..name.."\"") end