PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: blackwings on 25 July, 2004, 07:12:04

Title: Could someone make this script use DataArrival instead of...
Post by: blackwings on 25 July, 2004, 07:12:04
Could someone convert NewUserConnected() to DataArrival(), so it blocks a user immediatly without showing the MOTD?

--Requested by blackwings
--Made by nErBoS

sBot = "Hub-Security"

arrBadNick = {
"[OP]","(op)","[admin]","(admin)","[su]","(su)","[master]",
"(master)","[moderator]","(moderator)","[adm]","(adm)","[administrator]","(administrator)",
"[fc]","(fc)","[operator]","(operator)"
} -- Put on this table all the prefix and nick you want to block

function Main()
end

function NewUserConnected(user)
for i=1, getn(arrBadNick) do
if (strlen(user.sName) >= strlen(arrBadNick[i])) then
if (strsub(strlower(user.sName),1,strlen(arrBadNick[i])) == strlower(arrBadNick[i])) then
user:SendData(sBot, "You are using a illegal prefix or nick.")
user:SendData(sBot, "Don't use "..arrBadNick[i].." in your nick")
user:Disconnect()
end
end
end
end
Title:
Post by: nErBoS on 25 July, 2004, 15:04:41
Hi,

Try this one...

--Requested by blackwings
--Change NewUserConnected to DataArrival
--Catch Data (thanks plop)
--Made by nErBoS

sBot = "Hub-Security"

arrBadNick = {
"[OP]","(op)","[admin]","(admin)","[su]","(su)","[master]",
"(master)","[moderator]","(moderator)","[adm]","(adm)","[administrator]","(administrator)",
"[fc]","(fc)","[operator]","(operator)"
} -- Put on this table all the prefix and nick you want to block

function Main()
frmHub:EnableFullData(1)
end

function DataArrival(user, data)
if (strsub(data, 1, 14 + strlen(user.sName)) == "$ValidateNick "..user.sName and not user.bOperator) then
for i=1, getn(arrBadNick) do
if (strlen(user.sName) >= strlen(arrBadNick[i])) then
if (strsub(strlower(user.sName),1,strlen(arrBadNick[i])) == strlower(arrBadNick[i])) then
user:SendData(sBot, "You are using a illegal prefix or nick.")
user:SendData(sBot, "Don't use "..arrBadNick[i].." in your nick")
user:Disconnect()
end
end
end
end
end

Best regards, nErBoS
Title:
Post by: plop on 26 July, 2004, 12:23:40
you forgot 2 enable full data, without that the script will never get $ValidateNick.

plop
Title:
Post by: nErBoS on 26 July, 2004, 16:38:20
Hi,

Baaa, complety forgot about that, good that i have my plop-postfix  :D  Thanks plop  :))

Script has been edit.

Best regards, nErBoS
Title:
Post by: blackwings on 26 July, 2004, 17:27:25
ehm, it doesn't work Nerbos, even after you add the
"frmHub:EnableSearchData(1)"
Title:
Post by: Typhoon on 26 July, 2004, 18:20:58
try and change it with this one

frmHub:EnableFullData(1)
Title:
Post by: blackwings on 26 July, 2004, 21:01:44
QuoteOriginally posted by Typhoon?
try and change it with this one

frmHub:EnableFullData(1)

It doesn't work with that either
Title:
Post by: kepp on 26 July, 2004, 22:32:57
Try this..
--Requested by blackwings
--Change NewUserConnected to DataArrival
--Catch Data (thanks plop)
--Made by nErBoS

sBot = "Hub-Security"

arrBadNick = {
"[OP]","(op)","[admin]","(admin)","[su]","(su)","[master]",
"(master)","[moderator]","(moderator)","[adm]","(adm)","[administrator]","(administrator)",
"[fc]","(fc)","[operator]","(operator)"
} -- Put on this table all the prefix and nick you want to block

function Main()
   frmHub:EnableFullData(1)
end

