PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: NightLitch on 11 March, 2004, 21:53:06

Title: Client Shield By: NightLitch
Post by: NightLitch on 11 March, 2004, 21:53:06
Client Shield
Version: 1.1
By: NightLitch
Date: 2004-03-11

Allow/Deny Client's:

DC++, oDC, DC:PRO, DCGUI, DCTC
NeoModus 2, iDC, zDC++, MS++
DC++k CDM, Phantom DC++
Bear Claw DC++, CZDC++, Ruri_Ruri
NoTag/Unknown, Fake


 

Download!   (http://swenorth.myftp.org/network/nightlitch/scripts/clientshield.1.1.rar)
Title: hmm
Post by: kbeh273300 on 11 March, 2004, 23:11:01
looks great il give it a try :)
Title: Nice!!
Post by: WickeD on 11 March, 2004, 23:32:09
Is this the one that are in NXS-3 NL?


//WickeD
Title:
Post by: NightLitch on 11 March, 2004, 23:52:40
QuoteOriginally posted by WickeD
Is this the one that are in NXS-3 NL?


//WickeD

Nope, but I will implent it to NXS-3 l8r.
Title:
Post by: (=CyberPimp=) on 12 March, 2004, 05:29:48
Great script NightLitch, just what I was looking for. Now I can ban DC++ and all the DC++ emulators. One question tough.. does it allow or denie clients that are not listed?
I got one error: Syntax Error: bad argument #1 to `strfind' (string expected, got nil)
I translated the masseges to icelandic.. maybe thats the error.. I don?t know.
-------------------------------------------------
-- Client Shield --
-------------------------------------------------
sBot = "Client-Shield"
-------------------------------------------------
-- Don't Edit
sVersion = "1.1"
sCreator = "NightLitch"
sDate = "2004-03-11"
-------------------------------------------------
-- Set Clients 1=on / 0=off
AllowClients = {
["DC++"]=0,
["oDC"]=1,
["DC:PRO"]=0,
["DCGUI"]=1,
["DCTC"]=0,
["NeoModus 2"]=1,
["iDC"]=1,
["zDC++"]=0,
["MS++"]=0,
["DC++k CDM"]=0,
["Phantom DC++"]=0,
["Bear Claw DC++"]=0,
["CZDC++"]=0,
["Bear Claw DC++"]=0,
["Ruri_Ruri"]=0,
["NoTag/Unknown"]=0,
["Fake"]=0,
}
-- Set Profile MinSlots
MinSlots = {
[2] = 2,   -- VIP
[3] = 2,   -- REG
[-1]= 4,   -- User
}
-- Set Profile MaxSlots
MaxSlots = {
[2] = 15,   -- VIP
[3] = 5,   -- REG
[-1]= 5,   -- User
}
-- Set Profile SlotRatio
SlotRatio = {
[2] = 2,   -- VIP
[3] = 2,   -- REG
[-1]= 2,   -- User
}
-- Set Profile MaxHubs
MaxHubs = {
[2] = 2,   -- VIP
[3] = 2,   -- REG
[-1]= 2,   -- User
}
-- Set Profile Netlimiter
NetLimiter = {
[2] = 0,   -- VIP
[3] = 0,   -- REG
[-1]= 0,   -- User
}
-----------------------------------------------------------
-- Don't edit bellow this point
sClients = {
{ "{ "<++","DC++" },
{ "{ "{ "{ "http://dc.ketelhot.de","DCGUI" },
{ "{ "{ "zDC++","zDC++" },
{ "","MS++" },
{ "{ "<.P>","Phantom DC++" },
{ "}
function NewUserConnected(sUser)
   local Client,Speed,Share,Tag = sParseMyInfo(sUser.sMyInfoString)
   sUser:SendData("Running "..sBot.." Version: "..sVersion.." By: "..sCreator.." ( "..sDate.." ) ")
   sUser:SendData(" ")
   sUser:SendData("Welcome "..sUser.sName.." you are using "..Client.." version: "..Tag["V"])
end
function sParseMyInfo(sMyInfo)
   local sClient = "NoTag/Unknown"
   for i = 1,getn(sClients) do if strfind(sMyInfo,sClients[1]) then sClient = sClients[2] end end
   local sBwidh = "Unlimited"
   local _,_,sSpeed,sShare = strfind(sMyInfo,"^%$MyINFO %$ALL [^ ]+ [^$]*%$ $([^$]+)[^$]%$[^$]*%$%s*(%d+)%$")
   sShare = tonumber(sShare)
   local _,_,sVer,sMode = strfind(sMyInfo,"V:(.*),M:([SAP])")
   local _,_,sHub = strfind(sMyInfo,"H:(%d+)")
   local _,_,sSlot = strfind(sMyInfo,"S:(%d+)")
   local _,_,sBwidh = strfind(sMyInfo, "[LBF]:%d*%/?(%d+)")
   if strfind(sMyInfo,"<%+%+") then _,_,sVer = strfind(MyInfo,"") sClient = "oDC"
   elseif strfind(sMyInfo,"Ruri_Ruri") then sClient = "Ruri_Ruri"
   elseif sClient=="iDC" then _,_,sVer = strfind(sMyInfo,"") end
   if strfind(sMyInfo,"H:\"%d+/%d+/%d+\"") then sClient = "Fake" end
   if strfind(sMyInfo, "L:") then sClient = "CZDC++"
   elseif strfind(sMyInfo, "B:") then if not sClient=="Phantom DC++" then sClient = "Bear Claw DC++"  end end
   sTag = {["S"]=sSlot,["B"]=sBwidh,["H"]=sHub,["V"]=sVer,["M"]=sMode}
   return sClient,sSpeed,sShare,sTag
end
function DataArrival(sUser, data)
   if (strsub(data,1,7) == "$MyINFO") and not sUser.bOperator then
      local Client,Speed,Share,Tag = sParseMyInfo(data)
      if AllowClients[Client]~=1 then
         sUser:SendData(sBot,"   "..Client.." er banna? ? hubbnum, nota?u oDC, iDC++, NMDC, DCgui e?a DCGui-QT !")
         sUser:Disconnect()
      else
         if ( Tag["S"]==nil or Tag["H"]==nil ) then
            sUser:SendData(sBot,"?? ert a? fela Tag-i?, banna?!")
            sUser:Disconnect()
         elseif ( tonumber(Tag["S"]) < MinSlots[sUser.iProfile] ) then
            sUser:SendData(sBot,"?? ert me? of f? slot opin, l?marki? er "..MinSlots[sUser.iProfile].." slot(s) open.")
            sUser:Disconnect()
         elseif ( tonumber(Tag["S"]) > MaxSlots[sUser.iProfile] ) then
            sUser:SendData(sBot,"?? ert me? of m?rg slot opin, h?marki? er "..MaxSlots[sUser.iProfile].." slot(s) open.")
            sUser:Disconnect()
         elseif ( SlotRatio[sUser.iProfile] and tonumber(Tag["S"]) < tonumber(Tag["H"])*SlotRatio[sUser.iProfile] ) then
            sUser:SendData(sBot,"?? ert me? of f? slot opin, l?marki? er "..SlotRatio[sUser.iProfile].." slot ? hvern Hub.")
            sUser:Disconnect()
         elseif ( tonumber(Tag["H"]) > MaxHubs[sUser.iProfile] ) then
            sUser:SendData(sBot,"?? ert ? of m?rgum hubbum, h?marki? er "..MaxHubs[sUser.iProfile].." hubbar.")
            sUser:Disconnect()
         elseif not Tag["B"]=="Unlimited" and ( tonumber(Tag["B"]) < NetLimiter[sUser.iProfile] ) then
            sUser:SendData(sBot,"You have limit your bandwidh to "..Tag["B"].." kB/s, minimum is "..NetLimiter[sUser.iProfile].." kB/s.")
            sUser:Disconnect()
         end
      end
   end
end

Thats my script... can you find the error.
oh and i?m useing Robocop aswell if you think that could be a prob.
Title:
Post by: MX-10 on 12 March, 2004, 16:17:53
Hi,
You must remeber that if you change the text that os not in " " you will ruin the script,exept that you now what u are doing

MX-10
Iceland
Title:
Post by: NightLitch on 12 March, 2004, 17:48:42
Script updated above. Error fixed.

/NL
Title:
Post by: (=CyberPimp=) on 12 March, 2004, 20:25:01
Yep tanx.....but you did not answer the "..does it allow or denie clients that are not listed? ". And are you going to put more clients on that list.

MX-10........j? ?g veit ?a? :o)
hver ert ?? ? Valh?ll, kannast ekki vi? ?etta nick. Virkar lua ? Verlihubba? er ?a? ekki eina sem ?i? eru? me?, e?a ertu kannski bara user ? Valh?ll.
Title:
Post by: NightLitch on 12 March, 2004, 20:52:05
Am gonna update it more, when I get the time.

It is a real fine bot now. But more will come.

/NL
Title:
Post by: (=CyberPimp=) on 12 March, 2004, 21:03:00
hehehe again you did not answer this: "..does it allow or denie clients that are not listed? ".

Yep it?s really good script :o)
Title:
Post by: [NL]trucker on 13 March, 2004, 09:04:18
(=CyberPimp=)

Quotehehehe again you did not answer this: "..does it allow or denie clients that are not listed? ".

something that you dont block will automatticly be allowed .
And since there arent any other clients listed in the script they dont get blocked
That is why NL said
QuoteAm gonna update it more, when I get the time.

It is a real fine bot now. But more will come.

that he would update this script.
Title:
Post by: NightLitch on 13 March, 2004, 14:03:43
I have a few more client to work my way through so I can make it more complete, but the thing is that almost every client can emulate DC++ so.

But I will see what I can come up with.

/NL
Title:
Post by: (=CyberPimp=) on 14 March, 2004, 06:27:57
Quotebut the thing is that almost every client can emulate DC++ so.
..... that is wuy I block DC++ now, works great  :D  I only allow oDC, iDC, NMDC, DCgui and DCGui-QT cos thay are not emulated by other clients. I don?t see any reason to allow DC++ when you have oDC and iDC, thay are better clients anyways. It?s the only way to get rid of those emulated clients.

Sorry that I did not undersatand... well NL Tucker came with the sf answer that I were looking for... :baby:
Title:
Post by: [NL]Pur on 14 March, 2004, 11:37:55
if you have blocked dc++, do you think you have users left ??
Title:
Post by: (=CyberPimp=) on 14 March, 2004, 15:45:00
yes I have all my users I have been blockin DC++ for a week now and no problems, this is a privet hub and the users just have to change the client... and that isn?t difficult.  :D
Title:
Post by: [NL]trucker on 28 March, 2004, 12:26:15
Nightlitch

are ya still working on a update??
Title:
Post by: NightLitch on 28 March, 2004, 12:31:36
QuoteOriginally posted by [NL]trucker
Nightlitch

are ya still working on a update??

Yes I Am, trying to get some more clients in and trying to specify some things that make one or more clients unique.

But plz feel free and come with suggestions... plz...

/NL
Title:
Post by: [NL]trucker on 28 March, 2004, 13:21:59
nl

if you go to [NL]Pur his site you find a lot of diffrent clients

http://dcjungle.sytes.net/
Title:
Post by: VAZ on 26 June, 2004, 07:38:35
this is a great script!
it would be nice if it could detect netlimiter in all of those
clients so it would be possible to block all of them if they
have netlimiter installed.

if the user is using odc and has netlimiter installed on the computer then the script would block him.

but maybe that is to much work  :rolleyes:
Title:
Post by: #jdslkfjals# on 02 October, 2004, 20:58:45
it would be very nice if it would be avaible to config this script to only check ops. because i dont like when my ops are using oDC and DC++
Title:
Post by: n1ck on 05 December, 2004, 16:23:53
..... that is wuy I block DC++ now, works great :D I only allow oDC, iDC, NMDC, DCgui and DCGui-QT cos thay are not emulated by other clients. I don?t see any reason to allow DC++ when you have oDC and iDC, thay are better clients anyways. It?s the only way to get rid of those emulated clients


*coughs* RMDC can emulate oDC
Title:
Post by: Typhoon on 12 December, 2004, 00:38:05
All clients can be emulated , so banning DC++ , don't help much. people just find other clients to emulate ..


Typhoon?