What's wrong with this ?
 

News:

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

What's wrong with this ?

Started by BoyKind, 25 July, 2006, 11:05:31

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

BoyKind

Hello ... can someone tell me what's wrong with this scrip ? It needs converted in 5.1 ? If yes, can you help me, or somethin' ?
-- 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 = frmHub:GetOpChatName(),  -- Rename to opchatbot

Bot = frmHub:GetHubBotName(), -- 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
It gives me this: [11:01] Syntax C:\Volvo Hub\scripts\clone alert.lua:75: attempt to call a table value
- [11:01] Syntax C:\Volvo Hub\scripts\clone alert.lua:75: attempt to call a table value
- [11:01] Syntax C:\Volvo Hub\scripts\clone alert.lua:75: attempt to call a table value
- [11:01] Syntax C:\Volvo Hub\scripts\clone alert.lua:75: attempt to call a table value
- [11:01] Syntax C:\Volvo Hub\scripts\clone alert.lua:75: attempt to call a table value
- [11:01] Syntax C:\Volvo Hub\scripts\clone alert.lua:75: attempt to call a table value
- [11:01] Syntax C:\Volvo Hub\scripts\clone alert.lua:75: attempt to call a table value
- [11:01] Syntax C:\Volvo Hub\scripts\clone alert.lua:75: attempt to call a table value
- [11:01] Syntax C:\Volvo Hub\scripts\clone alert.lua:75: attempt to call a table value
- [11:01] Syntax C:\Volvo Hub\scripts\clone alert.lua:61: attempt to call a table value
- [11:01] Syntax C:\Volvo Hub\scripts\clone alert.lua:75: attempt to call a table value
- [11:01] Syntax C:\Volvo Hub\scripts\clone alert.lua:299: attempt to call a table value
With all the respect

BoyKind

Sry, I'm kinda n00b in scripting ... can you explain more clearly, please ?
With all the respect

bastya_elvtars

*sigh*
Here you go, test this, I'll keep editing this post if you find anomalies.
@Mutor: the optimizations indeed are killers. :-)

