PDA

View Full Version : trouble with for loops


Lak
14-07-2007, 11:32 PM
I have been working to fix an addon called AltaVoice(http://wowui.incgamers.com/ui.php?id=2231) and i have gotten it to the point where no errors pop up, but the list that displays player's names is not showing. What I think is going on is that since the syntax of a for loop changed it effected the addon.

I have tried multiple different variations on for loops(all of the ones listed on the WoWWiki HowTo: Tricks with tables). This is the only problem that i can think of that would be causing the trouble.

Here is the function AltaVoice_UpdateTalkList:
function AltaVoice_UpdateTalkList()
local onTalkLoop = 1;
local listLoop = 1;
local noOneTalking = true;
for i=1, table.getn(AltaVoice_TalkTable) do
local getName = AltaVoice_TalkTable[i].name;
local talking = AltaVoice_TalkTable[i].talk;
if ((AltaVoice_SVars[AltaVoice_PlayerOfRealm].ListMode == "OnTalk") and (talking == "talk"))then
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..onTalkLoop.."_Name"):SetText(getName);
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..onTalkLoop):Show();
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..onTalkLoop.."_SpeakTexture"):Show();
noOneTalking = false;
onTalkLoop = onTalkLoop + 1;
end
if (AltaVoice_SVars[AltaVoice_PlayerOfRealm].ListMode == "List")then
if (talking == "talk")then
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop.."_Name"):SetText(getName);
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop):Show();
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop.."_SpeakTexture"):Show();
noOneTalking = false;
end
if (talking == "silent")then
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop.."_Name"):SetText(getName);
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop):Show();
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop.."_SpeakTexture"):Hide();
end
listLoop = listLoop +1;
end
end
if (noOneTalking)then
AltaVoice_ResetVolume();
end
if (AltaVoice_SVars[AltaVoice_PlayerOfRealm].ListMode == "OnTalk")then
while (onTalkLoop <= AltaVoice_SVars[AltaVoice_PlayerOfRealm].SpeakListLength)do
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..onTalkLoop):Hide();
onTalkLoop = onTalkLoop +1;
end
end
if (AltaVoice_SVars[AltaVoice_PlayerOfRealm].ListMode == "List")then
while (listLoop <= AltaVoice_SVars[AltaVoice_PlayerOfRealm].SpeakListLength)do
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop):Hide();
listLoop = listLoop +1;
end
end
end

and here is the rest of the addon for reference:
BINDING_HEADER_ALTAVOICE = "AltaVoice";
BINDING_NAME_PUSHTOTALK = "Push To Talk";

-- Default Variables
AltaVoice_SVars = {};
AltaVoice_TalkTable = {};
AltaVoice_ActiveChannels = {};
AltaVoice_VolumeDipped = false;

function AltaVoice_OnLoad()
this:RegisterEvent("VARIABLES_LOADED");
this:RegisterEvent("CHAT_MSG_CHANNEL");
UIErrorsFrame:AddMessage("AltaVoiceLoaded", 0, 1.0, 0, 1.0, UIERRORS_HOLD_TIME);
DEFAULT_CHAT_FRAME:AddMessage("AltaVoice : AltaVoice Loaded", 0.0, 1.0, 0.0);
AltaVoice_Language = this.language;
-- Register Slash Commands
SlashCmdList["AltaVoice"] = function(msg)
AltaVoice_SlashHandler(msg);
end
SLASH_AltaVoice1 = "/altavoice";
end

function AltaVoice_SlashHandler(msg)
if (msg == "")then
DEFAULT_CHAT_FRAME:AddMessage("AltaVoice : Slash Command List :", 0.0, 1.0, 0.0);
DEFAULT_CHAT_FRAME:AddMessage("AltaVoice : /altavoice show", 0.0, 1.0, 0.0);
DEFAULT_CHAT_FRAME:AddMessage("AltaVoice : /altavoice hide", 0.0, 1.0, 0.0);
end

