Hi guys!
I use this script for stoping modem users come on the hub, working fine!
------------------------------------------------------------------------------------------------------------------------------------------------
BotName = "KillModem"
function NewUserConnected(curUser)
data=curUser.sMyInfoString
s,e,cmd = strfind( data, "[$]+[^$]+[$]+[^$]+[$]+[^$]+[$]+([^$]+)" )
if (strfind(cmd,"28.8K")) then
curUser:SendPM(BotName,"no28.8 modem allowed in here ...")
curUser:Disconnect()
end
if (strfind(cmd,"33.6K")) then
curUser:SendPM(BotName,"no 33.6k modem allowed in here ...")
curUser:Disconnect()
end
if (strfind(cmd,"56K")) then
curUser:SendPM(BotName,"no 56k modem allowed in here ...")
curUser:Disconnect()
end
if (strfind(cmd,"ISDN")) then
curUser:SendPM(BotName,"no ISDN allowed in here ...")
curUser:Disconnect()
end
end
------------------------------------------------------------------------------------------------------------------------------------------------
But as soon is user inside the hub he can change it to modem on general settings of them client with out any problem, and still stays on the hub. So any sugestions how can i stop it?
Thanx
try this 1.
optimized it a bit also.
BotName = "KillModem"
function NewUserConnected(curUser)
data=curUser.sMyInfoString
s,e,cmd = strfind( data, "[$]+[^$]+[$]+[^$]+[$]+[^$]+[$]+([^$]+)" )
if (strfind(cmd,"28.8K")) then
curUser:SendPM(BotName,"no28.8 modem allowed in here ...")
curUser:Disconnect()
elseif (strfind(cmd,"33.6K")) then
curUser:SendPM(BotName,"no 33.6k modem allowed in here ...")
curUser:Disconnect()
elseif (strfind(cmd,"56K")) then
curUser:SendPM(BotName,"no 56k modem allowed in here ...")
curUser:Disconnect()
elseif (strfind(cmd,"ISDN")) then
curUser:SendPM(BotName,"no ISDN allowed in here ...")
curUser:Disconnect()
end
end
function DataArrival(curUser, data)
if curUser.bOperator == nil then
NewUserConnected(curUser)
end
end
plop
Thanx dude! Now it's working much better, all my cheaters was kicked off :))
oooooooooopssss......i was too quick with answer:
Syntax error: bad argument #1 to `strfind' (string expected, got nil)
stack traceback:
1: function `strfind' [C]
2: function `NewUserConnected' at line 9 [file `D:\PtokaX\NEW\scripts\modem.lua']
3: function `DataArrival' at line 47 [file `D:\PtokaX\NEW\scripts\modem.lua']
QuoteOriginally posted by plop
try this 1.
optimized it a bit also.
BotName = "KillModem"
function NewUserConnected(curUser)
data=curUser.sMyInfoString
s,e,cmd = strfind( data, "[$]+[^$]+[$]+[^$]+[$]+[^$]+[$]+([^$]+)" )
if (strfind(cmd,"28.8K")) then
curUser:SendPM(BotName,"no28.8 modem allowed in here ...")
curUser:Disconnect()
elseif (strfind(cmd,"33.6K")) then
curUser:SendPM(BotName,"no 33.6k modem allowed in here ...")
curUser:Disconnect()
elseif (strfind(cmd,"56K")) then
curUser:SendPM(BotName,"no 56k modem allowed in here ...")
curUser:Disconnect()
elseif (strfind(cmd,"ISDN")) then
curUser:SendPM(BotName,"no ISDN allowed in here ...")
curUser:Disconnect()
end
end
function DataArrival(curUser, data)
if curUser.bOperator == nil then
NewUserConnected(curUser)
end
end
plop
Hello Mr Plop :]
can you change all disconnect to: read rd adress from the hub insted??
Best Regards
this should be fixed now witch, but as you might see i optimized it a bit more.
this could cause a new bug but i'm not expecting them.
beer if you change the 1 behind disconnect to a nil it should start 2 redirect.
but only on old clients as this feature has been removed on the latest dc++ versions.
-- no modem
-- original by ....... (no idea)
-- optimized and redirect option added by plop
BotName = "KillModem"
-- use any vallue to use the disconnect, and "nil" to make it redirect.
disconnect = 1
tBadCon = {
["ISDN"] = 1,
["56Kbps"] = 1,
["33.6Kbps"] = 1,
["28.8Kbps"] = 1
}
function NewUserConnected(curUser)
if curUser.sMyInfoString then
local s,e,cmd = strfind(curUser.sMyInfoString, "[$]+[^$]+[$]+[^$]+[$]+[^$]+[$]+([^$]+)" )
if cmd then
cmd = strsub(cmd, 1,-2)
if tBadCon[cmd] then
curUser:SendPM(BotName,"no "..cmd.." modem allowed in here ...")
if disconnect then
curUser:Disconnect()
else
curUser:SendData(" You are being redirected ... |$ForceMove "..frmHub:GetRedirectAddress().."|")
end
end
end
end
end
function DataArrival(curUser, data)
if curUser.bOperator == nil then
NewUserConnected(curUser)
end
end
plop
Much better now! Thanx Plop dude :P
Something tells me I dont like this script ... lol
..don't look at it ....lol :D :D :D
I am gonna cry !!!! stupid greek communication networks are not giving a damn about getting us junkies up-to-speed ... :((((((((((((((
witch: not only I saw it ... I collect as well :D
good work plop ..
well i just wonder what is your problem with modemusers anyway ? ..
like anybody out there is happy to be a modem user ?
and would not upgrade their connection if they where able to .. ..
just slot/hub ratio checking is much nicer ... in my opinion anyway ..
Just sucks when your queue consist of modem users which take up valueble d/l slot's ;-)