Clone User Manager
 

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

Clone User Manager

Started by Requiem, 22 January, 2005, 09:45:34

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Requiem

Hi, I need a clone user manager which can kick clone users but have protected users (our ops enter the hub with another nick to share) and better than
kicks = 2

function NewUserConnected(user) 
local Connects={}
local Connected={}
TextLoad("Connected.dat",Connects) 
for key, value in Connects do 
if (value == "") then
local SaveCon={}
TextLoad("Connected.dat",SaveCon)
tinsert(SaveCon,user.sName.." "..user.sIP)
TextSave("Connected.dat",SaveCon)
--else
--POS1=strfind(strlower(value), " ",1,1)
--POS2=strfind(strlower(value), " ",POS1+1,strlen(value))
--Con=strsub(value,POS1+1)
end
if ( strfind(value, user.sIP,1,1) or strfind(value, user.sName,1,1) ) then
--user:SendPM("hmm","Only 1 user from the same IP allowed!")
user:Kick("Only 1 user from the same IP allowed!")
end
end
end


function UserDisconnected(user)
local Connects={}
TextLoad("Connected.dat",Connects)
TextSave("Connected.dat",RemoveUserFromArray(user.sName,Connects))
end


function TextLoad(FILE,ARRAY)
ARRAY[0], TEXT="" local X=0
readfrom(FILE)
repeat  
if (TEXT) then  
TEXT=TEXT..ARRAY[X].."\r\n"  
end  
X=X+1
ARRAY[X]=read()  
until (ARRAY[X]==nil)
readfrom()
end

function RemoveUserFromArray(USERNAME,ARRAY)
local X
local NEWARRAY={}
local POS1
--local POS2
for X=1,getn(ARRAY) do
POS1=strfind(ARRAY[X]," ",1,1)
--POS2=strfind(ARRAY[X]," ",POS1+1,-1)
if (not strfind(ARRAY[X],USERNAME,POS1) ) then
tinsert(NEWARRAY,ARRAY[X])
end
end
return NEWARRAY
end

function TextSave(FILE,ARRAY)
writeto(FILE)
for X=1,getn(ARRAY) do  write(ARRAY[X].."\n")  end
writeto()
end
because as far as I see (I tested it, I don't understand a bit of LUA :) ) this script doesn't (or can't) clear " Connected.dat " when user disconnects.

Thank you..

b_e

Everything could have been anything else and it would have just as much meaning.

Requiem

Thank you bastya_elvtars, you always run for my help but as I said, I need protected users to be defined not to be kicked by a clone kicker script.

BoJlk

i think he meant modifying the Clone Alert.
adding an option to add protected user,
meaning !addclone
adding it to list of user that allowed to be cloned.
Thats a great idea Requiem  :]

Requiem

If I understood you right, I need exactly this. If I couldn't  (and you meant the scripts by Mutor have already these) , I inspected them 2 times after I've read your post and couldn't find any commands. (I believe I understood you  :))  )

BoJlk

The Script:

--Clone Alert 1.0b 
--by Mutor The Ugly
--PM Clone login to Opchat
--
--
OpChatName = frmHub:GetOpChatName()	--Use this line for inbuilt Px opchat
--OpChatName = "opschat"		--Use this line for a scripted opchat
Bot = "[Sentry]"			--Rename to you main Px bot
PmOps = "1"				--Should Ops be notified 1=yes 0=no
 
function Main()
frmHub:EnableFullData(1)
end

function DataArrival(curUser,sdata) 
local _,_, user1 = strfind(sdata,"$GetINFO%s+(%S+)%s+") 
	if user1 ~= curUser.sName then
		Nick = GetItemByName(user1)
	if Nick ~= nil then 
	if Nick.sIP == curUser.sIP    then
		curUser:SendPM(Bot,"This hub does not allow the use of clones. Hit the bricks, ya leecher!")
		curUser:Disconnect()
		SendPmToNick(Nick.sName,Bot,"This hub does not allow the use of clones. Hit the bricks, ya leecher!")
		user1:Disconnect()
		--	if PMOps == "1" then
		--		SendPmToOps(OpChatName, "*** Cloned user = "..curUser.sName.." logged in, Nick is a clone of = "..Nick.sName)
		--		SendPmToOps(OpChatName, "***"..curUser.sName.." and "..Nick.sName.." have been disconnected")
		--	end
	end 
	end
	end
end

What i tried to say that i use this Scripts and i think it needs abit of modification:

1. adding Profile filter (display notice to who)
2. adding a list of Users to be ignored by the script (Cloning safe list)
3. Adding command for adding users (and defining Profile to use the Command)

Requiem

#6
QuoteLastly, most scripters provide the information YOU need to create the function you want, after all THEY already know how to do it 8-)