if (msg == "show")then
AltaVoice_VoiceWindowTitle:Show();
end

if (msg == "hide")then
AltaVoice_VoiceWindowTitle:Hide();
AltaVoice_Menu_Title:Hide();
end
end

function AltaVoice_LoadProfile()
local player = UnitName("player");
local realm = GetCVar("realmName");
AltaVoice_PlayerOfRealm = player.." of "..realm;
if (AltaVoice_SVars[AltaVoice_PlayerOfRealm])then
AltaVoice_RefreshVisuals();
DEFAULT_CHAT_FRAME:AddMessage("AltaVoice : Loaded Profile for "..AltaVoice_PlayerOfRealm..".", 0.0, 1.0, 0.0);
else
AltaVoice_SVars[AltaVoice_PlayerOfRealm] = {};
if (IsInGuild())then
local guildName = GetGuildInfo("player");
local findSpaces = string.find(guildName, " ");
if (findSpaces)then
local starts, ends, cursor = 0,0,1;
local repairedName = "";
while (starts ~=nil)do
starts, ends = string.find(guildName, " ", cursor);
if (starts ~=nil)then
repairedName = repairedName..string.sub(guildName, cursor, starts-1);
cursor = ends +1;
else
repairedName = repairedName..string.sub(guildName, cursor);
end
end
guildName = repairedName;
end
AltaVoice_SVars[AltaVoice_PlayerOfRealm].Monitor_Channel = "AltaVoice"..guildName;
else
AltaVoice_SVars[AltaVoice_PlayerOfRealm].Monitor_Channel = "AltaVoice"..player;
end
AltaVoice_SVars[AltaVoice_PlayerOfRealm].SpeakListLength = 40;
AltaVoice_SVars[AltaVoice_PlayerOfRealm].ListMode = "List";
AltaVoice_SVars[AltaVoice_PlayerOfRealm].AllowInvites = true;
AltaVoice_SVars[AltaVoice_PlayerOfRealm].VolumeDip = false;
AltaVoice_SVars[AltaVoice_PlayerOfRealm].VolumeDipValues = {};
AltaVoice_SVars[AltaVoice_PlayerOfRealm].VolumeDipValues.Master = GetCVar("MasterVolume");
AltaVoice_SVars[AltaVoice_PlayerOfRealm].VolumeDipValues.Sound = GetCVar("SoundVolume");
AltaVoice_SVars[AltaVoice_PlayerOfRealm].VolumeDipValues.Music = GetCVar("MusicVolume");
AltaVoice_SVars[AltaVoice_PlayerOfRealm].VolumeDipValues.Ambience = GetCVar("AmbienceVolume");
AltaVoice_SVars[AltaVoice_PlayerOfRealm].Appearance = {};
AltaVoice_SVars[AltaVoice_PlayerOfRealm].Appearance.TalkWindow = {};
AltaVoice_SVars[AltaVoice_PlayerOfRealm].Appearance.TalkWindow.Width = 100;
AltaVoice_SVars[AltaVoice_PlayerOfRealm].Appearance.TalkWindow.Scale = 1;


DEFAULT_CHAT_FRAME:AddMessage("AltaVoice : Profile Created for "..AltaVoice_PlayerOfRealm..".", 0.0, 1.0, 0.0);
end
end

function AltaVoice_JoinVoiceChannel()
local _, isActive = JoinChannelByName(AltaVoice_SVars[AltaVoice_PlayerOfRealm].Monitor_Channel);
if (isActive == nil)then
JoinChannelByName(AltaVoice_SVars[AltaVoice_PlayerOfRealm].Monitor_Channel);
RemoveChatWindowChannel(DEFAULT_CHAT_FRAME:GetID(), AltaVoice_SVars[AltaVoice_PlayerOfRealm].Monitor_Channel);
AltaVoice_ChannelName = GetChannelName(AltaVoice_SVars[AltaVoice_PlayerOfRealm].Monitor_Channel);
end
AltaVoice_ChannelName = GetChannelName(AltaVoice_SVars[AltaVoice_PlayerOfRealm].Monitor_Channel);
AltaVoice_JoinMasterChannel();
end

