->-> The Ultimate Client Checker <-<-
 

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

->-> The Ultimate Client Checker <-<-

Started by NightLitch, 23 August, 2004, 21:24:50

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NightLitch

Here only the client check part from THoR 2.0 ThunderRage, think this is the first best client checker released ( Official ) source code... Enjoy!

-------------------------------------------------------------------------------
-- The Ultimated Client-Checker Around I think that will be Official
-------------------------------------------------------------------------------
-- Ripped from THoR 2.0 ThunderRage
-------------------------------------------------------------------------------
-- Only Client Check Part, If u want Slots, Hubs, Bandwidth etc.
-- U need to do it yourself for now...
-------------------------------------------------------------------------------
-- By: NightLitch
-------------------------------------------------------------------------------
BotName = "-Client-Check-"
-------------------------------------------------------------------------------
KB = 1024
MB = KB*KB
GB = KB*KB*KB
TB = KB*KB*KB*KB
-------------------------------------------------------------------------------
--// User Settings
-------------------------------------------------------------------------------
USER_CHECK_CLIENT = 1
-------------------------------------------------------------------------------
--// Registered User Settings
-------------------------------------------------------------------------------
REG_CHECK_CLIENT = 1
-------------------------------------------------------------------------------
--// VIP User Settings
-------------------------------------------------------------------------------
VIP_CHECK_CLIENT = 1
-------------------------------------------------------------------------------
--// Operator Settings
-------------------------------------------------------------------------------
OPR_CHECK_CLIENT = 1
-------------------------------------------------------------------------------
--// Administrator Settings
-------------------------------------------------------------------------------
ADM_CHECK_CLIENT = 1
-------------------------------------------------
-- Connection Speed Check --
-------------------------------------------------
Allow_28 = 0
Allow_33 = 0
Allow_56 = 0
Allow_ISDN = 0
Allow_DSL = 1
Allow_Cable = 1
Allow_LANT1 = 1
Allow_LANT3 = 1
Allow_Sat = 0
-------------------------------------------------
-- Allow Client --
-------------------------------------------------
-- DC++
AllowDCPP = 1
VerDCPP = "0.301"
-- ODC
AllowODC = 1
VerODC = "5.0"
-- DC:PRO
AllowDCPRO = 1
VerDCPRO = "0.2.2.10"
-- DCGUI
AllowDCGUI = 1
VerDCGUI = "0.2.20"
--DCTC
AllowDCTC = 1
VerDCTC = "0"
-- NMDC2
AllowNMDC2 = 1
VerNMDC2 = "2.02"
-- Strong DC++
AllowSDC = 1
VERSDC = "1.00"
-- iDC++
AllowIDC = 1
VerIDC = "1.03"
-- MS++
AllowMSPP = 1
VerMSPP = "0"
-- DCDM++
AllowDCDM = 1
VerDCDM = "2.8"
-- Phantom DC++
AllowPHMDC = 1
VerPHMDC = "0.301"
--BCDC++
AllowBCDC = 1
VerBCDC = "0.305"
-- CZDC++
AllowCZDC = 1
VerCZDC = "0.303"
-- RMDC++
AllowRMDC = 1
VerRMDC = "0.305"
-- DC@fe++
AllowDCAFE = 1
VerDCAFE = "0.400"
-- DC++ DCDM
AllowDCDCDM = 1
VerDCDCDM = "0.030"
-- zY++
AllowZYPP = 1
VerZYPP = "1.00"
-- xR++
AllowXRPP = 1
VerXRPP = "0.10"
-------------------------------------------------
-- Profile Setup --
-------------------------------------------------
Profiles = {
	[-1] = 1, -- regular user
	[3] = 2, -- registered user
	[2] = 3,  -- vip user
	[1] = 4, -- operator
	[0] = 5, -- master/admin
	}
-- Setting up the profile checkings numbers is the number from the SET table, then just add your profile Slot, Hub... here
Checks = {
	[1] = {[1] = USER_CHECK_CLIENT},
	[2] = {[1] = REG_CHECK_CLIENT},
	[3] = {[1] = VIP_CHECK_CLIENT},
	[4] = {[1] = OPR_CHECK_CLIENT},
	[5] = {[1] = ADM_CHECK_CLIENT},
}

