PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: NightLitch on 26 December, 2004, 23:39:54

Title: * ] * ] Gemini - ClientChecker [ * [ *
Post by: NightLitch on 26 December, 2004, 23:39:54
A little something from me to you all after Christmas.

A new created ClientChecker.

GeminiClientChecker.rar (http://swenorth.myftp.org/network/nightlitch/archive/GeminiClientChecker.rar)

Happy New Year // NightLitch

*Edited*

Check futher down for information.
Title:
Post by: n1ck on 27 December, 2004, 01:43:25
Another great bot cheers, Although i do feel you are being rather cruel teasing us with the pictures of THor4  :D
Title:
Post by: Madman on 27 December, 2004, 02:28:51
It says
[02:21:16] Your client have a bad Tag or is not Allowed here...
When i login, i'm using StrongDC++
And I havent changed anything
My tag looks like this
Title:
Post by: Flux on 27 December, 2004, 03:04:12
NightLitch this is a nice little script, is there any chance to have the "Your Client Information" sent to the users PM instead of main chat, or have a switch so that us members in this forum can have the choice to have in main chat or in a PM...

But this is a nice little script.. Thanx
Title:
Post by: blackwings on 27 December, 2004, 03:13:03
QuoteOriginally posted by Flux
NightLitch this is a nice little script, is there any chance to have the "Your Client Information" sent to the users PM instead of main chat, or have a switch so that us members in this forum can have the choice to have in main chat or in a PM...

But this is a nice little script.. Thanx
at line 156, change this line = sUser:SendData(BotName, line)To this = sUser:SendPM(BotName, line) That should make so the user gets it in PM instead of in main.
Title:
Post by: NightLitch on 27 December, 2004, 04:42:33
The StrongDC++ I have not tested... I guess it is the version check that is screwing up... going to fix it later...

//NightLitch
Title:
Post by: Flux on 27 December, 2004, 05:10:00
thanx blackwings I lerned something there even tho i made a mistake as ur advise did not work due to my sleepless night of heavy eyelids hehehe i got it to work as i deleted a space after sendPM bit hehehe
Title:
Post by: NightLitch on 27 December, 2004, 16:25:51
Script is updated:

-------------------------------------------------------------------
* StrongDC++ works
* Added Send MAIN / PM for Client Info
-------------------------------------------------------------------


GeminiClientChecker.rar (http://swenorth.myftp.org/network/nightlitch/archive/GeminiClientChecker.rar)

//NightLitch
Title:
Post by: NightLitch on 27 December, 2004, 18:04:38
Script is updated:

-------------------------------------------------------------------
* Fixed StrongDC++ RC(v) - version
* Fixed parsing of the Tag Check
-------------------------------------------------------------------

GeminiClientChecker.rar (http://swenorth.myftp.org/network/nightlitch/archive/GeminiClientChecker.rar)

//NightLitch
Title:
Post by: NightLitch on 27 December, 2004, 21:07:02
Script have taken a BIG turn.

Version: 0.5 build 12 for TD4
------------------------------------------------------------------------------
* Added Profile Loader
* Added Following check table for each Profile:
Profiles[Idx] = {
["ProfileName"] = ProfileName,
["Share"] = {["Min"] = {["Share"] = 0, ["Unit"] = "GB"},["Max"] = {["Share"] = 0,["Unit"] = "GB"}},
["MinSlots"] = 3,
["MaxSlots"] = 30,
["MaxHubs"] = 5,
["SlotPerHub"] = 1,
["Bandwidth"] = 30,
["Mode"] = { ["Active"] = 1,["Passive"] = 1,["Socket5"] = 1},
["Connection"] = {["28.8Kbps"] = 0,["33.6Kbps"] = 0,["56Kbps"] = 0,["ISDN"] = 1,["Satelite"] = 1,["Cable"] = 1,["DSL"] = 1,["LAN(T1)"] = 1,["LAN(T3)"] = 1},
["Block_Blimiter"] = 1,
["Check_Client"] = 1,
}
* File created for settings ( GeminiProfiles.lst )
* Setting values to 0 will set checks DISABLED.
------------------------------------------------------------------------------
Download: GeminiClientChecker.rar (http://swenorth.myftp.org/network/nightlitch/archive/GeminiClientChecker.rar)
------------------------------------------------

// NightLitch
Title:
Post by: QuikThinker on 27 December, 2004, 21:41:15
Is there any difference between this and the client checker in Robocop?
Title:
Post by: NightLitch on 27 December, 2004, 22:53:29
I don't know, I don't use RC. I don't now what Optimus is using...

/NL
Title:
Post by: [_XStaTiC_] on 27 December, 2004, 23:00:44
NightLitch... This scripts looks realy nice, Thanks for it

Keep it up.
Title:
Post by: plop on 28 December, 2004, 01:12:04
<--- taps NightLitch gently on the shoulder and says "great job, looks awsome.".

plop
Title:
Post by: NightLitch on 28 December, 2004, 12:35:04
QuoteOriginally posted by plop
<--- taps NightLitch gently on the shoulder and says "great job, looks awsome.".

plop

Thx mate, I now it can be a little overdone but I like it, it gave me some more knowledge about gsub and pattern matching.

Cheers and Happy New Year // NightLitch
Title:
Post by: Optimus on 28 December, 2004, 13:18:05
Looks great but however it's possible the pattern  match it completly whitout any loops. It even can be done in a shorter way.

But everybody has it's own style. lol i didn't say this lol hehe
Title:
Post by: NightLitch on 28 December, 2004, 14:35:07
QuoteOriginally posted by Optimus
Looks great but however it's possible the pattern  match it completly whitout any loops. It even can be done in a shorter way.

But everybody has it's own style. lol i didn't say this lol hehe

Well in that case I will make it even shorter.

I love critic....  :D
Title:
Post by: NightLitch on 28 December, 2004, 17:55:08
Update:

---------------------------------------------------------------------
* Max.Share bug fixed thx to Typhoon for notice it
* Dir: Gemini created with the ClientTags/DescrTags in
---------------------------------------------------------------------
Upcoming:
--------------
*Makin it all even smaller...
---------------------------------------------------------------------

//NL
Title:
Post by: [_XStaTiC_] on 30 December, 2004, 11:30:02
hi NightLitch..

i have this error sometimes.. :(

Syntax error: attempt to compare nil with string
stack traceback:
   1:  function `DataArrival' at line 69 [file `D:\PtokaX\scripts\GeminiClientChecker.lua']
Title:
Post by: NightLitch on 30 December, 2004, 13:09:44
Ok, going to check it up then. Thx for reporting.

//NL
Title:
Post by: NightLitch on 30 December, 2004, 13:52:41
Script is updated:

-------------------------------------------------------------------
* Fixed possible error found by [_XStaTiC_]
* Added error msg sent to ops when tag is corrupt on Slots or Hubs ( Copy Tag And Give It To Me )
* Fixed loading of Profile file
-------------------------------------------------------------------

GeminiClientChecker.rar (http://swenorth.myftp.org/network/nightlitch/archive/GeminiClientChecker.rar)

//NightLitch
Title:
Post by: [_XStaTiC_] on 31 December, 2004, 15:11:13
Thx NightLitch...

No Error's

only when i use DCDM :R  (download/upload ratio) then i get this message:


Your client have a bad Tag or is not Allowed here...

And i wish you and all other people on this forum happy new year!!!
Title:
Post by: Typhoon on 31 December, 2004, 23:30:45
QuoteOriginally posted by [_XStaTiC_]
Thx NightLitch...

No Error's

only when i use DCDM :R  (download/upload ratio) then i get this message:


Your client have a bad Tag or is not Allowed here...

And i wish you and all other people on this forum happy new year!!!


Probably because DCDM uses  a "  R:  "   instead of B: or L:  ...

could be the R: part but maybe we need NightLitch to check it out


Typhoon?
Title:
Post by: Typhoon on 31 December, 2004, 23:48:17
QuoteOriginally posted by [_XStaTiC_]
Thx NightLitch...

No Error's

only when i use DCDM :R  (download/upload ratio) then i get this message:


Your client have a bad Tag or is not Allowed here...

And i wish you and all other people on this forum happy new year!!!


okay here goes :o)

 exchange your given objects to the one i post that fixes the problem with DCDM and the R: .. i have testet with no errors and it lets the client pass the check ..


-- First this

calcTag = {
["V"] = ":([%.%d]*)",
["M"] = ":([AP5])",
["H"] = ":([%d%/]*)",
["S"] = ":(%**%d*)",
["B"] = ":(%d+)",
["L"] = ":(%d+)",
["R"] = ":(%d+)",
["F"] = ":%d+%/(%d+)",
["RC"] = "(%d+)",
}

-- Second this located in the Parse function

Tag["B"] = Tag["R"] or Tag["B"] or Tag["L"] or Tag["F"]  or "unlimited"

-- Third add this in your getClient table

["VMHSR"] = {
["ClientName"] = "DCDM++",
["MinVersion"] = "0.030",
["AllowClient"] = 1,
["Site"] = "http://www.ukdnb.dsl.pipex.com/dcppkcdm/index.html"
},


worked for me hope it does the same for you :o)

HAPPY NEW YEAR


Typhoon?

*EDIT* spelling errors due too much alcohol :o)
Title:
Post by: [_XStaTiC_] on 01 January, 2005, 02:59:07
Ok that works good.. but now i have this:

You have limit your bandwidh to 4 kB/s, minimum is 20 kB/s.

download/upload ratio set to 4


Thanks for your help Typhoon? and happy new year!!!
Title:
Post by: Typhoon on 01 January, 2005, 13:56:00
please post the bandwith check function..

seems to be a small problem in that maybe..


Typhoon?
Title:
Post by: [_XStaTiC_] on 01 January, 2005, 14:42:58
Gemini - ( Bandwidth Checker )          By: NightLitch

Check.Bandwidth = function(sUser,curLimit)
local bLimit, bBlock = Profiles[sUser.iProfile].Bandwidth, Profiles[sUser.iProfile].Block_Blimiter
if curLimit == "unlimited" then
return 1
elseif tonumber(curLimit) ~= 0 and tonumber(curLimit) < tonumber(bLimit) and tonumber(bLimit) ~= 0 and bBlock ~= 1  then
sUser:SendData(BotName,"You have limit your bandwidh to "..curLimit.." kB/s, minimum is "..bLimit.." kB/s.")
sUser:Disconnect()
elseif curLimit ~= 0 and bBlock ~= 0 then
sUser:SendData(BotName,"Bandwidth Limiters are not allowed here...")
sUser:Disconnect()
end
end

Hope you can fix this
Title:
Post by: [_XStaTiC_] on 01 January, 2005, 15:11:01
I have made i little change, but i don't know if it makes it slower.

if Tag["R"] then Tag["B"] = "ratio" else Tag["B"] = Tag["B"] or Tag["L"] or Tag["F"]  or "unlimited" end

This doesn't check anything, only connects the hub now and it shows my Bandwidth is set to ratio
Title: I wanna contribute...
Post by: bastya_elvtars on 01 January, 2005, 15:52:07
Posting my client checker table, i hope NL will make use of it.
(offtopic: NL will we play starcraft at last? ;p)

dcpp={
[" [" ["reverseconnect.sf.net"]={"ReverseConnect","V:(0.%d+)"},
["www.RevConnect.com"]={"ReverseConnect","V:(0.%d+)"},
[" [" [" ["MS++V"]={"MS++V","V:(0.%d+)"},
[" ["zDC++"]={"zDC++","V:(0.%d+)"},
[" ["<.P>"]={".PhantomDC++","V:(0.%d+)"},
[" [" ["v%["]={"neXtDC++","V:(0.%d+)"},
["[BL]:"]={"BCDC++","V:(0.%d+)"},
["%[%d+%s*sl%]"]={"BCDC++","V:(0.%d+)"},
["%[%d+[kM]%]"]={"BCDC++","V:(0.%d+)"},
["V:%[Sasser.+"]={"Sasser","Sasser%s+(0.%d+)" }
}
Title:
Post by: ?\'??Mm???\' on 02 January, 2005, 23:37:29
Syntax error: bad argument #1 to `strfind' (string expected, got nil)
stack traceback:
   1:  function `strfind' [C]
   2:  function `ParseMyINFO' at line 99 [file `E:\robocop\scripts\GeminiClientChecker.lua']
   3:  function `NewUserConnected' at line 41 [file `E:\robocop\scripts\GeminiClientChecker.lua']

help would be apriciated on this think this will be a good script if i can get it without the error  ;)
Title:
Post by: bastya_elvtars on 03 January, 2005, 00:21:52
I guess i have fixed it.

This is to be saved overwriting the old GeminiClientChecker.lua

--==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==-
--                   Gemini - ( Client Checker )          By: NightLitch
--==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==-
-- added hack against crash on no myinfo by bastya_elvtars
BotName = "Gemini"
cVersion = "0.7 build 3 for TD4"
Send_Client_Info_In = "PM" -- MAIN / PM
Send_Client_Info = 1 -- 1= on / 0 = off
--==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==-
dofile("Gemini/DescrTags.lst")
dofile("Gemini/TagClients.lst")
--==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==-
calcTag = {
["V"] = ":([%.%d]*)",
["M"] = ":([AP5])",
["H"] = ":([%d%/]*)",
["S"] = ":(%**%d*)",
["B"] = ":(%d+)",
["L"] = ":(%d+)",
["F"] = ":%d+%/(%d+)",
["RC"] = "(%d+)",
}
--==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==-
cMode = {["A"] = "Active",["P"] = "Passive", ["5"] = "Socket5"}
--==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==-
Send = {}
--==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==-
function Main()
local file = openfile("GeminiProfiles.lst", "r")
if file then
closefile(file)
dofile("GeminiProfiles.lst")
else
Save.Profiles()
end
end

function NewUserConnected(sUser)
sUser:SendData(BotName, "This hub is running Gemini ClientChecker "..cVersion)
Get.SendData(Send_Client_Info_In)
local Tag = ParseMyINFO(sUser.sMyInfoString)
if Tag["C"] and Send_Client_Info == 1 then
local line = "\r\n"
line = line .. "\r\n\t ------------------------------------------------------------"
line = line .. "\r\n\t Your Client Information"
line = line .. "\r\n\t ------------------------------------------------------------"
line = line .. "\r\n\t Client: "..Tag["C"]
line = line .. "\r\n\t Version: "..Tag["V"]
line = line .. "\r\n\t Share: "..Get.sUnits(Tag.Share)
line = line .. "\r\n\t Mode: "..Tag["M"]
line = line .. "\r\n\t Slots: "..Tag["S"].." slot(s)"
line = line .. "\r\n\t Hubs: "..Tag["H"].." hub(s)"
line = line .. "\r\n\t Bandwidth: "..Tag["B"].." kB/s"
line = line .. "\r\n\t Connection Speed: "..Tag.Speed
line = line .. "\r\n\t Tag: "..Tag["T"]
line = line .. "\r\n\t Descr: "..Tag["D"]
line = line .. "\r\n\t ------------------------------------------------------------\r\n"
Send.ToNick(sUser.sName, BotName, line)
end
end
--==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==-
OpConnected = NewUserConnected
--==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==-
function DataArrival(sUser,sData)
if strsub(sData, 1,7) == "$MyINFO" then
if user.sMyInfoString and strlen (user.sMyInfoString) > (strlen(user.sName)+13) then
local c = ParseMyINFO(sData)
if c["C"] then
if Profiles[sUser.iProfile].Check_Client == 0 then return 1 end
if c["Allow"] == 1 then
if c["S"] == nil or c["H"] == nil then
SendToOps(BotName, "User "..sUser.sName.." have bad tag for slots or hubs, Check User's Tag and send information to [EMAIL]nightlitch@swenorth.myftp.org[/EMAIL]")
SendToOps(BotName, "User is not kicked, do that manually after you taken the Tag")
return 1
end
Check.Share(sUser,c["Share"])
Check.Slots(sUser,c["S"],c["H"])
Check.Bandwidth(sUser,c["B"])
Check.Mode(sUser,c["M"])
Check.Connection(sUser,c["Speed"])
if c.V < c.MinVer then
sUser:SendData(BotName, "The oldest "..c.C.." version allowed is ( "..c.MinVer.." ), your client version is ( "..c.V.." ).")
sUser:SendData(BotName, "Download newest version of "..c.C.." at "..c.Site)
sUser:Disconnect()
end
else
sUser:SendData(BotName, "Client "..c.C.." is not allowed here...")
sUser:Disconnect()
end
else
sUser:SendData(BotName, "Your client have a bad Tag or is not Allowed here...")
sUser:Disconnect()
end
end
end
end
--==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==-
ParseMyINFO = function(MyINFO)
local Tag = nil
Tag = {}
if strfind(MyINFO, "<%P*%p*%s+V%p[%.%d]+%s*%S*%pM%p[AP5]%pH%p[%d%/]+%pS%p%**%d*%S*>") then
local _,_,sDescr,sClient,sTag,sSpeed,sShare = strfind(MyINFO, "%$ALL%s+%S+%s+(.*)(<%S*)%s*(.*>)%$ $([^$]*)[^$]%$[^$]*%$%-*%s*(%d*)%$%|$")
if getClient[sClient] then
local Idx,Str = Get._Id(sTag)
if getClient[sClient][Idx] then
Tag = Get.TagIdx(Str,sTag)
Tag["C"] = getClient[sClient][Idx].ClientName
Tag["D"] = sDescr
Tag["T"] = sClient.." "..sTag
Tag["Allow"] = getClient[sClient][Idx].AllowClient
Tag["MinVer"] = getClient[sClient][Idx].MinVersion
Tag["Site"] = getClient[sClient][Idx].Site
Tag["Speed"] = sSpeed
Tag["Share"] = sShare
Tag["M"] = cMode[Tag["M"]]
Tag["B"] = Tag["B"] or Tag["L"] or Tag["F"] or "unlimited"
Tag = Get.OtherClient(sClient,MyINFO,Tag)
if strfind(MyINFO, "\"") then Tag["C"] = "Fake Client" end
return Tag
else
return Tag
end
else
return Tag
end
else
return Tag
end
end
--==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==-
Check = {}
Check.Share = function(sUser,curShare)
local MinShare, MaxShare = Profiles[sUser.iProfile].Share.Min.Share * sUnit[Profiles[sUser.iProfile].Share.Min.Unit], Profiles[sUser.iProfile].Share.Max.Share * sUnit[Profiles[sUser.iProfile].Share.Max.Unit]
if tonumber(curShare) <  tonumber(MinShare) and tonumber(MinShare) ~= 0  then
sUser:SendData(BotName, "You have not met the requirements for minimum share "..Get.sUnits(tonumber(MinShare)))
sUser:Disconnect()
elseif tonumber(curShare) >  tonumber(MaxShare) and tonumber(MaxShare) ~= 0  then
sUser:SendData(BotName, "You have met the requirements for maximum share "..Get.sUnits(tonumber(MaxShare)))
sUser:Disconnect()
end
end
Check.Slots = function(sUser,curSlots,curHubs)
local MinSlots,MaxSlots,MaxHubs, SlotPerHub = Profiles[sUser.iProfile].MinSlots, Profiles[sUser.iProfile].MaxSlots,Profiles[sUser.iProfile].MaxHubs, Profiles[sUser.iProfile].SlotPerHub
if curSlots == "unlimited" then
sUser:SendData(BotName,"You share unlimited slots.")
sUser:Disconnect()
elseif tonumber(curSlots) < tonumber(MinSlots) and tonumber(MinSlots) ~= 0 then
sUser:SendData(BotName,"You have to few slots open, minimum is "..MinSlots.." slot(s) open.")
sUser:Disconnect()
elseif tonumber(curSlots) > tonumber(MaxSlots) and tonumber(MaxSlots) ~= 0 then
sUser:SendData(BotName,"You have to many slots open, maximum is "..MaxSlots.." slot(s) open.")
sUser:Disconnect()
elseif tonumber(curHubs) > tonumber(MaxHubs) and MaxHubs ~= 0 then
sUser:SendData(BotName,"You are in to many hubs, maximum is "..MaxHubs.." hub(s).")
sUser:Disconnect()
elseif tonumber(SlotPerHub) and tonumber(curSlots) < tonumber(curHubs)*tonumber(SlotPerHub) and SlotPerHub ~= 0 then
sUser:SendData(BotName,"You have to few slots open per hubs, minimum is "..SlotPerHub.." slot(s) per hub(s) open.")
sUser:Disconnect()
end
end
Check.Connection = function(sUser,curSpeed)
local Connection = Profiles[sUser.iProfile].Connection
if Connection[curSpeed] == nil then
sUser:SendData(BotName,"Your connection type ( "..curSpeed.." ) are not allowed here.")
sUser:Disconnect()
elseif Connection[curSpeed] == 0 then
sUser:SendData(BotName,"Your connection type ( "..curSpeed.." ) are not allowed here.")
sUser:Disconnect()
end
end
Check.Mode = function(sUser,curMode)
local Mode = Profiles[sUser.iProfile].Mode
if Mode[curMode] == 0 then
sUser:SendData(BotName,"Mode "..curMode.." are not allowed here.")
sUser:Disconnect()
end
end
Check.Bandwidth = function(sUser,curLimit)
local bLimit, bBlock = Profiles[sUser.iProfile].Bandwidth, Profiles[sUser.iProfile].Block_Blimiter
if curLimit == "unlimited" then
return 1
elseif tonumber(curLimit) ~= 0 and tonumber(curLimit) < tonumber(bLimit) and tonumber(bLimit) ~= 0 and bBlock ~= 1  then
sUser:SendData(BotName,"You have limit your bandwidh to "..curLimit.." kB/s, minimum is "..bLimit.." kB/s.")
sUser:Disconnect()
elseif curLimit ~= 0 and bBlock ~= 0 then
sUser:SendData(BotName,"Bandwidth Limiters are not allowed here...")
sUser:Disconnect()
end
end
--==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==-
Get = {}
Get.BadCap = {["A"] = 1,["P"] = 1,["O"] = 1,["D"] =1,["C"] = 1} --,["R"] = 0}
Get._Id = function(sTag)
tmp = {}
local Str = gsub(sTag, "(%u+)[%s*%.*%d*%p*%.*]*",function(char) if calcTag[char] then tmp["("..char..")"..calcTag[char]] = 1 end end)
local Id = gsub(sTag, "(%u)[%s*%.*%d*%p*%.*]*",function(char) if Get.BadCap[char] then return "" else  return char end end)
return Id,tmp
end
Get.TagIdx = function(Str,tag)
local Tmp = {}
local version = ""
for find,_ in Str do
local _,_,i,val = strfind(tag, find)
if i and val then
if i == "RC" then
version = val
else
if val == "*" then val = "unlimited" end
Tmp[i] = val
end
end
end
if version ~= "" then Tmp["V"] = Tmp["V"].." RC"..version end
hubs = 0
if tonumber(Tmp["H"]) == nil then gsub(Tmp["H"], "(%d+)", function (num) hubs = hubs +tonumber(num) end) else hubs = tonumber(Tmp["H"]) end
Tmp["H"] = hubs
return Tmp
end
Get.OtherClient = function(sClient,MyINFO,Tag)
for cTag, cTab in DescrTag do
if strfind(MyINFO, cTag) then
local _,_,version = strfind(MyINFO, DescrTag[cTag].VerStr)
Tag["V"] = version
Tag["C"] = DescrTag[cTag].ClientName
Tag["Allow"] = DescrTag[cTag].AllowClient
Tag["MinVer"] = DescrTag[cTag].MinVersion
Tag["Site"] = DescrTag[cTag].Site
end
end
return Tag
end
Get.sUnits = function(intSize)
if tonumber(intSize) ~= 0 then
local tUnits = { "Bytes", "KB", "MB", "GB", "TB" }
intSize = tonumber(intSize);
local sUnits;
for index = 1, getn(tUnits) do
if(intSize < 1024) then
sUnits = tUnits[index];
break;
else
intSize = intSize / 1024;
end
end
return format("%0.1f %s",intSize, sUnits);
else
return "nothing"
end
end
Get.SendData = function(mode)
if mode == "MAIN" then
Send.ToNick = function(this,from,text) SendToNick(this, "<"..from.."> "..text) end
elseif mode == "PM" then
Send.ToNick = function(this,from,text) SendPmToNick(this, from,text) end
end
end
Save = {}
Save.Serialize = function(tTable, sTableName, hFile, sTab)
assert(tTable, "tTable equals nil");
assert(sTableName, "sTableName equals nil");
assert(hFile, "hFile equals nil");
assert(type(tTable) == "table", "tTable must be a table!");
assert(type(sTableName) == "string", "sTableName must be a string!");
sTab = sTab or "";
write(hFile, sTab..sTableName.." = {\n" );
for key, value in tTable do
local sKey = (type(key) == "string") and format("[%q]",key) or format("[%d]",key);
if(type(value) == "table") then
Save.Serialize(value, sKey, hFile, sTab.."\t");
else
local sValue = (type(value) == "string") and format("%q",value) or tostring(value);
write(hFile, sTab.."\t"..sKey.." = "..sValue);
end
write(hFile, ",\n");
end
write(hFile, sTab.."}");
end
Save.File = function(table , tablename, file)
local hFile = openfile(file, "w");
Save.Serialize(table, tablename, hFile);
closefile(hFile);
end
Save.Profiles = function()
writeto("GeminiProfiles.lst") writeto()
Profiles = {}
Levels = {[-1] = "User"}
for _,ProfileName in GetProfiles() do Levels[GetProfileIdx(ProfileName)] = ProfileName end
for Idx,ProfileName in Levels do
Profiles[Idx] = {
["ProfileName"] = ProfileName,
["Share"] = {["Min"] = {["Share"] = 0, ["Unit"] = "GB"},["Max"] = {["Share"] = 0,["Unit"] = "GB"}},
["MinSlots"] = 3,
["MaxSlots"] = 30,
["MaxHubs"] = 5,
["SlotPerHub"] = 1,
["Bandwidth"] = 30,
["Mode"] = { ["Active"] = 1,["Passive"] = 1,["Socket5"] = 1},
["Connection"] = {["28.8Kbps"] = 0,["33.6Kbps"] = 0,["56Kbps"] = 0,["ISDN"] = 1,["Satelite"] = 1,["Cable"] = 1,["DSL"] = 1,["LAN(T1)"] = 1,["LAN(T3)"] = 1},
["Block_Blimiter"] = 1,
["Check_Client"] = 1,
}
end
Save.File(Profiles,"Profiles","GeminiProfiles.lst")
dofile("GeminiProfiles.lst")
end
--==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==-
sUnit = {}
sUnit["KB"]= 1024
sUnit["MB"]= 1048576
sUnit["GB"]= 1073741824
sUnit["TB"]= 1099511627776
--==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==#==-
--// NightLitch 2004-12-26
Title:
Post by: NightLitch on 04 January, 2005, 12:34:48
New version coming shortly... With some big changes and fixes.

//NL
Title:
Post by: NightLitch on 04 January, 2005, 15:24:10
Script is updated:

Version: 0.9 build 16 for TD4
-------------------------------------------------------------------
* Rewrote the MyINFO Parsing and Letter Capture
* Changed some things in the client tables
* Changed the tables in in script only Bandwidth Limiters is
    Letter Checked for right Cap.
-------------------------------------------------------------------

GeminiClientChecker.rar (http://swenorth.myftp.org/network/nightlitch/archive/GeminiClientChecker.rar)

//NightLitch
Title:
Post by: [_XStaTiC_] on 04 January, 2005, 21:01:35
Hi NightLitch
Syntax error: attempt to compare nil with number
stack traceback:
   1:  method `Slots' at line 102 [file `D:\PtokaX\scripts\GeminiClientChecker.lua']
   2:  function `DataArrival' at line 69 [file `D:\PtokaX\scripts\GeminiClientChecker.lua']

I'm getting this charracter > in the  connect message by slots.
Client: DCDM++
Version: 0.041
Share: nothing
Mode: Active
Slots: 4> slot(s)
Hubs: 7 hub(s)
Bandwidth: unlimited kB/s
Connection Speed: Cable
Tag: <++ V:0.401,M:A,H:0/1/6,S:4>
Descr: <++ V:0.401,M:A,H:0/1/6,S:4>
Title:
Post by: NightLitch on 05 January, 2005, 12:17:58
Thx for notice that going to fix it... that is a serious bug one can not live with... :D

update later today.

//NL
Title:
Post by: NightLitch on 05 January, 2005, 12:25:53
Script is updated:

Version: 0.9 build 18 for TD4
-------------------------------------------------------------------
* Fixed Slot Error found by [_XStaTiC_]
* Fixed Description
-------------------------------------------------------------------

GeminiClientChecker.rar (http://swenorth.myftp.org/network/nightlitch/archive/GeminiClientChecker.rar)

//NL
Title:
Post by: [_XStaTiC_] on 05 January, 2005, 19:45:06
Thx NightLitch...

it's running again whitout errors yet
Title:
Post by: NightLitch on 08 January, 2005, 13:20:55
So everything is fine with this script ?

Any requests ? fixes ? addition ??

//NL
Title:
Post by: [_XStaTiC_] on 09 January, 2005, 17:10:55
Hi NightLitch...

well the script is running fine, but somethimes i see this little error


Syntax error: attempt to compare nil with number
stack traceback:
   1:  method `Slots' at line 112 [file `D:\PtokaX\scripts\GeminiClientChecker.lua']
   2:  function `DataArrival' at line 96 [file `D:\PtokaX\scripts\GeminiClientChecker.lua']
Title:
Post by: bastya_elvtars on 09 January, 2005, 17:23:17
caused by fake tags. i had it in lawmaker too.
Title:
Post by: NightLitch on 09 January, 2005, 18:03:12
QuoteOriginally posted by [_XStaTiC_]
Hi NightLitch...

well the script is running fine, but somethimes i see this little error


Syntax error: attempt to compare nil with number
stack traceback:
   1:  method `Slots' at line 112 [file `D:\PtokaX\scripts\GeminiClientChecker.lua']
   2:  function `DataArrival' at line 96 [file `D:\PtokaX\scripts\GeminiClientChecker.lua']

Good going to look at it...

you didn't get a Message just for ops to send me a report and take the users Tag ????

Well I look into it.

//NL
Title:
Post by: NightLitch on 09 January, 2005, 18:21:24
Bug fixed, download script again from any link in this thread.
Title:
Post by: [_XStaTiC_] on 09 January, 2005, 20:43:49
Quoteyou didn't get a Message just for ops to send me a report and take the users Tag ????
No but..  i have seen that fake tag before.
I think it was like this one ->  S:*
 
Title:
Post by: NightLitch on 09 January, 2005, 21:02:19
QuoteOriginally posted by [_XStaTiC_]
Quoteyou didn't get a Message just for ops to send me a report and take the users Tag ????
No but..  i have seen that fake tag before.
I think it was like this one ->  S:*
 


That should be solved...
Title:
Post by: [_XStaTiC_] on 09 January, 2005, 21:13:17
ok thank u very much NightLitch
Title:
Post by: Typhoon on 10 January, 2005, 22:02:02
QuoteOriginally posted by [_XStaTiC_]
Quoteyou didn't get a Message just for ops to send me a report and take the users Tag ????
No but..  i have seen that fake tag before.
I think it was like this one ->  S:*
 


 just to make you wiser :o) , that tag is NOT fake ...
on dcgui client the user has the option to set UNLIMITED slots, and that shows up in tag like that S:*
conclusion , "*" = infinity/unlimited/more than enough
:p


Typhoon?