function AltaVoice_JoinVoiceChannelOnClick()
local channelName = "AltaVoice"..AltaVoice_Menu_Panel_ChannelName:GetText();
local findSpaces = string.find(channelName, " ");
if (findSpaces)then
local starts, ends, cursor = 0,0,1;
local repairedName = "";
while (starts ~=nil)do
starts, ends = string.find(channelName, " ", cursor);
if (starts ~=nil)then
repairedName = repairedName..string.sub(channelName, cursor, starts-1);
cursor = ends +1;
else
repairedName = repairedName..string.sub(channelName, cursor);
end
end
channelName = repairedName;
AltaVoice_Menu_Panel_ChannelName:SetText(repairedName);
end
AltaVoice_Menu_Panel_ChannelName:ClearFocus();
ChatFrame1.editBox:SetText("/leave "..AltaVoice_SVars[AltaVoice_PlayerOfRealm].Monitor_Channel);
ChatEdit_SendText(ChatFrame1.editBox);
AltaVoice_SVars[AltaVoice_PlayerOfRealm].Monitor_Channel = channelName;
AltaVoice_JoinVoiceChannel();
AltaVoice_TalkTable = {};
AltaVoice_UpdateTalkList();
end

function AltaVoice_JoinMasterChannel()
local _, isActive = JoinChannelByName("AltaVoiceMaster");
if (isActive == nil)then
JoinChannelByName("AltaVoiceMaster");
RemoveChatWindowChannel(DEFAULT_CHAT_FRAME:GetID(), "AltaVoiceMaster");
end
AltaVoice_MasterChannelID = GetChannelName("AltaVoiceMaster");
end

function AltaVoice_StartTalk()
if (AltaVoice_ChannelName == nil)then
AltaVoice_JoinVoiceChannel();
end
SendChatMessage("StartTalk", "CHANNEL", AltaVoice_Language, AltaVoice_ChannelName);
end

function AltaVoice_StopTalk()
SendChatMessage("StopTalk", "CHANNEL", AltaVoice_Language, AltaVoice_ChannelName);
end

function AltaVoice_OnEvent()
if (event == "CHAT_MSG_CHANNEL") then
if (AltaVoice_ChannelName == nil)then
AltaVoice_JoinVoiceChannel();
end
local player = arg2;
local fromChannel = arg4;
local monitorChannel = AltaVoice_ChannelName..". "..AltaVoice_SVars[AltaVoice_PlayerOfRealm].Monitor_Channel;
local masterChannel = AltaVoice_MasterChannelID..". AltaVoiceMaster";
if (fromChannel == monitorChannel)then
if (arg1 == "StartTalk")then
AltaVoice_EditTalkTable(player, "talk");
if (AltaVoice_SVars[AltaVoice_PlayerOfRealm].VolumeDip)then
AltaVoice_DipVolume();
end
end
if (arg1 == "StopTalk")then
AltaVoice_EditTalkTable(player, "silent");
end
end
if (fromChannel == masterChannel)then
local msg = arg1;
local command = string.sub(msg,1,3);
local starts, ends = string.find(msg, " ", 5);
local property1 = string.sub(msg, 5, starts-1);
local property2 = string.sub(msg, ends+1);
-- recieve invite request
if ((command == "inv") and (property1 == UnitName("player")))then
AltaVoice_InviteRequestFrom = player;
AltaVoice_InviteRequestChannel = property2;
AltaVoice_InviteRequested(player, property2);
end
-- recieve invite response - Not Accepting
if ((command == "inr") and (property1 == UnitName("player")) and (property2 == "NA"))then
DEFAULT_CHAT_FRAME:AddMessage("AltaVoice : "..player.." is not accepting invites at this time.", 1.0, 0.0, 0.0);
end
-- recieve invite response - Declined
if ((command == "inr") and (property1 == UnitName("player")) and (property2 == "DE"))then
DEFAULT_CHAT_FRAME:AddMessage("AltaVoice : "..player.." declined your invitation.", 1.0, 0.0, 0.0);
end
-- recieve invite response - Already Joined
if ((command == "inr") and (property1 == UnitName("player")) and (property2 == "AJ"))then
DEFAULT_CHAT_FRAME:AddMessage("AltaVoice : "..player.." is already joined to this channel.", 1.0, 0.0, 0.0);
end
-- recieve invite response - Accepted
if ((command == "inr") and (property1 == UnitName("player")) and (property2 == "AC"))then
DEFAULT_CHAT_FRAME:AddMessage("AltaVoice : "..player.." accepted your invitation.", 0.0, 1.0, 0.0);
end
end
end
if (event == "VARIABLES_LOADED")then
AltaVoice_LoadProfile();
end
end

