Hi,
I have a table... In this table are a lot of values, but there is always (when excists) the value "kicks":
KickStats = {
["bla"] = {
["kicks"] = 1,
["---=== request ===---\\hoi.temp.mp3"] = 1,
},
["[CHILL]Roel"] = {
["kicks"] = 6,
["---=== request ===---\\bla.temp.mp3"] = 3,
["---=== request ===---\\testfor-mepper.part.met"] = 3,
},
}
Now I want to view this table by command. So I made a "for loop": if KickStats[nick] then
local sTmp,i,v = ""
for i,v in KickStats[nick] do
sTmp = sTmp..i.."\r\n"
end
totKickDetails = sTmp
if string.find((totKickDetails),"kicks") then
-- ## HELP! What can I do to remove kick from this table? ## --
-- I want all results, but if is "kicks" is in table, I want all results without "kicks".
SendToAll(bot,"bla")
end
else
totKickDetails = "#### NONE ####"
end
As you can see... I have a problem. "kicks" is always there, but shouldn't be showed. User: [CHILL]Roel
**********************
WARNS:
#### NONE ####
BIG-WARNS:
#### NONE ####
KICKS:
kicks
---=== request ===---\bla.temp.mp3
---=== request ===---\testfor-mepper.part.met
How do I do that? I really have no idea. I can catch it, but I don't know how to give it a new value, like "" <--- so the value isn't there :P
Help would be appriciated!
Ok... many many thanx to Mutor he helped me out fixing this problem!
if KickStats[nick] then
local sTmp,i,v = ""
for i,v in KickStats[nick] do
sTmp = sTmp..v.."\t"..i.."\r\n"
end
sTmp = string.gsub(sTmp,"%d\tkicks\r\n","")
totKickDetails = sTmp
else
totKickDetails = "#### NONE ####"
end
That is how the prob is solved, using a string.gsub! Thanx again Mutor!