ISP Block
 

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

ISP Block

Started by acrespo, 18 October, 2003, 20:23:22

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

acrespo

I need a script to block all users don't have some ISPs.
If a user don't have [WAS],
 (and other ISPs setting in the script), this user will disconnect with a message.

BlazeXxX

Hi there,
Are you only talking about the Prefixs or the actualy IP ranges of the ISPs ?

If this is what you wanting to do, just add a nick rule in ptokax soft:

(\[BBB\]|\[ISP1\]|\[512k\]|\[BT\])

Just add the nick prefixs u want to allow in... Sorry If i got the wrong understanding of your question  :rolleyes:

acrespo

I already found a script to do a ISP block. See below:
BotName = "NickCheck" 
ISP = {"[BR]","[WAS]"} 

-- Main Sub 
function Main() 
	frmHub:RegBot(BotName) 
end 


function NewUserConnected(curUser) 

	for key, value in ISP do --Loop ISP Array 
		if curUser.iProfile == -1 then
			if (strfind(strlower(curUser.sName), strlower(value),1,1)) then 
				x=1 
				break 
			else 
				x=0 
			end 
		else
			x=1
			break
		end
	end 

	if (x == 0) then 
		-- Kick user 
		curUser:SendPM(BotName, "") 
		curUser:SendPM(BotName, "You need a correct ISP to connect in this Hub. Write [WAS] or [BR] in your nickname. Example: [WAS]MyUser.") 
		curUser:Disconnect() 
	end 
end


Only not registered user are checked by this script.

klownietklowniet

#3
This is another version I made a little while ago. It just check for a tag, not a specific one. So all users without tags get dicsonnected. Nice feature is the bugging... :-)

-- Date: 25-09-2003 
--
-- code from klownietklowniet 
-- network: [ > DC - UniteD < ]
--
-- Request by Snake
--
-- version 2.0
--
-- Note1: To work it has to be started before a user connects
-- Note2: BugTime is the time, in seconds, between every pm warning!
--
-- Fix: Message not sent to registered users (thanks to [DK]MR-Kandis for the suggestion)

BotName = "ISPBugger"
BugTime = 5
BugMessage = "Please put your isp or country code in front of your nick in brackets [] and you will not see this pm again."

bug = {}

function Main()
   secBugTime = BugTime * 1000
   SetTimer(secBugTime)
   StartTimer()
end

function NewUserConnected(curUser)

   if curUser.iProfile < 0 then
      if strfind(curUser.sName, "^(%[%S+%])") or strfind(curUser.sName, "^(%(%S+%))") then

      else
         curUser:SendPM(BotName,BugMessage)
         bug[curUser.sName] = curUser.sIP	
      end
   end
end


function UserDisconnected(curUser)
   if curUser.iProfile < 0 then
      bug[curUser.sName] = nil
   end
end

function OnTimer()
   for n, i in bug do
      local tmpuser = GetItemByName(n)
      if tmpuser ~= nil then
         tmpuser:SendPM(BotName,BugMessage)
      end
   end
end
[ > DC - UniteD < ]

sajy2k

QuoteOriginally posted by acrespo
I already found a script to do a ISP block. See below:
BotName = "NickCheck" 
ISP = {"[BR]","[WAS]"} 

-- Main Sub 
function Main() 
	frmHub:RegBot(BotName) 
end 


function NewUserConnected(curUser) 

	for key, value in ISP do --Loop ISP Array 
		if curUser.iProfile == -1 then
			if (strfind(strlower(curUser.sName), strlower(value),1,1)) then 
				x=1 
				break 
			else 
				x=0 
			end 
		else
			x=1
			break
		end
	end 

	if (x == 0) then 
		-- Kick user 
		curUser:SendPM(BotName, "") 
		curUser:SendPM(BotName, "You need a correct ISP to connect in this Hub. Write [WAS] or [BR] in your nickname. Example: [WAS]MyUser.") 
		curUser:Disconnect() 
	end 
end


Only not registered user are checked by this script.

I got this message Syntax Error: `)' expected (to close `(' at line 28);
  last token read: `curUser' at line 29 in string "BotName = "NickCheck"
..."

[SWE]henrik

QuoteOriginally posted by klownietklowniet
This is another version I made a little while ago. It just check for a tag, not a specific one. So all users without tags get dicsonnected. Nice feature is the bugging... :-)

this is a nice one, ill save it for later, keep it up
Acoustic & World Music
jokiboxII.no-ip.info

sajy2k

-- Bad Nick kicker by Sajy2k? 
-- Added the excact opposite ;-) 

forbiddenNicks = {"$","^","|","%","*"} 
forcedNicks = {"[Tags]"} 
Bot = "[Botname]" 

function Main() 
frmHub:RegBot(Bot) 
end 

function checkNickWords(nick,curUser) 
for key,word in forbiddenNicks do 
if strfind(strlower(nick), strlower(word),1,1) then 
curUser:SendPM(Bot, word.." is not allowed to have in a nick! Change your nick and reconnect!") 
return 1 
end 
end 
end 

function doCheckForcedNicks(usernick) 
for key,nick in forcedNicks do 
if strfind(strlower(usernick),strlower(nick),1,1) then return end 
end return 1 
end 

function ShowForced() 
line = "" 
for key,a in forcedNicks do 
line = line..a..", " 
end 
return line 
end 

function NewUserConnected(curUser) 
if checkNickWords(curUser.sName, curUser) then 
curUser:Disconnect() 
elseif doCheckForcedNicks(curUser.sName) then 
curUser:SendPM(Bot, "You must have [Tags] tags in front of your nick to enter this hub and with [ ] and not ( ) for example: [Tags] Nickname") 
curUser:Disconnect() 
end 
end  

SMF spam blocked by CleanTalk