-- 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 = frmHub:GetOpChatName()  -- Rename to opchatbot
Bot = frmHub:GetHubBotName() -- 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()
  local f = io.open("logs/cloneimmune.txt", "w+")
  local m = "tImmune = { "
  for a, b in pairs(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 pairs(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 = ""
    for nick, _ in pairs(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:"..
    "\r\n\t+clone \t allows to have a clone"..
    "\r\n\t-clone \t removes from the clone list"..
    "\r\n\t?clone\t\t shows the users allowed to have a clone"..
    "\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
Everything could have been anything else and it would have just as much meaning.

BoyKind

still no ... it doesn't work ... when I type +clone <nick> it gives me
Quote[16:22] Syntax C:\Volvo Hub\scripts\clone alert.lua:29: attempt to index local 'f' (a nil value)
With all the respect

BoyKind

Can you just forget that script and make me one that does not accept users that try to connect to my hub with multiple nicks but the same IP ? And only reg users can connect with multiple nicks but the same IP ? Could it be possible ?
With all the respect

Markitos

Quote from: BoyKind on 25 July, 2006, 14:30:54
Can you just forget that script and make me one that does not accept users that try to connect to my hub with multiple nicks but the same IP ? And only reg users can connect with multiple nicks but the same IP ? Could it be possible ?
I think Clone Alert does but i'll try something different. Will post my progress tonight.

bastya_elvtars

Quote from: BoyKind on 25 July, 2006, 14:28:26
still no ... it doesn't work ... when I type +clone <nick> it gives me
Quote[16:22] Syntax C:\Volvo Hub\scripts\clone alert.lua:29: attempt to index local 'f' (a nil value)

Create a folder called logs in the scripts folder. I missed that, sorry.
Everything could have been anything else and it would have just as much meaning.

bastya_elvtars

BTW here is CloneAlert 1.1 fixed for Lua5.1

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

OpChatName = "opschat"		--Rename to opchatbot - or frmHub:GetOpChatName() for bultin
Bot = "[Sentry]"			--Rename to you main Px bot - frmHub:GetHubBotName() for builtin
PMOps = "1"				--Should Ops be notified 1=yes 0=no (STRONGLY recommended to leave enabled!)



function NewUserConnected(curUser,sdata) 
	for _,Nick in pairs(frmHub:GetOnlineUsers()) do
		if curUser.sIP==Nick.sIP and not (curUser.bOperator and Nick.bOperator) then
			if curUser.iShare==Nick.iShare then
				curUser:SendPM(Bot,"This hub does not allow the use of clones. Hit the bricks, ya leecher!")
				curUser:Disconnect()
				Nick:SendPM(Bot,"This hub does not allow the use of clones. Hit the bricks, ya leecher!")
				Nick: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
			else
				SendPmToOps(OpChatName, "*** User "..curUser.sName.." logged in, with same IP as "..nick.sName.." but with different share, please check.")
			end
		end
	end 
end
Everything could have been anything else and it would have just as much meaning.

BoyKind

it works \:D/ thx bastya_elvtars ... all it needed was that folder ;) ... now I have another request ... there are two commands over there .. ?clone and ?clonehelp ... can you modify them in !clone and !clonehelp ? please...
With all the respect

Psycho_Chihuahua

you can do that on your own...all you need to do is change the ? into a ! inside the script.
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

BoyKind

Nope, it doesn't work ... dunno' why ... I tried to do that, but then the script won't work no more ... can you tell me where exactly 2 modify ?
With all the respect

BoyKind

Nevermind :) find out 4 myself :)
-- 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 = frmHub:GetOpChatName()  -- Rename to opchatbot
Bot = frmHub:GetHubBotName() -- 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()
  local f = io.open("logs/cloneimmune.txt", "w+")
  local m = "tImmune = { "
  for a, b in pairs(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 pairs(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 = ""
    for nick, _ in pairs(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:"..
    "\r\n\t+clone \t allows to have a clone"..
    "\r\n\t-clone \t removes from the clone list"..
    "\r\n\t!clone\t\t shows the users allowed to have a clone"..
    "\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
With all the respect

Markitos

Good you figured it out; that were my 1st steps =)

Djdirect

hi all
I use this script but after several test, the script doesn't see any double ip
-- 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 = "?Op-Chat?" -- frmHub:GetOpChatName() - Rename to opchatbot
Bot = "?Postman?" -- frmHub:GetHubBotName() - 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=1 -- 1 to disconnect/kick the already logged in user, 0 to not
PmOps = true -- 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 pairs(tImmune) do m = m..(string.format("[%q]=",a)..b..","); end
m = m.." }"
f:write( m ); f:flush(); f:close();
end


function NewUserConnected(curUser,sdata)
    if (curUser.bOperator) then
      curUser:SendData("$UserCommand 1 3 ? Clone Alerte\\Ajoutez un user dans la liste des immunis?s$<%[mynick]> +clone %[line:Pseudo]&#124;|")
      curUser:SendData("$UserCommand 1 3 ? Clone Alerte\\Ajoutez cet user dans la liste des immunis?s$<%[mynick]> +clone %[nick]&#124;|")
      curUser:SendData("$UserCommand 1 3 ? Clone Alerte\\Effacer un user de la liste des immunis?s$<%[mynick]> -clone %[line:Pseudo]&#124;|")
      curUser:SendData("$UserCommand 1 3 ? Clone Alerte\\Effacer cet user de la liste des immunis?s$<%[mynick]> -clone %[nick]&#124;|")
      curUser:SendData("$UserCommand 1 3 ? Clone Alerte\\Montrez les users autoris?s ? avoir un clone$<%[mynick]> ?clone&#124;|")
      curUser:SendData("$UserCommand 1 3 ? Clone Alerte\\Voir les commandes de Clone Alerte$<%[mynick]> ?clonehelp&#124;|")
    end
	for _,Nick in pairs(frmHub:GetOnlineUsers()) do
		if curUser.sIP==Nick.sIP then
			local det=function (User)
				curUser:SendPM(Bot,"La double Ip n'est pas permis. Vous ?tes d?j? connect?s ? ce hub sous ce pseudo: "..Nick.sName)
				if kick~=0 then
					User:SendPM(Bot,"Vous ?tes temporairement banni. Votre IP: "..User.sIP)
					User:TimeBan(kick)
					if PmOps == "1" then
						SendPmToOps(OpChatName, "*** Clone User Alerte: <"..curUser.sName.."> ("..curUser.sIP..") c'est connect? et a ?t? temporairement banni pour  "..kick.." minutes. L'user est un clone de <"..Nick.sName..">")
					end
				else
					User:SendPM(Bot,"Vous ?tes d?connect?s.")
					User:Disconnect()
					if PmOps == "1" then
						SendPmToOps(OpChatName, "*** Clone User Alerte: <"..curUser.sName.."> ("..curUser.sIP..") c'est connect? et a ?t? d?connect?. L'user est un clone de <"..Nick.sName..">")
					end
				end
			end
			if not(tImmune[curUser.sName]== 1 or tImmune[Nick.sName]== 1) then -- and not (curUser.bOperator or Nick.bOperator)  <--- in NewUserConnected it's always false
				if curUser.iShareSize==Nick.iShareSize then
					det(curUser)
					if kick_other_too==1 then
						det(Nick)
					end
				end
			end
		end
	end
end 

OpConnected = NewUserConnected


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, "*** Erreur: Taper +clone pseudo") end
if tImmune[name] then user:SendData("nope") end


local nick = GetItemByName(name)
if not nick then user:SendData(Bot, "*** Erreur: L'user n'est pas en ligne.") end


tImmune[name] = 1
OnExit()
user:SendData(Bot, name.." est maintenant immunis? ,il ne sera plus control? par Clone Alerte!")
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, "*** Errer: Taper -clone pseudo") end
if not tImmune[name] then user:SendData(Bot,"L'user "..victim.sName.." n'est plus immunis?!")  end


local nick = GetItemByName( name )
if not nick then user:SendData(Bot, "*** Erreur: L'user n'est pas en ligne.") end


tImmune[name] = nil
OnExit()
user:SendData(Bot,"Now "..name.." n'est dor?navant plus immunis?,il sera a nouveau control?!")
return 1


end,


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


local m = ""
collectgarbage()
for nick, _ in pairs(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, "Il n'y a pas aucun user autoris? a avoir un clone", Bot, how ) end
			m = "\r\nLes users suivants peuvent avoir des clones dans ce hub:"..m
		return SendBack( user, m , Bot, how )
end,
--- Show cloneBot help


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


local m = "\r\n\r\nVoici les commandes de Clone Alerte:"
m = m.."\r\n\t+clone <pseudo> \t autorise <pseudo> a avoir un clone"
m = m.."\r\n\t-clone <pseudo> \t efface <pseudo> de la liste immunis?"
m = m.."\r\n\t?clone\t\t voir la liste des users autoris?s a avoir un clone"
m = m.."\r\n\t?clonehelp \t voir les commandes de Clone Alerte"
return SendBack( user, m, Bot, how )


end, }


if t[cmd] then return t[cmd]( user, data, how ) end
end

bastya_elvtars

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

Djdirect

thank's   no have right click menu  :-\

bastya_elvtars

Ohm, should it?
I'll make one then soon.
Everything could have been anything else and it would have just as much meaning.

SMF spam blocked by CleanTalk