Clonebot 1.1 - Page 3
 

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

Clonebot 1.1

Started by bastya_elvtars, 03 April, 2005, 19:53:10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dessamator

lol, damn here we go again !!!, im sure some1 will find bugs, :D
Ignorance is Bliss.

bastya_elvtars

QuoteOriginally posted by Dessamator
lol, damn here we go again !!!, im sure some1 will find bugs, :D

Me too, as I only tested for syntax errors. :P
Everything could have been anything else and it would have just as much meaning.

ConejoDelMal

dont worry, i will test it :P

got this when a clone is connecting with the same share, and nothing happens:
Syntax ...abalho\LusoLeader Hub 16.09 dbg\scripts\noclones.lua:50: attempt to index global `user' (a nil value)

if users have different share's, nothing happens, and the Op's arent notified

if user is in an allowed clone, he is accepted without errors, tables save fine....all cmd's work normal

i think thats it for now...
Rede-DC Comunidade Portuguesa de DC

bastya_elvtars

Find this:

user:Disconnect()

and edit so it will be

User:Disconnect()

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

Dessamator

QuoteOriginally posted by [AT]conejodelmal

if users have different share's, nothing happens, and the Op's arent notified


change this ::
if PmOps == "1" then


to this::
if PmOps == true then
Ignorance is Bliss.

ConejoDelMal

edited like both said, testing report:

kick_other_too=1 , not working

If a clone from an Op who is in the hub tries to get in, gets disconnected, Op's never get disconnected (i just think that there is no reason to disconnect clones from an Op)

And isnt it better to notify Op's when there are clones with different share sizes? (for security reasons i mean)
Rede-DC Comunidade Portuguesa de DC

Dessamator

QuoteOriginally posted by [AT]conejodelmal
edited like both said, testing report:

kick_other_too=1 , not working

well that works fine here, mayb u did something wrong
QuoteIf a clone from an Op who is in the hub tries to get in, gets disconnected, Op's never get disconnected (i just think that there is no reason to disconnect clones from an Op)

And isnt it better to notify Op's when there are clones with different share sizes? (for security reasons i mean)

well both of those solved

just change this::

if not(tImmune[curUser.sName]== 1 or tImmune[Nick.sName]== 1) then -- and not (curUser.bOperator or Nick.bOperator)  <--- in NewUserConected it's always false
				if curUser.iShareSize==Nick.iShareSize then
					det(curUser)
					if kick_other_too==1 then
						det(Nick)
					end
				end
			end
     


to this :::

       
if not(tImmune[curUser.sName]== 1 or tImmune[Nick.sName]== 1)  and not(Nick.bOperator)  then				if curUser.iShareSize==Nick.iShareSize then
					det(curUser)
					if kick_other_too==1 then
						det(Nick)
					end
				else
					if PmOps == true then
					SendPmToOps(OpChatName, "*** User "..curUser.sName.." logged in, with same IP as "..Nick.sName.." but with different share, please check.")
					end
				end
			end


ps. each op can only have 1 clone, otherwise ull just have to add "immunity" to the other nicks !!
Ignorance is Bliss.

jiten

Can u guys post the final modded script so that other users don't have to look for pieces here and there? :D

Cheers

Dessamator

QuoteOriginally posted by jiten
Can u guys post the final modded script so that other users don't have to look for pieces here and there? :D

Cheers

lol, ok here it goes ::

-- Clone Alert 1.6
-- 1.0b by Mutor The Ugly
-- PM Clone login to Opchat
-- Applied to latest PtokaX by bastya_elvtars
-- Also added share checking, if different, only notifies ops.
--thx NightLitch
-- Added: Clone check immunity (add, remove and list immune users) by jiten
--- -- touched by Herodes
-- heavily optimised
-- moved to 1.5
-- now it's 1.6, after bastya_elvtars did some more optimization to the detector. :P


OpChatName = "OpChat"  -- Rename to opchatbot
Bot = "botname" -- Rename to you main Px bot
kick=0 -- 0 to only disconnect, otherwise enter a number, and user will be kicked for that amount of minutes.
kick_other_too=0 -- 1 to disconnect/kick the already logged in user, 0 to not
PmOps = false -- true:enables / false:disables , operator notifincation (STRONGLY recommended to leave enabled!)


function Main()
tImmune = {}
	if loadfile("logs/cloneimmune.txt") then dofile("logs/cloneimmune.txt"); end
end


function OnExit()
collectgarbage()
local f = io.open("logs/cloneimmune.txt", "w+")
local m = "tImmune = { "
for a, b in tImmune do m = m..(string.format("[%q]=",a)..b..","); end
m = m.." }"
f:write( m ); f:flush(); f:close();
end


function NewUserConnected(curUser,sdata) 
	for _,Nick in frmHub:GetOnlineUsers() do
		if curUser.sIP==Nick.sIP then
			local det=function (User)
				curUser:SendPM(Bot,"Double Login is not allowed. You are already connected to this hub with this nick: "..Nick.sName)
				if kick~=0 then
					User:SendPM(Bot,"You're being timebanned. Your IP: "..User.sIP)
					User:TimeBan(kick)
					if PmOps == true then
						SendPmToOps(OpChatName, "*** Cloned user <"..curUser.sName.."> ("..curUser.sIP..") logged in and timebanned for "..kick.." minutes. User is a clone of <"..Nick.sName..">")
					end
				else
					User:SendPM(Bot,"You're being disconnected.")
					User:Disconnect()
					if PmOps == true then
						SendPmToOps(OpChatName, "*** Cloned user <"..curUser.sName.."> ("..curUser.sIP..") logged in and disconnected. User is a clone of <"..Nick.sName..">")
					end
				end
			end
			if not(tImmune[curUser.sName]== 1 or tImmune[Nick.sName]== 1)  and not(Nick.bOperator)  then
				if curUser.iShareSize==Nick.iShareSize then
				det(curUser)
				if kick_other_too==1 then
					det(Nick)
					end
				else
					if PmOps == true then
						SendPmToOps(OpChatName, "*** User "..curUser.sName.." logged in, with same IP as "..Nick.sName.." but with different share, please check.")
					end
				end
			end
		end
	end
end 

function ChatArrival (user,data)
	if (user.bOperator) then
		local data = string.sub( data, 1, -2 )
		local s,e,cmd = string.find( data, "%b<>%s+([%-%+%?]%S+)" )
		if cmd then
			return Parse( user, cmd, data, false )
		end
	end
end

function ToArrival ( user, data )
	if ( user.bOperator ) then
		local data = string.sub( data , 1, -2 )
	local s,e, cmd = string.find( data , "%$%b<>%s+([%-%+%?]%S+)" )
if cmd then
return Parse ( user, cmd , data , true )
end
end
end

function Parse( user, cmd, data, how )

local function SendBack( user, msg , from, how )
if how then user:SendPM( from or Bot , msg );return 1; end;
user:SendData( from or Bot, msg );return 1;
end

local t = {
--- Add to cloneList
["+clone"] = function ( user , data , how )
local s,e, name = string.find( data, "%b<>%s+%S+%s+(%S+)" )


if not name then user:SendData(Bot, "*** Error: Type +clone nick") end
if tImmune[name] then user:SendData("nope") end


local nick = GetItemByName(name)
if not nick then user:SendData(Bot, "*** Error: User is not online.") end


tImmune[name] = 1
OnExit()
user:SendData(Bot, name.." is now immune to clone checks!")
return 1


end ,


--- Remove from cloneList
["-clone"] = function ( user , data , how )
local s,e, name = string.find(data, "%b<>%s+%S+%s+(%S+)")


if not name then user:SendData(Bot, "*** Error: Type -clone nick") end
if not tImmune[name] then user:SendData(Bot,"The user "..victim.sName.." is not immune!")  end


local nick = GetItemByName( name )
if not nick then user:SendData(Bot, "*** Error: That user is not online.") end


tImmune[name] = nil
OnExit()
user:SendData(Bot,"Now "..name.." is not no longer immune to clone checks!")
return 1


end,


--- Show cloneList
["?clone"] = function ( user , data, how )


local m = ""
collectgarbage()
for nick, _ in tImmune do
local s = "Offline"
	if GetItemByName(nick) then s = "Online" end
		m = m.."\r\n\t  • ("..s..")  "..nick
	end
		if m == "" then return SendBack( user, "There are no users that can have a clone", Bot, how ) end
			m = "\r\nThe following users can have clones in this hub:"..m
		return SendBack( user, m , Bot, how )
end,
--- Show cloneBot help


["?clonehelp"] = function ( user, data , how )


local m = "\r\n\r\nHere are the commands for the CloneBot:"
m = m.."\r\n\t+clone  \t allows  to have a clone"
m = m.."\r\n\t-clone  \t removes  from the clone list"
m = m.."\r\n\t?clone\t\t shows the users allowed to have a clone"
m = m.."\r\n\t?clonehelp \t allows  to have a clone"
return SendBack( user, m, Bot, how )


end, }


if t[cmd] then return t[cmd]( user, data, how ) end
end
       
Ignorance is Bliss.

jiten


SMF spam blocked by CleanTalk