function AltaVoice_EditTalkTable(player, command)
local findloop = 1;
local find = AltaVoice_TalkTable[findloop];
local found = nil
while ((find) and (findloop <= AltaVoice_SpeakListLength))do
local find = AltaVoice_TalkTable[findloop];
if (find == player)then
found = findloop;
end
findloop = findloop +1;
end
if (command == "talk")then
if (AltaVoice_TalkTable[player])then
AltaVoice_TalkTable[player].talk = "talk";
else
AltaVoice_TalkTable[player] = {talk = "talk", name = player};
end
end
if (command == "silent")then
if (AltaVoice_TalkTable[player])then
AltaVoice_TalkTable[player].talk = "silent";
end
end
AltaVoice_UpdateTalkList();
end

function AltaVoice_UpdateTalkList()
local onTalkLoop = 1;
local listLoop = 1;
local noOneTalking = true;
for i=1, table.getn(AltaVoice_TalkTable) do
local getName = AltaVoice_TalkTable[i].name;
local talking = AltaVoice_TalkTable[i].talk;
if ((AltaVoice_SVars[AltaVoice_PlayerOfRealm].ListMode == "OnTalk") and (talking == "talk"))then
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..onTalkLoop.."_Name"):SetText(getName);
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..onTalkLoop):Show();
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..onTalkLoop.."_SpeakTexture"):Show();
noOneTalking = false;
onTalkLoop = onTalkLoop + 1;
end
if (AltaVoice_SVars[AltaVoice_PlayerOfRealm].ListMode == "List")then
if (talking == "talk")then
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop.."_Name"):SetText(getName);
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop):Show();
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop.."_SpeakTexture"):Show();
noOneTalking = false;
end
if (talking == "silent")then
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop.."_Name"):SetText(getName);
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop):Show();
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop.."_SpeakTexture"):Hide();
end
listLoop = listLoop +1;
end
end
if (noOneTalking)then
AltaVoice_ResetVolume();
end
if (AltaVoice_SVars[AltaVoice_PlayerOfRealm].ListMode == "OnTalk")then
while (onTalkLoop <= AltaVoice_SVars[AltaVoice_PlayerOfRealm].SpeakListLength)do
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..onTalkLoop):Hide();
onTalkLoop = onTalkLoop +1;
end
end
if (AltaVoice_SVars[AltaVoice_PlayerOfRealm].ListMode == "List")then
while (listLoop <= AltaVoice_SVars[AltaVoice_PlayerOfRealm].SpeakListLength)do
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop):Hide();
listLoop = listLoop +1;
end
end
end

