no slow connections script
 

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

no slow connections script

Started by LiqUiD~TrolL, 22 March, 2005, 23:07:12

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LiqUiD~TrolL

heyaaaa again and again  =o)

this is NO SLOW CONNECTIONS ALLOWED IN THE HUB

small script but really usefull for me,i used the converter to chnge it in lua 5 but it still doesn t works

check it out guys :


BotName = "-Inspector-"

function NewUserConnected(curUser)
    data=curUser.sMyInfoString
    s,e,cmd = string.find( data, "[$]+[^$]+[$]+[^$]+[$]+[^$]+[$]+([^$]+)" )

if (string.find(cmd,"28.8K")) then
curUser:SendPM(BotName,"___SorrY_BuT_Users_With_Slow_Connection_(28.8)_ArE_NoT_AlloweD_In_HerE___!! ")
curUser:Disconnect()
end
if (string.find(cmd,"33.6K")) then
curUser:SendPM(BotName,"___SorrY_BuT_Users_With_Slow_Connection_(33.6)_ArE_NoT_AlloweD_In_HerE___!! ")
curUser:Disconnect()
end
if (string.find(cmd,"56K")) then
curUser:SendPM(BotName,"___SorrY_BuT_Users_With_Slow_Connection_(56k)_ArE_NoT_AlloweD_In_HerE___!! ")
curUser:Disconnect()
end
end
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

Herodes

smth like this ?
function MyInfoArrival( user, data)
	local BotName = "NoDialUps"
	local tCons = {
		["28.8Kbps"] = { 0, "bye bye no dialups here..." },
		["33.6Kbps"] = { 0, "bye bye no dialups here..." },
		["56Kbps"] = { 0, "bye bye no dialups here..." },
		["ISDN"] = { 1, "no.dial-ups.org", "bye bye no dialups here..." },
	}
	for i,v in tCons do
		if i == user.sConnection then
			if v[1] == 0 then
				user:SendData( BotName, v[2] )
				user:Disconnect()
			elseif v[1] == 1 then
				user:Redirect(v[2], v[3])
			end
			break
		end
	end
end

bastya_elvtars

IMHO it would be a lot better by hashing. :)
if tCons[user.sConnection] then punish(user); end
Everything could have been anything else and it would have just as much meaning.

Herodes

QuoteOriginally posted by bastya_elvtars
IMHO it would be a lot better by hashing. :)
if tCons[user.sConnection] then punish(user); end
yeah .. too much php can do that to a scripter ..

bastya_elvtars

QuoteOriginally posted by Herodes
QuoteOriginally posted by bastya_elvtars
IMHO it would be a lot better by hashing. :)
if tCons[user.sConnection] then punish(user); end
yeah .. too much php can do that to a scripter ..

That's why when i did my first trial page in HTML, I froze LUA for that time. :D
Everything could have been anything else and it would have just as much meaning.

LiqUiD~TrolL

ok my friends i ve tried this script and i added in my settings 28,8 connction
and i tried to connect as a user and the log me in

note : i have DSL connection

but is this can be done?? the script seems it works in ptoka x no errors but why when i m connection with 54 connection in my settings it log me in the hub??
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

Herodes

QuoteOriginally posted by LiqUiD~TrolL
...but why when i m connection with 54 connection in my settings it log me in the hub??
I read this part 7 times and couldnt understand it. can you please explain ?

jiten


Dessamator

i think he meant 56kb connection setting, :D
Ignorance is Bliss.

LiqUiD~TrolL

sorry guys i wasn t so clear in what i wanted to say

well look,i have a script and when someone have in DC++ settings 58,isdn,28,and 34 KBS connection then the script doesn t allow him to log in the hub.

so how is this script works??
it s the same as mine?? if someone have in his DC++ settings these connections it doesn t allow him to log in the hub???
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

jiten

Well, the code is written in a way that either the user gets disconnected (0) or redirected (1), depending on the settings u chose here:

local tCons = {
		["28.8Kbps"] = { 0, "bye bye no dialups here..." },
		["33.6Kbps"] = { 0, "bye bye no dialups here..." },
		["56Kbps"] = { 0, "bye bye no dialups here..." },
		["ISDN"] = { 1, "no.dial-ups.org", "bye bye no dialups here..." },
	}


With the settings, I mean the value (0 or 1) behind the reason message.

Best regards,

jiten

LiqUiD~TrolL

