Please help,
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Please help,

Started by imby, 24 April, 2005, 02:05:46

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

imby

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.

imby

Also, is this the most efficient way to do it, wont take any significant bandwidth?

imby


jiten

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

SMF spam blocked by CleanTalk