-------------------------------------------------
-------------------------------------------------
-- SCRIPT STARTS HERE --
-------------------------------------------------
-------------------------------------------------
UNIT = {[KB] = "Kb",[MB] = "Mb",[GB] = "Gb",[TB] = "Tb"}
Client = {
{"<++",AllowDCPP,VerDCPP, "DC++"},
{"",AllowPHMDC, VerPHMDC, "Phantom DC++"},
{")%$ $([^$]*)[^$]%$[^$]*%$%s*(%d*)%$")
	Tag = Tag or ""
	Descr = Descr or ""
	if Speed==nil or Share==nil then _,_,Speed,Share = strfind(MyINFO, "%$ $([^$]*)[^$]%$[^$]*%$%s*(%d*)%$") end
	local _,_,xTag = strfind(Descr, "(%b<>)")
	xTag = xTag or ""
	Descr = gsub(Descr, xTag, "")
	local Tag = xTag..Tag
	local _,_,xC,xV,C,V,M,H,S,B = strfind(Tag, "<*(%A*%a*)%s*([%.%d]*)>*<(%S*)%s*V:([%.%d]*)%s*%S*,M:([5SAP]),H:([%d%/]*),S:([%d%*]*),*[BLUF]*:*([%.%d*]*)%S*>$")
	if S=="" or M =="" or H==nil or V =="" or C=="" then C = "Tag Error" V = "0" M = "P" H = 0 S = 0 end
	if tonumber(H) == nil then gsub(H, "(%d+)", function (num) hubs = hubs +tonumber(num) end) else 	hubs = tonumber(H)	end
	local ClientCheck, ClientMinVer = 0,"0"
	sClt,sChk,sMiV = cTag(C)
	if sClt == nil then C = "Fake Client" else C = sClt ClientCheck = sChk 	ClientMinVer = sMiV end
	if xC~="" then
		dClt,dChk,dMiV = cTag(xC)
		if dClt~=nil and C ~= "Fake Client" then
			C = dClt
			if xV~="" then 	V = xV end 
			ClientCheck = dChk 
			ClientMinVer = dMiV 
		else 
			C = "Invalid Double Tag" 
			ClientCheck = 0
			ClientMinVer = 0 
		end
	end
	if strfind(Tag, "V:%a+") then C = "Fake Clients / NoTag Clients" V = "0" ClientCheck, ClientMinVer = 0,"0" end
	if C=="DCGUI" and tonumber(B) then B = B * S end
	if strfind(Tag, "L:") then 
		if C~="Strong DC++" then 	C = "CZDC++" ClientCheck = OtherClients[C][1] ClientMinVer = OtherClients[C][2] end
	elseif strfind(Tag, "B:") then
		if C ~= "rmDC++" and C~="Phantom DC++" then C = "Bear Claw DC++" ClientCheck = OtherClients[C][1] ClientMinVer = OtherClients[C][2] end
	end
	if B =="" then B = "Unlimited" end
	MODE = {["5"] = "Socket5", ["A"] = "Active", ["P"] = "Passive",["S"] = "Socket"}
	_TAG = {["C"] = {C,ClientCheck,ClientMinVer},["V"] = V, ["M"] = tostring(MODE[M]), ["H"] = hubs, ["S"] = S, ["B"] = B,["T"] = Tag,["D"] = Descr}
	return _TAG,Speed,Share
end

function cTag(tag)
	local clt,chk,minv = nil,nil,nil,nil
	for i=1,getn(Client) do
		Client[i][1] = gsub(Client[i][1], "<" , "")
		if tag == Client[i][1] then
			chk = Client[i][2]
			minv = Client[i][3]
			clt = Client[i][4]
		end
	end
	return clt,chk,minv
end

function ClientCheck(sClient,sVersion,sUser)
	if Checks[Profiles[sUser.iProfile]][1]==1 then
		if sClient[2] == 1 then
			if sVersion < sClient[3] then
				SendPmToNick(sUser.sName,BotName, "You are using "..sClient[1].." version ( "..sVersion.." )")
				SendPmToNick(sUser.sName,BotName, "The oldest "..sClient[1].." version allowed is ( "..sClient[3].." ), you may download the latest "..sClient[1].." at [URL]http://www.dslreports.com/faq/6513[/URL]")
				sUser:Disconnect()
				return 0
			end
			return 1
		else
			SendPmToNick(sUser.sName,BotName, sClient[1].." is not allowed here!!")
			sUser:Disconnect()
			return 0
		end
	end

	return 1
end

If your gonna use this for your own coding make sure to set my name of this source...!

Best Regards / NightLitch
//NL

BottledHate

oooooooo that looks nice :) i'll be able to use this for sure!
Homepage: www.bottledhate.webhop.org

Compiling  Lua scripts is LAME!!!!!

witch

Thanx NightLitch...grate script!
Just one think i woundering about.....is it resenble to use it if i use RC?

thanx  :))



Peura

This it is.... THX

witch