function AltaVoice_InvitePlayer()
local playerToInvite = AltaVoice_Menu_Panel_InvitePlayerFrame_PlayerToInvite:GetText();
if ((playerToInvite)and(AltaVoice_MasterChannelID))then
SendChatMessage("inv "..playerToInvite.." "..AltaVoice_SVars[AltaVoice_PlayerOfRealm].Monitor_Channel, "CHANNEL", AltaVoice_Language, AltaVoice_MasterChannelID);
DEFAULT_CHAT_FRAME:AddMessage("AltaVoice : Inviting "..playerToInvite.." to join this channel.", 0.0, 1.0, 0.0);
end
end

function AltaVoice_InviteRequested(from, channel)
if (AltaVoice_SVars[AltaVoice_PlayerOfRealm].AllowInvites)then
if (channel == AltaVoice_SVars[AltaVoice_PlayerOfRealm].Monitor_Channel)then
SendChatMessage("inr "..from.." AJ", "CHANNEL", AltaVoice_Language, AltaVoice_MasterChannelID);
else
AltaVoice_InviteRequestWindow_Text:SetText(from.." is inviting you to join "..channel);
AltaVoice_InviteRequestWindow:Show();
end
else
SendChatMessage("inr "..from.." NA", "CHANNEL", AltaVoice_Language, AltaVoice_MasterChannelID);
end
end

function AltaVoice_DipVolume()
if (AltaVoice_VolumeDipped == false)then
AltaVoice_Volume = {};
AltaVoice_Volume.Master = GetCVar("MasterVolume");
AltaVoice_Volume.Sound = GetCVar("SoundVolume");
AltaVoice_Volume.Music = GetCVar("MusicVolume");
AltaVoice_Volume.Ambience = GetCVar("AmbienceVolume");
SetCVar("MasterVolume", AltaVoice_SVars[AltaVoice_PlayerOfRealm].VolumeDipValues.Master);
SetCVar("SoundVolume", AltaVoice_SVars[AltaVoice_PlayerOfRealm].VolumeDipValues.Sound);
SetCVar("MusicVolume", AltaVoice_SVars[AltaVoice_PlayerOfRealm].VolumeDipValues.Music);
SetCVar("AmbienceVolume", AltaVoice_SVars[AltaVoice_PlayerOfRealm].VolumeDipValues.Ambience);
AltaVoice_VolumeDipped = true;
end
end

function AltaVoice_ResetVolume()
if (AltaVoice_VolumeDipped)then
SetCVar("MasterVolume", AltaVoice_Volume.Master);
SetCVar("SoundVolume", AltaVoice_Volume.Sound);
SetCVar("MusicVolume", AltaVoice_Volume.Music);
SetCVar("AmbienceVolume", AltaVoice_Volume.Ambience);
AltaVoice_VolumeDipped = false;
end
end

function AltaVoice_RefreshVisuals()
AltaVoice_VoiceWindowTitle:SetWidth(AltaVoice_SVars[AltaVoice_PlayerOfRealm].Appearance.TalkWindow.Width);
AltaVoice_VoiceWindowTitle:SetScale(AltaVoice_SVars[AltaVoice_PlayerOfRealm].Appearance.TalkWindow.Scale);
AltaVoice_VoiceWindowTitle:SetPoint("TOPLEFT", "AltaVoice_VoiceWindowTitleScaler", "TOPLEFT", 0 ,0);
end

Any help will be much appreciated

Jumpy
15-07-2007, 12:21 AM
Here you are using AltaVoice_TalkTable as an indexed table using integers as the keys. From 1 to some other number.

for i=1, table.getn(AltaVoice_TalkTable) do
local getName = AltaVoice_TalkTable[i].name;
local talking = AltaVoice_TalkTable[i].talk;

Further down you are accessing the AltaVoice_TalkTable using player names.

if (AltaVoice_TalkTable[player])then
AltaVoice_TalkTable[player].talk = "talk";
else

If a table has keys that are a mixture of key types then the table.getn will not return the correct number of entries. I didn't look at all of the code but this might be your problem

