seeing recipient of an advert in opchat
 

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

seeing recipient of an advert in opchat

Started by deus, 14 August, 2005, 21:26:34

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

deus

i got a anti advert scripts and i want to add one function to it, the addition is that i want to see who the recipient of the advertise is...

example: User "SomeUser" was banned for advertising to "OtherUser": somehub.somedomain.com

i got it all working except the "OtherUser"... is it even possible to see who gets the pm?

it would be really great if someone could help me out with this...

thanx in advance
Deus

*EDIT*
maybe I should have posted this in "help with scripts" but in that case maybe some nice moderator can move it there
*EDIT*

Jelf

here..
----------------------------------------------------------------- 
-- A.I. Anti Advertising v1.1 - written by Guibs 21th Apr 2003 -- 
----------------------------------------------------------------- 
--------------------- 
-- Version History -- 
--------------------- 
-- Converted to Lua5 By Jelf 10/03/05
-- v1.1 Changes synthax about 'strfind' (Thks to sedulus for the tips), by Guibs 21th Apr 2003 
-- v1.1 added +allowedadd, +refusedadd commands (Thks to Dazzler for the ideas), by Guibs 21th Apr 2003 
-- v1.0 first version. Greets to sebastiannielsen for the cool idea 

-- It works in PM, and on the main chat & blocks the bad addresses 
-- Ops can't be kicked 
-- Edit the safeadd list, to put your good hub addresses 

------------------------------------ 
-- Sourcecode is below this point -- 
------------------------------------ 

safeadd = { 
["landofps.ath.cx"]=1, 
["landofps2.ath.cx"]=2
} 

trigs = { 
["dns2go"]=1, 
["myftpsite"]=2, 
["servebeer"]=3, 
["mine.nu"]=4, 
["ip.com"]=5, 
["dynip"]=6, 
["staticip"]=7, 
["serveftp"]=8, 
["ipactive"]=9, 
["ip.org"]=10, 
["servegame"]=11, 
["ath.cx"]=12, 
["dyndns"]=13, 
["clanpimp"]=14, 
["idlegames"]=15, 
["sytes"]=16, 
["uni.cc"]=17, 
["homeunix"]=18, 
["deftonzs.com"]=19, 
["flamenap"]=20, 
["xs4all"]=21, 
["serveftp"]=22, 
["myftp"]=23, 
["http://www.angelfire.com"]=24, 
["hopto.org"]=25, 
["orgdns"]=26 
} 

--------------------- 
-- Global Settings -- 
--------------------- 
returndata = 0 
founded = 0 
safe = 0 
allowedadd = 0 
refusedadd = 0 
opchat = frmHub:GetOpChatName()
Bot = frmHub:GetHubBotName() 
---------------------------------
function ChatArrival(user, data) 
	if (string.sub(data,1,1)=="<") then 
		data=string.sub(data,1,string.len(data)-1) 
		s,e,to,cmd=string.find(data,"<(.*)>%s+(%S+)") 
		cmd=string.lower(cmd) 
		s,e,cmd = string.find(data,"%b<>%s+(%S+)") 
		if user.bOperator then 
			if (cmd=="+allowedadd") then 
				user:SendData(Bot, allowedadd.." allowed addresses have been sent on the main chat or in pm") 
				returndata = 1
				return 1
			elseif (cmd=="+refusedadd") then 
				user:SendData(Bot, refusedadd.." refused addresses have been sent on the main chat or in pm") 
				returndata = 1 
				return 1
			end 
		end
		if user.bOperator then 
		else 
			for key,a in trigs do 
				if(string.find(string.lower(data),key,5,1)) then 
					founded = 1 
					break 
				end 
			end 
			if founded == 1 then 
				for safekey,a in safeadd do 
					if(string.find(string.lower(data),safekey,5,1)) then 
						safe = 1 
						break 
					end 
				end 
			end 
			if founded == 1 then 
				if safe == 1 then 
					allowedadd=allowedadd+1 
				else 
					returndata = 1 
					refusedadd=refusedadd+1 
					SendPmToOps(opchat, user.sName.." has been disconnected because of advertising: "..data ) 
					user:SendData(Bot, "You have been disconnected because of advertising") 
					user:Disconnect() 
				end 
			end 
		end 
	end
end
-----------------------------
function ToArrival(user, data)
	if(string.sub(data, 1, 4) == "$To:") then 
		data=string.sub(data,1,string.len(data)-1) 
		s,e,whoTo = string.find(data,"$To:%s+(%S+)") 
		s,e,To,from,cmd = string.find(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)") 
		if user.bOperator then 
		else 
			for key,a in trigs do 
				if(string.find(string.lower(data),key,17,1)) then 
					founded = 1 
					break 
				end 
			end 
			if founded == 1 then 
				for safekey,a in safeadd do 
					if(string.find(string.lower(data),safekey,17,1)) then 
						safe = 1 
						break 
					end 
				end 
			end 
			if founded == 1 then 
				if safe == 1 then 
					allowedadd=allowedadd+1 
				else 
					returndata = 1 
					refusedadd=refusedadd+1 
					SendPmToOps(opchat, user.sName.." has been disconnected because of advertising: "..data ) 
					user:SendData(Bot, "You have been disconnected because of advertising") 
					user:Disconnect() 
				end 
			end 
		end 
	end 
	return returndata 
end
Just change the hub addy in safeadd for addresses which are ok to advertise, I left some in just to show you how they look.

deus

thanks for the fast reply... didnt need the entire script but i found the part i needed...

works perfectly

SMF spam blocked by CleanTalk