Author Topic: ->-> The Ultimate Client Checker <-<-  (Read 5238 times)

0 Members and 1 Guest are viewing this topic.

Offline NightLitch

  • Emperor
  • **
  • Posts: 1 455
  • Karma: +16/-0
->-> The Ultimate Client Checker <-<-
« on: 23 August, 2004, 21:24:50 »
Here only the client check part from THoR 2.0 ThunderRage, think this is the first best client checker released ( Official ) source code... Enjoy!

Code: [Select]
-------------------------------------------------------------------------------
-- 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++"},
{"{"{"{"{"{"{"{"{"{"{"<.P>",AllowPHMDC, VerPHMDC, "Phantom DC++"},
{"{"DC@fe++",AllowDCAFE,VerDCAFE, "DC@fe++"},
{"{"{"}
OtherClients = {
["Bear Claw DC++"]={AllowBCDC,VerBCDC},
["CZDC++"]={AllowCZDC,VerCZDC},
}
SPEED = {
["28.8Kbps"] = Allow_28,
["33.6Kbps"] = Allow_33,
["56Kbps"] = Allow_56,
["ISDN"] = Allow_ISDN,
["DSL"] = Allow_DSL,
["Cable"] = Allow_Cable,
["LAN(T1)"] = Allow_LANT1,
["LAN(T3)"] = Allow_LANT3,
["Satellite"] = Allow_Sat,
}

function DataArrival(sUser,sData)
if (strsub(sData,1,7) == "$MyINFO") then
Tag,Speed,Share = ParseMyInfo(sData)
ClientCheck(Tag["C"],Tag["V"],sUser)
end
end

function ProfileCheck(sUser)
return Profiles[sUser.iProfile]
end

function ParseMyInfo(MyINFO)
hubs = 0
local s,e,Descr,Tag,Speed,Share = strfind(MyINFO, "^%$MyINFO %$ALL [^ ]+ ([^$]*)(%b<>)%$ $([^$]*)[^$]%$[^$]*%$%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
« Last Edit: 24 August, 2004, 23:34:18 by NightLitch »
//NL

PtokaX forum

->-> The Ultimate Client Checker <-<-
« on: 23 August, 2004, 21:24:50 »

Offline BottledHate

  • Triple Ace
  • **
  • Posts: 244
  • Karma: +2/-0
(No subject)
« Reply #1 on: 23 August, 2004, 21:59:11 »
oooooooo that looks nice :) i'll be able to use this for sure!
Homepage: www.bottledhate.webhop.org

Compiling  Lua scripts is LAME!!!!!

Offline witch

  • Lord
  • ***
  • Posts: 269
  • Karma: +1/-0
(No subject)
« Reply #2 on: 23 August, 2004, 22:12:19 »
Thanx NightLitch...grate script!
Just one think i woundering about.....is it resenble to use it if i use RC?

thanx  :))



Offline Peura

  • Junior Member
  • **
  • Posts: 19
  • Karma: +0/-1
ok
« Reply #3 on: 24 August, 2004, 07:32:53 »
This it is.... THX

Offline witch

  • Lord
  • ***
  • Posts: 269
  • Karma: +1/-0
(No subject)
« Reply #4 on: 24 August, 2004, 12:24:00 »
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  :))



Offline NightLitch

  • Emperor
  • **
  • Posts: 1 455
  • Karma: +16/-0
(No subject)
« Reply #5 on: 24 August, 2004, 14:30:28 »
Error should be fixed...

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

Cheers / NightLitch
//NL

Offline ((UKSN))shad_dow

  • Triple Ace
  • **
  • Posts: 213
  • Karma: +2/-0
(No subject)
« Reply #6 on: 24 August, 2004, 19:16:14 »
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
« Last Edit: 24 August, 2004, 19:20:27 by ((UKSN))shad_dow »
creator of Therapy-X? bot

Offline NightLitch

  • Emperor
  • **
  • Posts: 1 455
  • Karma: +16/-0
(No subject)
« Reply #7 on: 24 August, 2004, 23:35:03 »
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

Offline Peura

  • Junior Member
  • **
  • Posts: 19
  • Karma: +0/-1
great script
« Reply #8 on: 24 August, 2004, 23:55:03 »
this is great script... THX

Herodes

  • Guest
(No subject)
« Reply #9 on: 25 August, 2004, 00:27:53 »
Could you also add zDC++ to that list ;)

Offline ((UKSN))shad_dow

  • Triple Ace
  • **
  • Posts: 213
  • Karma: +2/-0
(No subject)
« Reply #10 on: 25 August, 2004, 03:13:23 »
cheers NL

yours

shad
creator of Therapy-X? bot

Offline witch

  • Lord
  • ***
  • Posts: 269
  • Karma: +1/-0
(No subject)
« Reply #11 on: 25 August, 2004, 06:27:21 »
Thanx NL grate script  :))



Offline [PT]CableGuy

  • Forum Ace
  • *****
  • Posts: 98
  • Karma: +1/-0
(No subject)
« Reply #12 on: 25 August, 2004, 12:44:29 »
Quote
Originally posted by Herodes
Could you also add zDC++ to that list ;)

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

Offline Typhoon

  • Lord
  • ***
  • Posts: 397
  • Karma: +22/-3
  • PGE Developer
    • PGE Homepage
(No subject)
« Reply #13 on: 25 August, 2004, 13:34:14 »
Quote
Originally posted by [PT]CableGuy
Quote
Originally posted by Herodes
Could you also add zDC++ to that list ;)

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

Code: [Select]

-- ptDC++
AllowPTDC = 1
VerPTDC = 2.0

{"


this should do it just fine..

Code: [Select]
? 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?



Offline NightLitch

  • Emperor
  • **
  • Posts: 1 455
  • Karma: +16/-0
(No subject)
« Reply #14 on: 25 August, 2004, 23:47:39 »
Quote
Originally 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

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
(No subject)
« Reply #15 on: 18 October, 2004, 16:49:38 »
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

  • Guest
(No subject)
« Reply #16 on: 18 October, 2004, 17:56:28 »
Nightlitch :   Would this helpat all  ?

Offline Madman

  • Scripter
  • Emperor
  • ******
  • Posts: 1 316
  • Karma: +75/-1
(No subject)
« Reply #17 on: 18 October, 2004, 18:20:27 »
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...

Code: [Select]
-------------------------------------------------
-- 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

Offline Electrical_flame

  • Junior Member
  • **
  • Posts: 19
  • Karma: +0/-0
Urgent!!! Thor!!!
« Reply #18 on: 11 August, 2005, 12:37:42 »
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! :)

PtokaX forum

Urgent!!! Thor!!!
« Reply #18 on: 11 August, 2005, 12:37:42 »