PtokaX forum

Lua 5.3/5.2/5.1 Scripts (for PtokaX 0.4.0.0 and newer) => Conversion Requests => Topic started by: osse on 26 March, 2008, 19:53:22

Title: Clone script to the new Ptokax 0.4.0.0c
Post by: osse on 26 March, 2008, 19:53:22
Anyone who can help me with a script. Mutor's script.

-- 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 = frmHub:GetOpChatName()   --Rename to opchatbot - or frmHub:GetOpChatName() for bultin
Bot =frmHub:GetHubBotName()      --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:SendPM(Bot, "   This message has been sent to all OPs !! ")
            curUser:Disconnect()
            --Nick:SendPM(Bot,"This hub does not allow the use of clones. Hit the bricks, ya leecher!")
            
            --curUser:SendPM(Bot, "This message has been sent to all OPs !! ")
            --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.." have been disconnected")  ---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

Thnx   :D ;D
Title: Re: Clone script to the new Ptokax 0.4.0.0c
Post by: osse on 27 March, 2008, 18:19:37
Quote from: Mutor on 26 March, 2008, 22:22:49
There was a rewrite rather than a conversion.
Clone Killer 1.1d LUA 5.1 [Strict] (http://board.ptokax.ath.cx/index.php?topic=7134.0)

I got this msg

18:19] Syntax clone.lua:31: attempt to index global 'frmHub' (a nil value)

:-[ :-[ :'(

thnx 4 ur help Mutor  :D ;D
Title: Re: Clone script to the new Ptokax 0.4.0.0c
Post by: Psycho_Chihuahua on 27 March, 2008, 18:27:38
there is no frmhub Function in the new API

use this as Botname instead                  SetMan.GetString(21)