Lak
15-07-2007, 01:54 AM
is there a form of for loop that does do that? Or since they are different types it doesn't work? or will the ipairs form work?

Jumpy
15-07-2007, 03:30 AM
for key, value in pairs(AltaVoice_TalkTable) do
if key == something then
-- do something
end

if value == something then
-- do something
end
end

When the last entry in the table is read the scan will end.

Lak
15-07-2007, 04:57 AM
I am sorry, I am new to Lua; so please explain some things for me if you don't mind. The "key" and "value" are they variables that vary from for loop to for loop? Or is "key" the variable and "value" is a set amount? Also was the syntax of the while loop changed?

Jumpy
15-07-2007, 09:35 AM
Here is a simple table named RRA_ClassSpells. The keys are Druid, Priest, Paladin and Shaman. The values are the spell names. A sample lua code might be something like this ...

RRA_ClassSpells = {
["Druid"] = "Healing Touch",
["Priest"] = "Lesser Heal",
["Paladin"] = "Holy Light",
["Shaman"] = "Healing Wave"
}

for k, v in pairs(RRA_ClassSpells) do
if (k == "Paladin" and v == "Holy Light") then
My_Flag = 1
end
end

All Lua tables have a key or index and some value or string associated with that key. Tables can be a lot more complicated than this simple one. Try reading this as a start. http://www.lua.org/pil/

The above is pretty useless code but it illustrates a point. The <for k, v in pairs(tablename) do> statement tells Lua to go through the table one entry at a time and put the key into the variable k and the value into the variable v.
It could also be written
for class, spell in pairs(RRA_ClassSpells) do

Lak
15-07-2007, 09:25 PM
All right! I got it to show your name and the icon for the speaker. The only problem I have now is that when there are more than one person in the same channel the other person's name appears as your own and when you speak the other person's icon lights up as well. Here is the changed code:

function AltaVoice_UpdateTalkList()
local onTalkLoop = 1;
local listLoop = 1;
local noOneTalking = true;
local player = UnitName("player");
local talking = AltaVoice_TalkTable[player].talk;
for k, v in pairs(AltaVoice_TalkTable) do
--local getName = AltaVoice_TalkTable[i].name;
--local talking = AltaVoice_TalkTable[i].talk;
if ((AltaVoice_SVars[AltaVoice_PlayerOfRealm].ListMode == "OnTalk") and (talking == "talk"))then
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..onTalkLoop.."_Name"):SetText(player);
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..onTalkLoop):Show();
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..onTalkLoop.."_SpeakTexture"):Show();
noOneTalking = false;
onTalkLoop = onTalkLoop + 1;
end
if (AltaVoice_SVars[AltaVoice_PlayerOfRealm].ListMode == "List")then
if (talking == "talk")then
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop.."_Name"):SetText(player);
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop):Show();
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop.."_SpeakTexture"):Show();
noOneTalking = false;
end
if (talking == "silent")then
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop.."_Name"):SetText(player);
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop):Show();
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop.."_SpeakTexture"):Hide();
end
listLoop = listLoop +1;
end
end
if (noOneTalking)then
AltaVoice_ResetVolume();
end
if (AltaVoice_SVars[AltaVoice_PlayerOfRealm].ListMode == "OnTalk")then
while (onTalkLoop <= AltaVoice_SVars[AltaVoice_PlayerOfRealm].SpeakListLength)do
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..onTalkLoop):Hide();
onTalkLoop = onTalkLoop +1;
end
end
if (AltaVoice_SVars[AltaVoice_PlayerOfRealm].ListMode == "List")then
while (listLoop <= AltaVoice_SVars[AltaVoice_PlayerOfRealm].SpeakListLength)do
getglobal("AltaVoice_VoiceWindowTitle_UserSpeaking_"..listLoop):Hide();
listLoop = listLoop +1;
end
end
end