Toast, on Jan 4 2009, 02:54 PM, said:
may i add a small suggestion
add a txt or something similar with words that are forbidden and load em into the script
and a small suggestion to moderator - create a lua forum in here

That will be a good feature on the future, thanx to mentioned it. Now i had problems with some script from BotledHate. They have a script, witch reads out the nicks from the Favorites.xml.
--//load DC++ favorite users into talble (LUA5 BCDC / DCDM only)
--// easily modded to do other things.
--// returns a table in the format {["nick1"] = 1, ["nick2"] = 1, ["nick3"] = 1, ... } ...so the names are hashed
function loadFavUsers()
local start=0
local favUsers={}
for line in io.lines("Favorites.xml") do
if string.find(line, "</Users>") then
return favUsers
[b]break[/b]
end
if start ==1 then
local s,e,favnick = string.find(line, "<User Nick=\"(.-)\"")
favUsers[favnick] = 1
end
if string.find(line, "<Users>") then
start=1
end
end
When the break is in the code, the lua says "end" excepted. Without the brake it runs, but had some problem.
--filtering
dcpp:setListener( "pm", "pmlistener",
function( hub, user, text )
if not favUsers[user:getNick()] then
filteringg script from v0.2...
..
.
couple of ends
So if the break is not in the code, it runs, but not care about who is favorite user, filter all PM-s.
Uploaded the file for testing.