Block URL links
 

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

Block URL links

Started by Zigurds, 01 November, 2005, 17:07:03

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zigurds

Need scripts for block URL links in maichat


Sorry my bad English :(
------------------------------------
Owner for Latvian hub Alfa

6Marilyn6Manson6

#1
Try this:

-- Block URL links 0.1
-- Made by 6Marilyn6Manson6 by 01/11/2005
--
-- Set action for advertising ( 0=Warn / 1=Disconnect / 2=Kick / 3=Ban / 4=TimeBan)
BotName = "NoLinks"
Action = 1
TimeBan = 20 -- Time Ban period

SITES = { "www.","http://","ftp://","irc.","cs." }

function Main()
	frmHub:RegBot(BotName)
end

function SiteCheck(user,msg)
for value,index in SITES do
	if string.find(msg,index) then
		if Action==0 then
			user:SendPM(BotName,"You are Warned for advertising: "..msg) return "Warned"
		elseif Action==1 then
			user:SendPM(BotName,"You are Disconnected for advertising: "..msg) user:Disconnect() return "Disconnected"
		elseif Action==2 then
			user:SendPM(BotName,"You are Kicked for advertising: "..msg) user:TempBan() return "Kicked" 
		elseif Action==3 then
			user:SendPM(BotName,"You are Banned for advertising: "..msg) user:Ban() return "Banned"
		elseif Action==4 then
			user:SendPM(BotName,"You are TimeBanned for advertising: "..msg) user:TimeBan(TimeBan) return "TimeBanned"
			end
		end	
	end
end

C ya

Cêñoßy†ê

#2
Small fix  :]

-- Block URL links 0.1
-- Made by 6Marilyn6Manson6 by 01/11/2005
--
-- Set action for advertising ( 0=Warn / 1=Disconnect / 2=Kick / 3=Ban / 4=TimeBan)
BotName = "NoLinks"
Action = 1
TimeBan = 20 -- Time Ban period

SITES = { "www.","http://","ftp://","irc.","cs." }

function Main()
	frmHub:RegBot(BotName)
end

function SiteCheck(user,msg)
for value,index in SITES do
	if string.find(msg,index) then
		if Action==0 then
			user:SendPM(BotName,"You are Warned for advertising: "..msg) return "Warned"
		elseif Action==1 then
			user:SendPM(BotName,"You are Disconnected for advertising: "..msg) user:Disconnect() return "Disconnected"
		elseif Action==2 then
			user:SendPM(BotName,"You are Kicked for advertising: "..msg) user:TempBan() return "Kicked" 
		elseif Action==3 then
			user:SendPM(BotName,"You are Banned for advertising: "..msg) user:Ban() return "Banned"
		elseif Action==4 then
			user:SendPM(BotName,"You are TimeBanned for advertising: "..msg) user:TimeBan(TimeBan) return "TimeBanned"
			[COLOR=red]end[/COLOR] 
		end
	end
end
Powered By Leviathan™ 2nd Generation v. 1.9

6Marilyn6Manson6

Oh yeah sorry for my error.. i ave made it in 2 minutes :p.. Post update. Thanks Cb :D

Zigurds


6Marilyn6Manson6

QuoteOriginally posted by Zigurds
thanks :)))

Welcome dude :D

Zigurds

Sorry, one moment

Need only not visible URL links in maichat,
unwanted warns, bans or kicks

for admin rule extraneous


