little ip check
 

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

little ip check

Started by dragos_sto, 17 May, 2005, 03:01:33

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dragos_sto

this script check ip from user connected activ to hub
if dont match return a msg and the ip of user
and  optional disconect user
--Correct-IP-V.1 for Active users 

BotName = frmHub:GetHubBotName().."_IpCheck"

function SearchArrival(curUser, data) 
	if data ~= nil then
		 local s,e,userIP,r = string.find(data, "$Search%s+([^$]*):(.*)")
		if string.lower(userIP) ~= "hub" then
			if userIP ~= curUser.sIP then 
				curUser:SendData(BotName,"msg  "..curUser.sIP) 
				-- curUser:Disconnect()
			end
		end 
	end
end

CaSaNoVa

Syntax ...\0.3.3.0.b17.07.nt.dbg\scripts\tt.lua:8: attempt to call global `strlower' (a nil value)

TTB

change:
if strlower(userIP) ~= "hub" then
into:
if string.lower(userIP) ~= "hub" then
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

CaSaNoVa


TTB

There is no command by this script. It only checks a user who logs in...

The final script is:

--Correct-IP-V.1 for Active users 

BotName = frmHub:GetHubBotName().."_IpCheck"

function SearchArrival(curUser, data) 
	if data ~= nil then
		local s,e,userIP,r = string.find(data, "$Search%s+([^$]*):([^$]+)") 
		if string.lower(userIP) ~= "hub" then
			if userIP ~= curUser.sIP then 
				curUser:SendData(BotName,"msg  "..curUser.sIP) 
				-- curUser:Disconnect()
			end
		end 
	end
end
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

CaSaNoVa

I'm searching a script who find me an ip,who had it,as about yhub.
Ipinfo,Iprangeinfo,even if user is not on-line.

TTB

QuoteOriginally posted by CaSaNoVa
I'm searching a script who find me an ip,who had it,as about yhub.
Ipinfo,Iprangeinfo,even if user is not on-line.

Ip info can be done with a script NL just released...
Standalone Userinfo Database
Search for it on the board. IP-range info was available in LUA4, but connecting to servers by script is not available in LUA5. Go to //www.dnsstuff.com for the info you need for the ranges.
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

dragos_sto

10x ttb for correction of my script
i see have errors but i forget to correct'it

dragos_sto

ttb , i dont know why when a strongdc++ client , zdc++ .
when make a search, the line code

code:


local s,e,userIP,r = string.find(data, "$Search%s+([^$]*):([^$]+)")
should be return the ip of user ,
but i dont know why , from strongdc client dont work
and de userIP it something like this 10.48.11.245:2000 F?T?0?9?TTH
I dont understand why dont separate the userIP from rest of the data based on letter " : "


any suggestions

TTB

Hi, hm.. I don't know. I have tested the script quickly, but I got also another prob with it. I only converted the script, but when I have time, I will try to fix it. If someone else also can do, that would be nice
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

dragos_sto

#10
a little solve , but not solve the problem when dont saparate the ip user from search data , just dont send the msg when when this hapen
new code :
--Correct-IP-V.1 for Active users 
--if some one know or have a better ideea post here : [URL]http://board.univ-angers.fr/thread.php?threadid=4496&boardid=26&styleid=1&sid=fc58de8e2f68a10615b153e66fe3f220[/URL]
BotName = frmHub:GetHubBotName().."_IpCheck"

function SearchArrival(curUser, data) 
	if data ~= nil then
		local s,e,userIP,r = string.find(data, "$Search%s+([^$]*):(.*))")
		if string.lower(userIP) ~= "hub" then
			if r ~= nil then 
				if userIP ~= curUser.sIP then 
					curUser:SendData(BotName,userIP.."\r\nmsg : "..curUser.sIP) 
					-- curUser:Disconnect()
				end
			end 
		end
	end
end

dragos_sto

i make some modification but the error whit strong dc ++ client not solve

--Correct-IP-V.1 for Active users 
--if some one know or have a better ideea post here : [URL]http://board.univ-angers.fr/thread.php?t...5b153e66fe3f220[/URL]
BotName = frmHub:GetHubBotName().."_IpCheck"

function SearchArrival(Usersearch, datasearch) 
	if datasearch ~= nil then
		local datalow = string.lower(datasearch)
		--string.find(data, "$Search%s+([^$]*):(.*))")
		local s,e,userIP,r = string.find(datalow, "$search%s+(%S+):(%S*)") 
		if userIP ~= "hub" and userIP ~= nil then
			if string.len(userIP) < 16 then
				if r ~= nil and r ~= 0 then 
					if userIP ~= Usersearch.sIP then 
						Usersearch:SendData(BotNameIp,userIP.."\r\nEste foarte probabil ca ipul de la setarile tale de activ sa nu fie corect.\r\n daca nu stii la ce ma refer verifica in \r\n FILE --> SETTING --> ACTIV  \r\n Verifica daca ipul scris acolo corespunde cu cel care til returneaza hubul : \r\n de catre hub esti vazut cu ipul : "..Usersearch.sIP) 
						-- curUser:Disconnect()
					end
				end 
			end
		end
	end
end

SMF spam blocked by CleanTalk