;-) i already got that jiten , but look what i m doing
i m adding the script ok,and i m opening the hub .the script is working ok??
and after that i m going on my DC++ settings and change my connection in ["28.8Kbps"] or something else from these not allowed
and the hub log me in,why ??
shouldn t ordinary dissconnect me ?
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

jiten

Yups, it should  ;)

Herodes

#13
It should work.. any how I believe it was working before ...just made it more smooth to configure...
function MyInfoArrival( user, data)
	local BotName = "NoDialUps"
	local tCons = {
		-- ["con_type"] = { 0/1=off/on, "address.toredirect.to", "message to send" },
		["28.8Kbps"] = { 0, "no.dial-ups.org", "bye bye no dialups here..." },
		["33.6Kbps"] = { 0, "no.dial-ups.org", "bye bye no dialups here..." },
		["56Kbps"] = { 0, "no.dial-ups.org", "bye bye no dialups here..." },
		["ISDN"] = { 1, "no.dial-ups.org", "bye bye no dialups here..." },
	}
	for conn, tbl in tCons do
		if (string.sub( user.sConnection, 1, -1 ) == i) then
			if tbl[1] == 0 then
				user:SendData( BotName, tbl[3] )
				user:Disconnect()
			elseif tbl[1] == 1 then
				user:Redirect(tbl[2], tbl[3])
			end
			break;
		end
	end
end
[*edit*] small typo...

LiqUiD~TrolL

this script doesn t works too =/

i add it,in ptokaX it works
with no errors,but when someone connected to the hub with slow connection it log in him ordinary, =(

why is this ?? is it better maybe to convert this one in LUA 5 ???

code :
------------------------------------------------------------------------
otName = "-Inspector-"

function NewUserConnected(curUser)
data=curUser.sMyInfoString
s,e,cmd = string.find( data, "[$]+[^$]+[$]+[^$]+[$]+[^$]+[$]+([^$]+)" )

if (string.find(cmd,"28.8K")) then
curUser:SendPM(BotName,"___SorrY_BuT_Users_With_Slow_Connection_(28.8)_ArE_NoT_AlloweD_In_HerE___!! ")
curUser:Disconnect()
end
if (string.find(cmd,"33.6K")) then
curUser:SendPM(BotName,"___SorrY_BuT_Users_With_Slow_Connection_(33.6)_ArE_NoT_AlloweD_In_HerE___!! ")
curUser:Disconnect()
end
if (string.find(cmd,"56K")) then
curUser:SendPM(BotName,& quot;___SorrY_BuT_Users_With_Slow_Connection_(56k)_ArE_NoT_AlloweD_In_HerE_ __!! ")
curUser:Disconnect()
end
end
------------------------------------------------------------------------
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

jiten

It happened the same with me.

Herodes

I am pretty sure users are sending a MyINFO when they connect,... I am not sure if PtokaX passes that first MyINFO through lua ... If PPK is listening (or reading) this I wish he could clarify it ;)

Maybe this ?
function GetHim(user, con)
	local BotName = "NoDialUps"
	local tCons = {
		["28.8Kbps"] = { 0, "no.dial-ups.org", "bye bye no dialups here..." },
		["33.6Kbps"] = { 0, "no.dial-ups.org", "bye bye no dialups here..." },
		["56Kbps"] = { 0, "no.dial-ups.org", "bye bye no dialups here..." },
		["ISDN"] = { 1, "no.dial-ups.org", "bye bye no dialups here..." },
	}
	for conn, tbl in tCons do
		if string.find( con, conn ) then
			if tbl[1] == 0 then
				user:SendData( BotName, tbl[3] )
				user:Disconnect()
			elseif tbl[1] == 1 then
				user:Redirect(tbl[2], tbl[3])
				user:Disconnect()
			end
			break;
		end
	end
end

function MyInfoArrival( user, data)
	if user.sConnection then GetHim(user, user.sConnection) end
end

function UserConnected(user)
	if user.sConnection then GetHim(user, user.sConnection) end
end

jiten

I'm curious about that one too, because the code seems OK, and it should work.
Let's hear PPK  :D

LiqUiD~TrolL

nop not working either m8

=/  shit, why i can t understand?

can you test it on a ptoka x to see ???

in my test it did nt disconnect me
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

Pothead

I'm just expecting all the people this disconnects / redirects to change the DC++ setting to sommit else and try again.  So you will end up with loads of false connections. If you want to deny slow connections, you are best of with an IP blocker. :)

LiqUiD~TrolL

m8 i alreday know this, and i try it , plz read all the dialogue next time  ;-)
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

SMF spam blocked by CleanTalk