Sorry my bad English :(
------------------------------------
Owner for Latvian hub Alfa

Zigurds

note. Only mainchat, no private

Cêñoßy†ê

Try this one

-- Block URL links 0.1
-- Made by 6Marilyn6Manson6 by 01/11/2005
-- Mixed with parts of Simple AntiAdvertising Bot by NightLitch 2005-07-10 by C??o?y??
-- requested by Zigurds
-- Checks only mainchat
-- Set action for advertising ( 0=Warn / 1=Disconnect / 2=Kick / 3=Ban / 4=TimeBan)
-- Set who can type URL's ( 0=Yes 1=No)

BotName = "NoLinks"
Action = 0
TimeBan = 20 -- Time Ban period

CheckWho = {
	[0] = 0,	--Master
	[1] = 0,	--Operator
	[2] = 1,	--Vip
	[3] = 1,	--Reg
	[-1] = 1,	--Unregistered
}

function Main()
	frmHub:RegBot(BotName)
end

adverTable = { "www.","http://","ftp://","irc.","cs."}

function ChatArrival(user,data)
	if CheckWho == 1 then
	local s,e,msg = string.find(data, "%b<>%s*(.*)%|$")
	if checkForAdvertising(msg) then
		if Action == 0 then
		user:SendPM(BotName,"You are Warned for advertising: "..msg)
		SendToOps(BotName, "*** User "..user.sName.." has been warned for advertising: "..msg)
		return "Warned"
end
		if Action == 1 then
		user:SendData(BotName, "*** You have been Disconnected for advertising !!")
		SendToOps(BotName, "*** User "..user.sName.." has been Disconnected for advertising: "..msg)
		user:TempBan() return "Disconnected"
end
		if Action == 2 then
		user:SendData(BotName, "*** You have been kicked for advertising !!")
		SendToOps(BotName, "*** User "..user.sName.." has been kicked for advertising: "..msg)
		user:TempBan() return "Kicked"
end
		if Action == 3 then
		user:SendData(BotName, "*** You have been banned for advertising !!")
		SendToOps(BotName, "*** User "..user.sName.." has been banned for advertising: "..msg)
		user:Ban() return "Banned"
end
		if Action == 4 then
		user:SendData(BotName, "*** You have been timebanned for advertising !!")
		SendToOps(BotName, "*** User "..user.sName.." has been timebanned for advertising: "..msg)
		user:TimeBan(TimeBan) return "TimeBanned"
			end 
		end
	end
end

function checkForAdvertising(msg)
	for i = 1,table.getn(adverTable) do
		if string.find( msg , adverTable[i] , 1 , true ) then
			return 1
		end
	end
	return
end
Powered By Leviathan™ 2nd Generation v. 1.9

6Marilyn6Manson6

GooD Cy?e??o?.. NightLitch is superstar :D

6Marilyn6Manson6

Small update in CheckWho:

-- Block URL links 0.1
-- requested by Zigurds
-- Made by 6Marilyn6Manson6 by 01/11/2005
--
-- Set action for advertising ( 0=Warn / 1=Disconnect / 2=Kick / 3=Ban / 4=TimeBan)
-- Set who can type URL's ( 0=Yes 1=No)
-- Checks only mainchat

BotName = "NoLinks"
Action = 0
TimeBan = 20 -- Time Ban period

CheckWho = {
	[0] = 0,	--Master
	[1] = 0,	--Operator
	[2] = 1,	--Vip
	[3] = 1,	--Reg
	[4] = 0,	--Moderator
	[5] = 0,	--NetFounder
	[-1] = 1,	--Unregistered
}

function Main()
	frmHub:RegBot(BotName)
end

adverTable = { "www.","http://","ftp://","irc.","cs."}

function ChatArrival(user,data)
	if CheckWho == 1 then
	local s,e,msg = string.find(data, "%b<>%s*(.*)%|$")
		if checkForAdvertising(msg) then
			if Action == 0 then
				user:SendPM(BotName,"You are Warned for advertising: "..msg)
				SendToOps(BotName, "*** User "..user.sName.." has been warned for advertising: "..msg)
				return "Warned"
			end
			if Action == 1 then
				user:SendData(BotName, "*** You have been Disconnected for advertising !!")
				SendToOps(BotName, "*** User "..user.sName.." has been Disconnected for advertising: "..msg)
				user:TempBan() return "Disconnected"
			end
			if Action == 2 then
				user:SendData(BotName, "*** You have been kicked for advertising !!")
				SendToOps(BotName, "*** User "..user.sName.." has been kicked for advertising: "..msg)
				user:TempBan() return "Kicked"
			end
			if Action == 3 then
				user:SendData(BotName, "*** You have been banned for advertising !!")
				SendToOps(BotName, "*** User "..user.sName.." has been banned for advertising: "..msg)
				user:Ban() return "Banned"
			end
			if Action == 4 then
				user:SendData(BotName, "*** You have been timebanned for advertising !!")
				SendToOps(BotName, "*** User "..user.sName.." has been timebanned for advertising: "..msg)
				user:TimeBan(TimeBan) return "TimeBanned"
			end 
		end
	end
end

function checkForAdvertising(msg)
	for i = 1,table.getn(adverTable) do
		if string.find( msg , adverTable[i] , 1 , true ) then
			return 1
		end
		end
	return
end

C ya

Zigurds

He he, mutual grace :)

6Marilyn6Manson6

QuoteOriginally posted by Zigurds
He he, mutual grace :)

No prob you're welcome here :D

SMF spam blocked by CleanTalk