PtokaX forum

Archive => Archived 5.0 boards => Finished Scripts => Topic started by: plop on 28 February, 2005, 17:39:52

Title: anti-[OP]
Post by: plop on 28 February, 2005, 17:39:52
function NewUserConnected(curUser)
if string.sub(curUser.sName, 1, 4) == "[0P]" then
curUser:Disconnect()
return 1
end
end

plop
Title:
Post by: blackwings on 01 March, 2005, 18:15:13
plop, how about this = --Requested by blackwings
--Made by nErBoS
--converted to LUA 5 by blackwings
sBot = "Hub-Security"

arrBadNick = {
"[OP]","(op)","[operator]","(operator)","[admin]","(admin)","[su]","(su)","[master]",
"(master)","[moderator]","(moderator)","[adm]","(adm)","[administrator]","(administrator)",
"[fc]","(fc)","%","$","^","*"

} -- Put on this table all the prefix and nick you want to block

function MyINFOArrival(user)
for i=1, table.getn(arrBadNick) do
if (string.len(user.sName) >= string.len(arrBadNick[i])) then
if (string.sub(string.lower(user.sName),1,string.len(arrBadNick[i])) == string.lower(arrBadNick[i])) then
user:Disconnect()
end
end
end
end
Title:
Post by: plop on 02 March, 2005, 00:34:09
this is a bit faster and efficient.
--Requested by blackwings
--Made by nErBoS
--converted to LUA 5 by blackwings
--optimized a bit by plop

sBot = "Hub-Security"

arrBadNick = {
"[OP]","(op)","[operator]","(operator)","[admin]","(admin)","[su]","(su)","[master]",
"(master)","[moderator]","(moderator)","[adm]","(adm)","[administrator]","(administrator)",
"[fc]","(fc)","%","$","^","*"

} -- Put on this table all the prefix and nick you want to block

function MyINFOArrival(user)
   local sUser = string.lower(user.sName)
   if not user.bRegistered then
for i=1, table.getn(arrBadNick) do
  if (string.find(sUser, arrBadNick[i])) then
     user:Disconnect()
break
  end
end
   end
end

plop
Title:
Post by: bastya_elvtars on 02 March, 2005, 00:41:34
Why not detect using $ValidateNick?
Title:
Post by: PPK on 02 March, 2005, 00:55:23
QuoteOriginally posted by bastya_elvtars
Why not detect using $ValidateNick?
QuickList (http://dcplusplus.sourceforge.net/wiki/index.php/QuickList)  not use $ValidateNick command  ;)
Title:
Post by: bastya_elvtars on 02 March, 2005, 01:00:22
baaaaaaaaa half-sleeping better stop forum browsing.
Title:
Post by: blacksun on 24 October, 2005, 08:51:56
hi, could someone optimise the small script that plop posted so that it only checks normal users (not regs,vips,ops etc etc).

if there's such a script, give me a hint/link .

with respect,
F.C.
Title:
Post by: Markitos on 24 October, 2005, 10:02:18
QuoteOriginally posted by blacksun
hi, could someone optimise the small script that plop posted so that it only checks normal users (not regs,vips,ops etc etc).

if there's such a script, give me a hint/link .

with respect,
F.C.
Dnt know is this is correct
function NewUserConnected(curUser)

if string.sub(curUser.sName, 1, 4) == "[0P]" and not curUser.bRegistered then

curUser:Disconnect()

return 1

end

end

It's wrong isnt it  ?(

---/Edit/--
Now it works!
[10:07] *** A ligar a localhost...
[10:07] *** Ligado
[10:07] This hub is running PtokaX DC Hub 0.3.3.21 [debug] (UpTime: 0 days, 0 hours, 0 minutes)
[10:07] *** Desligado