Syntax error: attempt to index global `Check' (a nil value)
stack traceback:
   1:  function `ClientCheck' at line 467 [file `D:\PtokaX\NEW\scripts\ClientCheck.lua']
   2:  function `DataArrival' at line 339 [file `D:\PtokaX\NEW\scripts\ClientCheck.lua']

thanx in advince  :))



NightLitch

Error should be fixed...

And DO remember if u add more profiles to add them in the script to....

Cheers / NightLitch
//NL

((UKSN))shad_dow

#6
Syntax error: attempt to index a nil value
stack traceback:
   1:  function `ClientCheck' at line 233 [file `...\Ptokax0.330.b15.25.dbg\scripts\clientcheck.lua']
   2:  function `DataArrival' at line 169 [file `...\Ptokax0.330.b15.25.dbg\scripts\clientcheck.lua']

sorry NL , now getting this error from the code Above , have not added any more Profiles , just tryed it stright

yours

shad
creator of Therapy-X? bot

NightLitch

Just noticed the bug and it is fixed... I really hope it works now... It is thought a fast Rip so... hehe

But try it now...

/NL
//NL

Peura

this is great script... THX

Herodes

Could you also add zDC++ to that list ;)

((UKSN))shad_dow

cheers NL

yours

shad
creator of Therapy-X? bot

witch

Thanx NL grate script  :))



[PT]CableGuy

QuoteOriginally posted by Herodes
Could you also add zDC++ to that list ;)

Could you also add PTDC v2 ? ....PLEEEEASE ?

Typhoon

QuoteOriginally posted by [PT]CableGuy
QuoteOriginally posted by Herodes
Could you also add zDC++ to that list ;)

Could you also add PTDC v2 ? ....PLEEEEASE ?

-- ptDC++
AllowPTDC = 1
VerPTDC = 2.0

{"


this should do it just fine..

? Your Status at this hub is : Guest
	 ? Your IP is : 127.0.0.1
	 ? You are using : ptDC.  Version : 2.0
	 ? You are in : Active mode
	 ? You are in : 1 hub(s)
	 ? You have : 1 slot(s) open
	 ? You have bandwidth limiter set to : Unlimited kB/s
	 ? Your connection speed is : DSL
	 ? You share : 15.75 GigaByte
	 ? Your current Tag is : <++ V:0.305,M:A,H:1/0/0,S:1>

enjoy ..

*** Typhoon?



NightLitch

QuoteOriginally posted by Herodes
Could you also add zDC++ to that list ;)

Well first off all the double tag doesn't have inside <>, the second, I jsut tried the client, and I did NOT like it, damn that client did like 10 attempts to outcoming to several IP's I don't know and almost the same amount of incoming that I did NOT like...

so until that client gets then Am not gonna add it...

sorry Herodes...

/NL
//NL

Madman

i'm getting the error

Syntax error: table index is nil
stack traceback:
   1:  function `ClientCheck' at line 233 [file `...rogram\Ptokax\scripts\Ultimate Client Check.lua']
   2:  function `DataArrival' at line 169 [file `...rogram\Ptokax\scripts\Ultimate Client Check.lua']


i havent changed anything.....
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Herodes

Nightlitch :   Would this helpat all  ?

Madman

lol! i found my error....

It was the fact i DIDNT change anything...
I use RoboCop so when my Netfounder logged in, he made the error...

Here are the code for those who run RC
Mod/netfounder has the same settings as Masters...

-------------------------------------------------
-- Profile Setup --
-------------------------------------------------
Profiles = {
	[-1] = 1, -- regular user
	[3] = 2, -- registered user
	[2] = 3,  -- vip user
	[1] = 4, -- operator
	[0] = 5, -- master/admin
	[4] = 6,   -- Moderator
	[5] = 7,   -- NetFounder

	}
-- Setting up the profile checkings numbers is the number from the SET table, then just add your profile Slot, Hub... here
Checks = {
	[1] = {[1] = USER_CHECK_CLIENT},
	[2] = {[1] = REG_CHECK_CLIENT},
	[3] = {[1] = VIP_CHECK_CLIENT},
	[4] = {[1] = OPR_CHECK_CLIENT},
	[5] = {[1] = ADM_CHECK_CLIENT},
	[6] = {[1] = ADM_CHECK_CLIENT},
	[7] = {[1] = ADM_CHECK_CLIENT},
}

-------------------------------------------------
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Electrical_flame

Thor it's a trully great script but I have an old version! Nightlich please tell me where I can find the latest version of Thor that works with lua4!!! Help needed!!! ?(
I will never join the dark side! :)

SMF spam blocked by CleanTalk