PtokaX forum

Archive => Archived 5.0 boards => Finished Scripts => Topic started by: dragos_sto on 17 May, 2005, 03:01:33

Title: little ip check
Post by: dragos_sto on 17 May, 2005, 03:01:33
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

Title: Error
Post by: CaSaNoVa on 18 May, 2005, 01:51:06
Syntax ...\0.3.3.0.b17.07.nt.dbg\scripts\tt.lua:8: attempt to call global `strlower' (a nil value)
Title:
Post by: TTB on 18 May, 2005, 17:12:43
change: if strlower(userIP) ~= "hub" then into: if string.lower(userIP) ~= "hub" then
Title:
Post by: CaSaNoVa on 19 May, 2005, 01:28:08
Command to do?
Title:
Post by: TTB on 19 May, 2005, 01:52:11
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
Title: Uh
Post by: CaSaNoVa on 19 May, 2005, 02:09:23
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.
Title:
Post by: TTB on 19 May, 2005, 03:28:27
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.
Title:
Post by: dragos_sto on 19 May, 2005, 11:25:48
10x ttb for correction of my script
i see have errors but i forget to correct'it
Title:
Post by: dragos_sto on 27 May, 2005, 08:20:33
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
Title:
Post by: TTB on 27 May, 2005, 11:56:55
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
Title:
Post by: dragos_sto on 01 June, 2005, 16:33:32
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
Title:
Post by: dragos_sto on 23 June, 2005, 13:06:40
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