You can be sure if I have known how to create the function I want, I wouldn't disturb you.. By the way, accessing my host is really hard for me. Can you add a command like " !addclone " for me ?

Thank you..

P.S. : You can pay a visit to my little hub, Uni?Turk. This is a official invitation to every one here  ;)

BoJlk

QuoteMutor: most scripters provide the information YOU need to create the function you want
thank you for your time and the script modification, but i wouldn't like someone editing my scripts, i f would made one.

b_e

QuoteOriginally posted by Requiem
If I understood you right, I need exactly this. If I couldn't  (and you meant the scripts by Mutor have already these) , I inspected them 2 times after I've read your post and couldn't find any commands. (I believe I understood you  :))  )

yep, sorry. i use that script in lawmaker with the function requested by u, just forgot that i added that code myself without using Mutor's one. (At home i had no net writing lawmaker.)
Everything could have been anything else and it would have just as much meaning.

b_e

lawmaker is closed source, but Copyware.

if you don't redisrtibute it in 30 days you have to remove it from your compie ;p

btw the reason its still closed src is that i cannot do web serving atm... :(
Everything could have been anything else and it would have just as much meaning.

Requiem

The script works fine, thank you a million times for your help but yesterday I met the first trouble of it.. Some of the universities in our country uses virtual IP systems for the students staying in dorms and even though every client has a unique IP on LAN, they share a single IP on WAN. Is there any way to add some IP ranges to Allowed list? Or these IP ranges can be allowed if the exact share is not equal?

b_e

mmm this is a very important thing and as i have to build a network of exactly the same architecture, i have to keep an eye on it.

The best is to have single IPs immuned.
Everything could have been anything else and it would have just as much meaning.

b_e

Edited to support single IP exclusion list. Hope its not erroneous, i am  out of practice.

--Clone Alert 1.0e 
--by Mutor The Ugly
--
-- Disconnects clone users from hub
-- Provides option for protected nicks
-- Provides option to not check Ops
-- Provide option to report to OpChat
-- bastya_elvtars added IP immune list

--User Settings-------------------------------------------------------------------------------------
--OpChatName = "opschat"		--Use this line for a scripted opchat
Bot = frmHub:GetHubBotName()		-- Bot name pulled from hub
PmOps = "yes"				--Should Ops be notified 'yes/no'
CheckOps = "yes"			--Should Ops be checked 'yes/no' 
--Note: If alternate nick from Op's IP is not listed in OkClones, Op will also be disconnected when alt nick logs in.
OkClones = {["Pheonix"]=1,["Rizzo"]=1,["Sol"]=1,["Kissel"]=1}
OkIPs={["160.114.118.106"]=1,["127.0.0.1"]=2,}

UserMsg2Send = "This hub does not allow the use of clones. Hit the bricks, ya leecher!"
--End User Settings----------------------------------------------------------------------------------


function Main()
frmHub:EnableFullData(1)
end


function DataArrival(user,sdata)
if CheckOps == "no" and user.bOperator then return 1 end
	if not OkClones[user.sName] and not OkIPs[user.sIP] then
		local _,_, user1 = strfind(sdata,"$GetINFO%s+(%S+)%s+") 
			if user1 ~= user.sName then
				Nick = GetItemByName(user1)
					if Nick ~= nil then 
						local OpMsg
						OpMsg = "\r\n\r\n*** Cloned user = "..user.sName.." logged in, "..user.sName.." is a clone of = "..Nick.sName.."\r\n"
						OpMsg = OpMsg.."***"..user.sName.." and "..Nick.sName.." have been disconnected from the hub.\r\n\r\n"
						if Nick.sIP == user.sIP    then
							user:SendPM(Bot,UserMsg2Send)
							user:Disconnect()
							SendPmToNick(Nick.sName,Bot,UserMsg2Send)
							Nick:Disconnect()
								if PmOps == "yes" then
									SendPmToOps(Bot,OpMsg)
								end
						end
					end
			end
	end
end
Everything could have been anything else and it would have just as much meaning.

SMF spam blocked by CleanTalk