ip checker and another script
 

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

ip checker and another script

Started by andrue, 09 March, 2004, 23:33:37

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

andrue

i have 2 scripts that i need>>

1) I want a script to check that people are actually from their school by checking their ip. for example, a person from UCLA will have 169.232 and their name will be [UCLA]name. if not,  it states in the chat that they are not from the right school, so i can warn or kick them.

the school tag/ ip's are:
169.232 for [ucla]name
128.54 for [ucsd]name
169.  for [ucb]name
120. for [usd]name

2) i want a script that makes it so, when some types "+whatever" or "!whatever" or "/whatever", it doesnt show it in the chatroom, but it does actually work, so when people put stuff like +rules, we dont have like 10 people doing it. just to stop spam.

thanks

nErBoS

Hi,

1? Request...

--Requested by andrue
--Made by nErBoS

Bot = "IP-Look"


function Main()
frmHub:RegBot(Bot)
end

function NewUserConnected(user, data)
local s,e,a,b,c,d = strfind(user.sIP, "(%d+).(%d+).(%d+).(%d+)")
	if ("169.232." == a.."."..b..".") then
		if (strsub(user.sName,1,6) == "[ucla]") then
		else
			SendToAll(Bot, "The user "..user.sName.." is not from the right school.")
		end
	elseif ("128.54." == a.."."..b..".") then
		if (strsub(user.sName,1,6) == "[ucsd]") then
		else
			SendToAll(Bot, "The user "..user.sName.." is not from the right school.")
		end
	elseif ("169." == a..".") then
		if (strsub(user.sName,1,5) == "[ucb]") then
		else
			SendToAll(Bot, "The user "..user.sName.." is not from the right school.")
		end
	elseif ("120." == a..".") then
		if (strsub(user.sName,1,5) == "[usd]") then
		else
			SendToAll(Bot, "The user "..user.sName.." is not from the right school.")
		end
	else
	end
end

Hope it helps.

2? Request..

Just put in the end of ever command "return 1"

Best regards, nErBoS
--## nErBoS Spot ##--

pHaTTy

QuoteOriginally posted by nErBoS
Hi,

1? Request...

--Requested by andrue
--Made by nErBoS

Bot = "IP-Look"


function Main()
frmHub:RegBot(Bot)
end

function NewUserConnected(user, data)
local s,e,a,b,c,d = strfind(user.sIP, "(%d+).(%d+).(%d+).(%d+)")
	if ("169.232." == a.."."..b..".") then
		if (strsub(user.sName,1,6) == "[ucla]") then
		else
			SendToAll(Bot, "The user "..user.sName.." is not from the right school.")
		end
	elseif ("128.54." == a.."."..b..".") then
		if (strsub(user.sName,1,6) == "[ucsd]") then
		else
			SendToAll(Bot, "The user "..user.sName.." is not from the right school.")
		end
	elseif ("169." == a..".") then
		if (strsub(user.sName,1,5) == "[ucb]") then
		else
			SendToAll(Bot, "The user "..user.sName.." is not from the right school.")
		end
	elseif ("120." == a..".") then
		if (strsub(user.sName,1,5) == "[usd]") then
		else
			SendToAll(Bot, "The user "..user.sName.." is not from the right school.")
		end
	else
	end
end

Hope it helps.

2? Request..

Just put in the end of ever command "return 1"

Best regards, nErBoS

hmm couple tips to cut down

--Requested by andrue
--Made by nErBoS

Bot = "IP-Look"


function Main()
	frmHub:RegBot(Bot)
end

function NewUserConnected(user, data)
	local s,e,a,b,c,d = strfind(user.sIP, "(%d+).(%d+).(%d+).(%d+)")
	if ("169.232." == a.."."..b..".") then
		if not (strsub(user.sName,1,6) == "[ucla]") then
			SendToAll(Bot, "The user "..user.sName.." is not from the right school.")
		end
	elseif ("128.54." == a.."."..b..".") then
		if not (strsub(user.sName,1,6) == "[ucsd]") then
			SendToAll(Bot, "The user "..user.sName.." is not from the right school.")
		end
	elseif ("169." == a..".") then
		if not (strsub(user.sName,1,5) == "[ucb]") then
			SendToAll(Bot, "The user "..user.sName.." is not from the right school.")
		end
	elseif ("120." == a..".") then
		if not (strsub(user.sName,1,5) == "[usd]") then
			SendToAll(Bot, "The user "..user.sName.." is not from the right school.")
		end
	end
end

cut down on the else's when possible and use not or ~=

etc later,,


PS: you have some text check againt a  local, try turn it other way around if a..b == sort of thing ;)
Resistance is futile!

nErBoS

Hi,

Thanks phatty i willl take that in mind.

Best regards, nErBoS
--## nErBoS Spot ##--

SMF spam blocked by CleanTalk