So I am trying to make a script that will basically run through an array and spew out the output to chat. However I want some kind of human integration such as clicking on a button to continue onto the next index of the array.
so far I have this and its 90% of the way there except the script does not continue in the while loop and instead does one iteration and completes. Not sure if this is a limit of the static popup but I'm at my wits end and need some help. Below is the script.
Code:
working =
{
{11,22,33},
{12,23,34},
{34,45,56}
}
i = 1;
while i <= 3 do
StaticPopup_Show ("CONTINUE");
i = i + 1;
end
StaticPopupDialogs["CONTINUE"] = {
text = "Do you want to continue?",
button1 = "Yes",
button2 = "No",
OnAccept = function()
moveon(working, i);
end,
timeout = 0,
whileDead = true,
hideOnEscape = true,
}
function moveon(working, i)
SendChatMessage(string.format("I love numbers %s %s %s %s", working[i][1], working[i][2], working[i][3]), i, "SAY", nil, index);
end