PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: angelsanges on 26 January, 2004, 09:09:11

Title: nick lenght check
Post by: angelsanges on 26 January, 2004, 09:09:11
it is possible a script that on the connection fase checks the Nickname lenght and if it is longer than 10 characters the user is disconnected with a message?
Title:
Post by: VERMiN on 26 January, 2004, 09:13:42
Sure!


function NewUserConnected(curUser)

  if(strlen(curUser.sName) > 10) then

    SendToNick(curUser.sName,"Your nickname contain more than 10 characters.")
    curUser:Disconnect()

    end

end
Title:
Post by: angelsanges on 26 January, 2004, 09:16:14
thank you!

it is true that longer nicks thakes more bandwith?

this script cecks also the Ops & Masters?
Title:
Post by: [NL]Pur on 26 January, 2004, 10:25:39
above script doesn't apply for Operators and Masters.
Title:
Post by: plop on 26 January, 2004, 12:04:22
QuoteOriginally posted by angelsanges
thank you!

it is true that longer nicks thakes more bandwith?

this script cecks also the Ops & Masters?
something big always uses more then something small.
but compaired 2 the rest of the infostring 10 is nothing.
i wouldn't worry about it 2 much, blocking anything above 15-20 looks oke 2 me.
the auto search from dc++ takes a whole lot more bandwidth.
i'm gone add the same check 2 a.i. as i've seen nicks in my logs with around 256 characters, some weirdo's around.

plop
Title:
Post by: angelsanges on 26 January, 2004, 13:28:04
and it is possible to modify the bot to do checks only only on normal users?
Title:
Post by: pHaTTy on 26 January, 2004, 13:31:42
QuoteOriginally posted by angelsanges
and it is possible to modify the bot to do checks only only on normal users?

that only applies for normal users ;)

hmm

note for me: good idea for a settings for G6, a varable of max length name, maybe a min length 2, nice one ;)
Title:
Post by: plop on 26 January, 2004, 13:41:50
QuoteOriginally posted by angelsanges
and it is possible to modify the bot to do checks only only on normal users?
here you are, only unreged users are checked.
function NewUserConnected(curUser)
   if(strlen(curUser.sName) > 10) and curUser.iProfile == -1 then
      SendToNick(curUser.sName,"Your nickname contain more than 10 characters.")
      curUser:Disconnect()
   end
end


plop
Title:
Post by: angelsanges on 26 January, 2004, 14:16:02
ooops excuse me :D
Title:
Post by: angelsanges on 22 February, 2004, 21:28:10
function NewUserConnected(curUser)
   if(strlen(curUser.sName) > 10) and curUser.iProfile == -1 then
      SendToNick(curUser.sName,"Your nickname contain more than 10 characters.")
      curUser:Disconnect()
   end
end



it is possible to insert also a mini lenght check?
Title:
Post by: kepp on 22 February, 2004, 22:22:09
function NewUserConnected(curUser)
   if(strlen(curUser.sName) > 10) and curUser.iProfile == -1 then
      SendToNick(curUser.sName,"Your nickname contain more than 10 characters.")
      curUser:Disconnect()
   elseif (strlen(curUser.sName) < 4) and curUser.iProfile == -1 then
      SendToNick(curUser.sName,"Your nickname contain less than 4 characters.")
      curUser:Disconnect()
   end
end