+gag (Stand-alone)
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

+gag (Stand-alone)

Started by D-J Valhala, 14 May, 2004, 09:25:00

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

D-J Valhala

+gag (Stand-alone) anyone? :D
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

Corayzon

#1
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

D-J Valhala

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
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

Corayzon

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 =]

D-J Valhala

hehehe cool bro :D
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

D-J Valhala

My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

nErBoS

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 Spot ##--

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?

D-J Valhala

GREAT man :D
it work great! can you add +gaglist?
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

nErBoS

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
--## nErBoS Spot ##--

nErBoS

#10
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
--## nErBoS Spot ##--

QuikThinker

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?

D-J Valhala

hehehe Great! it work perfect!!! :D
thank you mate
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

nErBoS

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 Spot ##--

QuikThinker

nErBoS = gEnIuS  :]

D-J Valhala

hehehehe GREAT my friend the script is perferct! thank you again for the 1000000 time :D
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

SMF spam blocked by CleanTalk