PtokaX forum

Archive => Archived 5.0 boards => Help with scripts => Topic started by: imby on 24 April, 2005, 02:05:46

Title: Please help,
Post by: imby on 24 April, 2005, 02:05:46
Ok, from now on in my hub, those with profile REG will have a prefix: [letters_inbetween_here]nick. i.e. [SE]blahblah.

So to keep my reg's ordered, i want to make it so profile [-1] user can't sign in with a [ at the beginning of his nick. Only reg's will have that. Here's a template, hope someone can help me acheive this.

--###############################################--
-- Simple VIP Check -- By NightLitch 2004-12-23 --
-- Updated:
-- - Checks for users that should not have [VIP] or [REG]
-- in the Nickname.
-- Advanced Tags: [__V--i--P__}, {_V_]i[_P_}
-----
-- Converted to LUA 5 by blackwings
--###############################################--
BotName = "[HubSecurity]"
--###############################################--
function MyINFOArrival(sUser,sData)
local _,_,sTag = string.find(string.lower(sData), "[%[%{%(](%S+)[%]%}%)]")
if sTag then
if string.find(string.lower(sTag), "%p*v%p*i%p*p%p*") and sUser.iProfile ~= 2 then
sUser:SendData(BotName, "You are not registered here, Remove VIP Tag from your nickname! Accounts are deleted after 6 weeks of inactivity, if yours was feel free to re-enter and re-register. Tag: "..sTag)
sUser:Disconnect()
end
end
--###############################################--
--// NightLitch


damn this is hard to read, lost the formatting somehow. anyway I gather there needs to be a ^ at the beginning of the string to signify that [ must be at the beginning of the nick to disconnect the user.

Also it should become:

and sUser.iProfile == -1 then ?


After that I'm lost :) any help appreciated.
Title:
Post by: imby on 24 April, 2005, 02:15:18
Also, is this the most efficient way to do it, wont take any significant bandwidth?
Title:
Post by: imby on 25 April, 2005, 16:42:24
<< BUMP >>
Title:
Post by: jiten on 25 April, 2005, 17:00:51
Try this one:
--###############################################--
-- requested by imby
-- Disconnect nicks with "[" in front of their nick by jiten
-- Simple VIP Check -- By NightLitch 2004-12-23 --
-- Converted to LUA 5 by blackwings
--###############################################--
BotName = "[HubSecurity]"
--###############################################--
function MyINFOArrival(sUser,sData)
if string.find(string.lower(sData), "[%[]%S+") then
if sUser.iProfile == -1 then
sUser:SendData(BotName, "You are not registered here, Remove the '[' from your nickname! Accounts are deleted after 6 weeks of inactivity, if yours was feel free to re-enter and re-register.")
sUser:Disconnect()
end
end
end
--###############################################--
--// NightLitch

Cheers