PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: tamilzone on 04 February, 2004, 17:13:37

Title: Need A Small Prefix Bot pls!
Post by: tamilzone on 04 February, 2004, 17:13:37
hi i have a problem i want that only with the my hub prefix enter the hub at the sart! when the connect to my hub like this


You don't have the right prfeix pls change it and come in!


can any one help me i have try in RULES AND BOTS in ptoka x it dosen't work


i have write         :                [[iThaYaM]]

in nickname rule

and the hub prefix must be [iThaYaM]

can anyone help me pls thx
Title:
Post by: Yokozuna on 04 February, 2004, 17:35:20
Try this:

BOTNAME = "PrefixChecker"
PREFIX = { "[iThaYaM]" }

function Main()
frmHub:RegBot(BOTNAME)
end

function NewUserConnected(curUser)
for check,prefix in PREFIX do
if not strfind(curUser.sName,prefix,1,1) then
curUser:SendPM(BOTNAME,"You were DISCONNECTED by "..BOTNAME.." - Reason: You don't have the right prefix, please change it and come in")
curUser:Disconnect()
end
end
end

Hope I understood you right, if not, let me know.


Yokozuna
Title:
Post by: Yokozuna on 04 February, 2004, 17:35:55
Sorry, double post :-)
Title:
Post by: NightLitch on 04 February, 2004, 17:36:26
here you go:

--Simple ISP Check by NightLitch

BotName = "NXS-3"

ISP = { "[1Mbit]" , "[2Mbit]" , "[5Mbit]" , }

function NewUserConnected(curUser)
if Badisp(curUser,data) then
else
curUser:SendData(BotName," *** You are using an unauthorized ISP !")
curUser:Disconnect()
return 1
end
end

function Badisp(curUser)
for key,isps in ISP do
if strfind(strlower(curUser.sName), strlower(isps),1,1) then
return 1
end
end
end

simple and neat...
Title: thx
Post by: tamilzone on 04 February, 2004, 17:41:20
thank you very much it works good!


Vinoth