function DataArrival(user, data)
if (strsub(data, 1, 8) == "$Version") and not user.bOperator then
for i=1, getn(arrBadNick) do
if (strlen(user.sName) >= strlen(arrBadNick[i])) then
if (strsub(strlower(user.sName),1,strlen(arrBadNick[i])) == strlower(arrBadNick[i])) then
user:SendData(sBot, "You are using a illegal prefix or nick.")
user:SendData(sBot, "Don't use "..arrBadNick[i].." in your nick")
user:Disconnect()
end
end
end
end
end
Title:
Post by: nErBoS on 26 July, 2004, 23:08:34
Hi,

If you permit me a little change :)

--Requested by blackwings
--Change NewUserConnected to DataArrival
--Catch Data (thanks plop)
--Fixed by Keep
--Made by nErBoS

sBot = "Hub-Security"

arrBadNick = {
"[OP]","(op)","[admin]","(admin)","[su]","(su)","[master]",
"(master)","[moderator]","(moderator)","[adm]","(adm)","[administrator]","(administrator)",
"[fc]","(fc)","[operator]","(operator)"
} -- Put on this table all the prefix and nick you want to block

function Main()
   frmHub:EnableFullData(1)
end

function DataArrival(user, data)
if (strsub(data, 1, 8) == "$Version") and not user.bOperator then
for i=1, getn(arrBadNick) do
if (strlen(user.sName) >= strlen(arrBadNick[i])) then
if (strsub(strlower(user.sName),1,strlen(arrBadNick[i])) == strlower(arrBadNick[i])) then
user:SendData(sBot, "You are using a illegal prefix or nick.")
user:SendData(sBot, "Don't use "..arrBadNick[i].." in your nick")
user:Disconnect()
end
end
end
end
end

Best regards, nErBoS
Title:
Post by: blackwings on 27 July, 2004, 05:33:09
I don't see any difference between kepp's and nerbos last post. Anyway, I tested the one from Nerbos last post and it works :D

EDIT:
Could someone also make so the line that says "logged in" disapear?
Title:
Post by: Herodes on 27 July, 2004, 13:32:12
QuoteOriginally posted by blackwings
I don't see any difference between kepp's and nerbos last post. Anyway, I tested the one from Nerbos last post and it works :D

He was reffering in the credits ;)
Title:
Post by: nErBoS on 27 July, 2004, 13:51:11
Hi,

Sharpe eye Herodes :)

About the "Loggin in." that is send by ptokax i don't belive that is possible to remove by script.

Best regards, nErBoS
Title:
Post by: blackwings on 27 July, 2004, 16:44:48
QuoteOriginally posted by nErBoS
Hi,

Sharpe eye Herodes :)

About the "Loggin in." that is send by ptokax i don't belive that is possible to remove by script.

Best regards, nErBoS

Really, I tested with a IP blocker script a few days ago and even if you're regged, the "loggin in" doesn't show up. Or is it because the hub gets the IP first, then the rest of the information(which is logical :P ), so if a script blockes the IP, the rest of the information wont be sent, therefore there want be information about loggin in and and that's why the hub doesn't confirms that you're loggin in. Am I right?
Title:
Post by: nErBoS on 27 July, 2004, 21:30:10
Hi,

This is how data is send whe a user enters a Hub

[20:28] This hub is running PtokaX DC Hub 0.3.3.0 build 15.25 [debug]  (UpTime: 0 days, 0 hours, 1 minutes)
[20:28] Mensagem privada de Data: $ValidateNick [op]nErBoS
[20:28] Mensagem privada de Data: $Version 1,0091
[20:28] Mensagem privada de Data: $GetNickList
[20:28] Mensagem privada de Data: $MyINFO $ALL [op]nErBoS <++ V:0.401,M:A,H:1/0/0,S:1>$ $DSL$nerbos@sapo.pt$0$
[20:28] Welcome to PtokaX
[20:28] Mensagem privada de Data: $GetINFO [op]nErBoS [op]nErBoS

In this case the Loggin in. didn't appear, maybe is because of the new version.

Best regards, nErBoS