PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Peura on 23 August, 2004, 08:38:51

Title: Client check
Post by: Peura on 23 August, 2004, 08:38:51
I need script witch will check user tag and kick if it is not ok. I only want user use client dc++ 0.306-0.401 and oDC 5.212-5.312

Those are only client what is ok... all others are bad client.

Tag:

<++ V: 0.25.... is for oDC 5.212
<++ V: 0.306... is for oDC 5.312
<++ V:0.306 - 0.401... is for dc++ 0.306-0.401

all others are bad client

I try to search but i did not found nothing

I dont want use dmdc++ because its disconnect user witch are ok and i dont want to run two client @ same time. DMDC is banned in many hubs i use...
Title:
Post by: nErBoS on 23 August, 2004, 14:10:09
Hi,

There is a script that does that, try to search in Finished Scripts.

Best regards, nErBoS
Title:
Post by: ARCHANGEL on 23 August, 2004, 18:02:06
Is this what you are looking for?

Client Shield bt NIghtLitch.

http://board.univ-angers.fr/thread.php?threadid=1562&boardid=12
Title: hmm
Post by: Peura on 23 August, 2004, 20:46:24
i have test that allready and i does not work like I want to. I need script witch allow only client with this tag:

<++ V: 0.25.... is for oDC 5.212
<++ V: 0.306... is for oDC 5.312
<++ V:0.306 - 0.401... is for dc++ 0.306-0.401

and that one allow all dc++ and oDC(?).
Title:
Post by: NightLitch on 23 August, 2004, 20:54:23
I tell u what, just because Am bored I do the script for ya...
Title:
Post by: Peura on 23 August, 2004, 21:15:04
QuoteOriginally posted by NightLitch
I tell u what, just because Am bored I do the script for ya...

 :D
Title:
Post by: BottledHate on 23 August, 2004, 21:48:12
so i hacked up the one that was linked here in a few minutes.... Client Shield by NightLitch... it does what u want i think. cept for one thing.. when i tried to test with the:
<++ V: 0.306... is for oDC 5.312

i got:
Private message from PtokaX: Unknown user agent! Bye!

which is pto itself.. so i dunno how it will handle the ones with spaces in front of the (V:)  :
<++ V: 0.25.... is for oDC 5.212
<++ V: 0.306... is for oDC 5.312
........

Seems to work well with everything else.

--//Client Shield by NightLitch
--//Hacked to hell by BH as a request from Peura
-------------------------------------------------
sBot = "Client-Shield"
-------------------------------------------------
AllowClients = {
["DC++"]=1,
["oDC"]=1,
}
sClients = {
{ "{ "<++","DC++" },
}
function sParseMyInfo(sMyInfo)
local sClient = "NoTag/Unknown"
for i = 1,getn(sClients) do if strfind(sMyInfo,sClients[i][1]) then sClient = sClients[i][2] end end
local _,_,sVer,sMode = strfind(sMyInfo,"V:(.*),M:([SAP])")
return sClient,tonumber(sVer)
end
function DataArrival(sUser, data)
if (strsub(data,1,7) == "$MyINFO") and not sUser.bOperator then
local Client,Version = sParseMyInfo(data)
if AllowClients[Client]~=1 then
sUser:SendData(sBot,"Your Client is not allowed here!")
sUser:Disconnect()
else
if Client == "DC++" then --//DC++ and oDC that looks like DC++.
            if Version <= 0.305 then
               if Version == 0.25 then return end ---///for the funky odc version that looks like dc++.
               sUser:SendData(sBot,"Your DC++ is too Old.. Upgrade.")
               sUser:Disconnect()
            elseif Version >= 0.402 then
               sUser:SendData(sBot,"Your DC++ is too ?new?.. ??Down-grade??")--//lol???(requested)
               sUser:Disconnect()            
            end
else
            if Version <= 5 then --//oDC that look like oDC
               sUser:SendData(sBot,"Your oDC is too Old.. Upgrade.")
               sUser:Disconnect()
            elseif Version >= 5.32 then
               sUser:SendData(sBot,"Your oDC is too ?new?.. ??Down-grade??")
               sUser:Disconnect()
            end
         end
end
end
end

oh yeah.. only works on users.. leaves ops alone.

-BH
Title:
Post by: BottledHate on 23 August, 2004, 22:00:47
a new one from NightLitch... be sure to check it out... i
think it does what u want perfectly.....
THREAD (http://board.univ-angers.fr/thread.php?threadid=2627&boardid=12&styleid=1&sid=5cad0f592e09c7aca3db2610661a7fe3&)


-BH
Title:
Post by: Typhoon on 23 August, 2004, 23:04:57
i got:
Private message from PtokaX: Unknown user agent! Bye!


answer : Go into Rules and Bots
to the right set it to accept users without dc tag ..
the betas are made before the new oDC tag was official.
that should solve it. :)

*** Typhoon?
Title:
Post by: BottledHate on 24 August, 2004, 00:39:40
ty..