Anti Double Login Bot (Stand-alone)
 

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

Anti Double Login Bot (Stand-alone)

Started by Skyhawk, 11 May, 2004, 16:39:34

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Skyhawk

Well my request is a simple:

I need a script/bot that automatically disconnects a nick/user if the same ip address is already in use on my hub. It should also be possible to manually scan for double logins after the script is running. Further, if possible, OP's and selected Nicks should be left unaffected by this script. OP's by default and slected users by a list which is controlled by commands like:

+addnick
+delnick
+rescan


Can anyone help me with this?

Thx in advance

??????Hawk??????

#1
This one works pretty good m8

hope it helps



-- An easy DoublesKickBot by piglja - 26/04/03 
-- Added a IP script by piglja - 29/04/03. IP Allow script by Don Leon, if I remember correct... 

ip={} 
oAllow={} 

function Main() 
oAllow["127.0.0.1"]=1 --Just an example;) 
end 

function NewUserConnected(user) 
if not user.bOperator then
theIP=user.sIP 
local a,b,c,d=splittip(theIP) 
if ip[user.sIP] == nil then 
ip[user.sIP]=user.sIP 
elseif ((oAllow[a]==1)or(oAllow[b]==1)or(oAllow[c]==1)or(oAllow[d]==1)) then 
else 
SendToAll("!!!Alert Clone user kicked Nick:-  "..user.sName.."  IP:- "..user.sIP)
user:Kick("No doubles allowed!!!") 
end 
end 
end 

function UserDisconnected(user) 
ip[user.sIP]=nil 
end 

function splittip(IP) 
r,g,a,b,c,d = strfind(IP, "(%d*).(%d*).(%d*).(%d*)") 
d=a.."."..b.."."..c.."."..d 
c=a.."."..b.."."..c..".*" 
b=a.."."..b..".*" 
a=a..".*" 
return a,b,c,d 
end

HaArD

You do realize that you are making the flawed assumption that User = IP?

Therefore 2 or more people who:

 - Live in the same home behind a NAT device
 - Go to the same school behind a NAT device
 - Work for the same company behind a NAT device
 - Use the same ISP who happens to share IP's among it's users (common practice in some European countries)

Will not be able to connect to your hub at the same time and in most cases will not have any idea why, since they are not "Clones" or "Doubles" they are just themselves.....

Skyhawk

I know that  thats why i want to have the  do not disconnect options for certain users

??????Hawk??????

#4
you could always change this line:-

user:Kick("No doubles allowed!!!")

to this:-

user:Kick("You are sharing the same ip as another user in this hub. Please pm the hub owner from the other connection to have your Nick cleared.  Sorry for any inconveniance")

Corayzon

this scripts could really take up some memory on large hubs...

cant ya get the userlist and loop through it to check for ips rather then duplicating stored memory?

doing so could save a shitload of memory when u have 1000 users

TyShkan

QuoteOriginally posted by Mutor
This script informs the opchat of a clone. Easy enough to mod.

--Clone Alert 1.0 
--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
 
function Main()
frmHub:EnableFullData(1)
end

function DataArrival(curUser,sdata) 
local _,_, user1 = strfind(sdata,"$GetINFO%s+(%S+)%s+") 
if user1 ~= curUser.sName then
	user1 = GetItemByName(user1)
		 
		
if user1 ~= nil then 
	if user1.sIP == curUser.sIP    then
		SendPmToOps(OpChatName, "*** Cloned user = "..curUser.sName.." logged in, User is a clone of = "..user1.sName)

	end 
end
end
end
Hi! Who's can modify this script? I would like, that script disconnect new user, if they have already 2 clon's on the hub...

nErBoS

Hi,

Done...

--Clone Alert 1.0 
--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
 
function Main()
frmHub:EnableFullData(1)
end

function DataArrival(curUser,sdata) 
local _,_, user1 = strfind(sdata,"$GetINFO%s+(%S+)%s+") 
if user1 ~= curUser.sName then
	user1 = GetItemByName(user1)
		 
		
if user1 ~= nil then 
	if user1.sIP == curUser.sIP    then
		SendPmToOps(OpChatName, "*** Cloned user = "..curUser.sName.." logged in, User is a clone of = "..user1.sName)
[b]curUser:Disconnect()[/b]
	end 
end
end
end

Best regards, nErBoS
--## nErBoS Spot ##--

blackwings

Nerbos, I think you misunderstood TyShkan. I think he meant that that 2 users with the same IP is ok, but the third users that connects with the same IP will be disconnected.


TyShkan

QuoteOriginally posted by blackwings
Nerbos, I think you misunderstood TyShkan. I think he meant that that 2 users with the same IP is ok, but the third users that connects with the same IP will be disconnected.
Hi!
Yes, it's right :D Nerbos is misunderstood me ;) On hub are 2 users with same IP, when Connecting 3d user withs same IP, his will be disconnected...

nErBoS

#10
Hi,

Sorry, try this then...

--Clone Alert 1.0 
--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

arrClone = {}
 
function Main()
frmHub:EnableFullData(1)
end

function UserDisconnected(user)
	if (arrClone[user.sIP] ~= nil) then
		arrClone[user.sIP] = arrClone[user.sIP] - 1
	end
end

function DataArrival(curUser,sdata) 
	local _,_,user1 = strfind(sdata,"$GetINFO%s+(%S+)%s+")
	if user1 ~= curUser.sName then
		local clone
		user1 = GetItemByName(user1)
		if user1 ~= nil then 
			if user1.sIP == curUser.sIP    then
				if (arrClone[user1.sIP] == nil) then
					arrClone[user1.sIP] = 1
				else
					arrClone[user1.sIP] = arrClone[user1.sIP] + 1
				end
				if (arrClone[user1.sIP] == 2) then
					SendPmToOps(OpChatName, "*** Cloned user = "..curUser.sName.." logged in, User is a clone of = "..user1.sName)
					curUser:Disconnect()
				end
			end 
		end
	end
end

Best regards, nErBoS
--## nErBoS Spot ##--

TyShkan

Hi! I have some trouble! This script disconnect users:
[16:53:40] *** Connected: User[1comp]
[16:53:45] *** Connected: User[2comp]
ok
[16:55:32] *** Disconnected: User[2comp]
[16:56:07] *** Connected: User[2comp]
disconnect user
Can you change script?

nErBoS

Hi,

I have edited the script above, try out.

Best regards, nErBoS
--## nErBoS Spot ##--

SMF spam blocked by CleanTalk