+gag (Stand-alone) anyone? :D
um...here a hotted up version of cslave gagging system...
remember to edit the files in the cslave settings folder to make the gagging system act how you want ;)
ftp://cslave.no-ip.org/ptokax_administrations_scripts/other/gagging_system_(standalone).rar
thank you coryzon... but sorry mate i dont realy like your cSlave... coz it was writen like 1 sceipt in 50 part's...
so i need one script one part...
But Thanks anyway my friend :D
lolz...ur a tripa ;)
have u though that maybe updating certain sections can be easierly done with multiple scripts...and how does this make u not like it?
neways...
u can just compile into one script if u really want ;)
and if u cant do i guess i can do for ya...and put the settings up that u want =]
hehehe cool bro :D
no body? :\
Hi,
Hope it helps...
--Requested by D-J Valhala
--Made by nErBoS
sBot = "Gagger"
gagged = {}
gaggedsv = "gagged.dat"
function Main()
frmHub:RegBot(sBot)
LoadFromFile(gaggedsv)
end
function OnExit()
SaveToFile(gaggedsv , gagged , "gagged")
end
function DataArrival(user, data)
if (strsub(data,1,1) == "<" or strsub(data,1,5) == "$To: ") then
if (gagged[strlower(user.sName)] ~= nil) then
user:SendPM(sBot, "You are gagged.")
return 1
end
end
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 == "!gag" and user.bOperator) then
local s,e,gag = strfind(data, "%b<>%s+%S+%s+(%S+)")
if (gag == nil) then
user:SendPM(sBot, "Syntax Error, !gag , you must write a nick.")
else
if (gagged[strlower(gag)] == nil) then
gagged[strlower(gag)] = 1
user:SendPM(sBot, "The user "..gag.." has been gagged.")
else
user:SendPM(sBot, "The user "..gag.." is already gagged.")
end
end
return 1
elseif (cmd == "!ungag" and user.bOperator) then
local s,e,gag = strfind(data, "%b<>%s+%S+%s+(%S+)")
if (gag == nil) then
user:SendPM(sBot, "Syntax Error, !ungag , you must write a nick.")
else
if (gagged[strlower(gag)] == nil) then
user:SendPM(sBot, "The user "..gag.." isn't gagged.")
else
user:SendPM(sBot, "The user "..gag.." has been ungaged.")
gagged[strlower(gag)] = nil
end
end
return 1
end
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
Best regards, nErBoS
Nerbos the prob I have is even tho I gag a user they then act clever by usin the !me command and talk in 3rd person. Does ur gagger prevent this also or isn't that possible?
GREAT man :D
it work great! can you add +gaglist?
Hi,
QuoteOriginally posted by QuikThinker
Nerbos the prob I have is even tho I gag a user they then act clever by usin the !me command and talk in 3rd person. Does ur gagger prevent this also or isn't that possible?
Yes is possible, does your !me talk phrase star with *** ???
Best regards, nErBoS
Hi,
Gaglist and !me block if it starts with "*"...
--Requested by D-J Valhala
--Made by nErBoS
sBot = "Gagger"
gagged = {}
gaggedsv = "gagged.dat"
function Main()
frmHub:RegBot(sBot)
LoadFromFile(gaggedsv)
end
function OnExit()
SaveToFile(gaggedsv , gagged , "gagged")
end
function DataArrival(user, data)
if (strsub(data,1,1) == "<" or strsub(data,1,5) == "$To: " or strsub(data,1,1) == "%*") then
if (gagged[strlower(user.sName)] ~= nil) then
user:SendPM(sBot, "You are gagged.")
return 1
end
end
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 == "!gag" and user.bOperator) then
local s,e,gag = strfind(data, "%b<>%s+%S+%s+(%S+)")
if (gag == nil) then
user:SendPM(sBot, "Syntax Error, !gag , you must write a nick.")
else
if (gagged[strlower(gag)] == nil) then
gagged[strlower(gag)] = 1
user:SendPM(sBot, "The user "..gag.." has been gagged.")
else
user:SendPM(sBot, "The user "..gag.." is already gagged.")
end
end
return 1
elseif (cmd == "!ungag" and user.bOperator) then
local s,e,gag = strfind(data, "%b<>%s+%S+%s+(%S+)")
if (gag == nil) then
user:SendPM(sBot, "Syntax Error, !ungag , you must write a nick.")
else
if (gagged[strlower(gag)] == nil) then
user:SendPM(sBot, "The user "..gag.." isn't gagged.")
else
user:SendPM(sBot, "The user "..gag.." has been ungaged.")
gagged[strlower(gag)] = nil
end
end
return 1
elseif (cmd == "!gaglist" and user.bOperator) then
ShowGagList(user)
return 1
end
end
end
function ShowGagList(user)
local sTmp = "Users that are gagged in this Hub:\r\n\r\n"
local usr,aux
for usr, aux in gagged do
sTmp = sTmp..usr.."\r\n"
end
user:SendPM(sBot, sTmp)
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
Best regards, nErBoS
Perfect Nerbos! But just one more thing, when u gag sum1, can it make a note of it in main chat like b4 coz now it just comes up in PM that the person has been gagged?
hehehe Great! it work perfect!!! :D
thank you mate
Hi,
Done...
--Requested by D-J Valhala
--Made by nErBoS
sBot = "Gagger"
gagged = {}
gaggedsv = "gagged.dat"
function Main()
frmHub:RegBot(sBot)
LoadFromFile(gaggedsv)
end
function OnExit()
SaveToFile(gaggedsv , gagged , "gagged")
end
function DataArrival(user, data)
if (strsub(data,1,1) == "<" or strsub(data,1,5) == "$To: " or strsub(data,1,1) == "%*") then
if (gagged[strlower(user.sName)] ~= nil) then
user:SendPM(sBot, "You are gagged.")
return 1
end
end
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 == "!gag" and user.bOperator) then
local s,e,gag = strfind(data, "%b<>%s+%S+%s+(%S+)")
if (gag == nil) then
user:SendPM(sBot, "Syntax Error, !gag , you must write a nick.")
else
if (gagged[strlower(gag)] == nil) then
gagged[strlower(gag)] = 1
user:SendPM(sBot, "The user "..gag.." has been gagged.")
SendToAll(sBot, "The user "..gag.." has been gagged by "..user.sName..".")
else
user:SendPM(sBot, "The user "..gag.." is already gagged.")
end
end
return 1
elseif (cmd == "!ungag" and user.bOperator) then
local s,e,gag = strfind(data, "%b<>%s+%S+%s+(%S+)")
if (gag == nil) then
user:SendPM(sBot, "Syntax Error, !ungag , you must write a nick.")
else
if (gagged[strlower(gag)] == nil) then
user:SendPM(sBot, "The user "..gag.." isn't gagged.")
else
user:SendPM(sBot, "The user "..gag.." has been ungaged.")
SendToAll(sBot, "The user "..gag.." has been ungagged by "..user.sName..".")
gagged[strlower(gag)] = nil
end
end
return 1
elseif (cmd == "!gaglist" and user.bOperator) then
ShowGagList(user)
return 1
end
end
end
function ShowGagList(user)
local sTmp = "Users that are gagged in this Hub:\r\n\r\n"
local usr,aux
for usr, aux in gagged do
sTmp = sTmp..usr.."\r\n"
end
user:SendPM(sBot, sTmp)
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
Best regards, nErBoS
nErBoS = gEnIuS :]
hehehehe GREAT my friend the script is perferct! thank you again for the 1000000 time :D