Hi,
The script in cause...
--Requested by Bladerunneruk
--Made by nErBoS
sBot = "The Hider"
hide = {}
hidesv = "hide.dat"
function Main()
frmHub:RegBot(sBot)
frmHub:EnableFullData(1)
LoadFromFile(hidesv)
RefreshHide()
end
function OnExit()
SaveToFile(hidesv , hide , "hide")
end
function OpDisconnect(user, data)
if (user.iProfile == 0) then
hide[user.sName] = nil
frmHub:UnregBot(user.sName)
end
end
function DataArrival(user, data)
if (strsub(data,1,1) == "<" or strsub(data,1,5+strlen(sBot)) == "$To: "..sBot) then
data = strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data, "%b<>%s+(%S+)")
if (cmd == "!hide" and user.iProfile == 0) then
if (hide[user.sName] == nil) then
hide[user.sName] = 1
frmHub:UnregBot(user.sName)
user:SendPM(sBot, "You are now hide from the user list")
else
user:SendPM(sBot, "You are already hide from the user list")
end
return 1
elseif (cmd == "!unhide" and user.iProfile == 0) then
if (hide[user.sName] ~= nil) then
hide[user.sName] = nil
frmHub:RegBot(user.sName)
user:SendPM(sBot, "You are now back to the user list")
else
user:SendPM(sBot, "You are not hide from the Hub")
end
return 1
end
end
if (strsub(data,1,12) == "$GetNickList") then
RefreshHide()
end
if (strsub(data,1,5) == "$To: ") then
local s,e,usr = strfind(data, "$To:%s+(%S+)")
if (hide[usr] ~= nil) then
return 1
end
end
end
function RefreshHide()
local usr,aux
for usr, aux in hide do
frmHub:UnregBot(usr)
end
end
function Serialize(tTable, sTableName, sTab)
assert(tTable, "tTable equals nil");
assert(sTableName, "sTableName equals nil");
assert(type(tTable) == "table", "tTable must be a table!");
assert(type(sTableName) == "string", "sTableName must be a string!");
sTab = sTab or "";
sTmp = ""
sTmp = sTmp..sTab..sTableName.." = {\n"
for key, value in tTable do
local sKey = (type(key) == "string") and format("[%q]",key) or format("[%d]",key);
if(type(value) == "table") then
Serialize(value, sKey, sTab.."\t");
else
local sValue = (type(value) == "string") and format("%q",value) or tostring(value);
sTmp = sTmp..sTab.."\t"..sKey.." = "..sValue
end
sTmp = sTmp..",\n"
end
sTmp = sTmp..sTab.."}"
return sTmp
end
function SaveToFile(file , table , tablename)
writeto(file)
write(Serialize(table, tablename))
writeto()
end
function LoadFromFile(file)
if (readfrom(file) ~= nil) then
readfrom(file)
dostring(read("*all"))
readfrom()
end
end
This script will block any PM if the user chooses to hide, but the others script PM are by passing.
Best regards, nErBoS