666
 

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

666

Started by 6Marilyn6Manson6, 12 August, 2004, 18:45:47

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

6Marilyn6Manson6

--===========                6Marilyn6Manson6'Sicily v0.1 Script Compiled By ??6Marilyn6Manson6?? For The Public forum use at will                =============--

DevBot = "Developer"   -- DeveloperChat Bot Name
DevClvl = 0      -- DeveloperChat Bot Commands Lvl ( 0 = Master ~~ 1 = Operators ~~ 2 = VIPs ~~ 3 = Reg ~~ etc.)
PmToOps = "PM-OP's"   -- Pm To Ops Name
TimeText = "6Marilyn6Manson6'Sicily v0.1"
ShowTimeText = 20       --  Minuts for the Timetext to appear.
DefMessMode = 0           -- (0) IN CHAT TO ALL, (1) IN CHAT BUT ONLY TO WATCHERS, (2) IN BotName TO ALL, (3) IN BotName BUT ONLY TO WATCHERS
E_Mail = "6Marilyn6Manson6kolo@email.it"
--> This is for the scriptet Log-In Check if it's used then turn all the checks Off in the Hub Software and Remember that nil = Off <--
CheckingEnabled = nil   -- nil or 1 if Checks for Share/Slots/Hubs/Version etc.
SetCheckLvl = 5      -- Sets Share/Slots/Hub/Version/Forbiddenwords check level - 0=Master / 1=Operator / 2=VIP / 3=Reg / etc
hubCheckMethod = 1   -- DC++0.24 Hubs notation 1=x, 2=x/y, 3=x/y/z (x=normal / y=registered / z=operator)
RedirectOnFailed = nil   -- nil or 1 to redirect when user fails to meet the Log-In Check criteria (not for Forbiddenwords)
useTempBan = nil   -- nil or 1 to TempBan users when they don't meet the criteria.
minVersion = nil   -- nil or version to allow minimum a specific version on the hub.
disallowNmdc = nil   -- nil or 1 to disallow Neomodus Direct Connect on the hub.
maxSlots = nil      -- nil or max slots allowed on the hub.
maxHubs = nil      -- nil or max hubs allowed on the hub.
minSlotsPerHub = nil   -- nil or min slots/hubs to be on the hub.
minSlots = nil      -- nil or min slots to be on the hub.
ExtraSlots = nil   -- Minimum extra slots for this hub.
SlotsVsSpeedCheck = nil   -- nil or 1 if the script shall check for connection speed vs slots
SlotsVsSpeed={}
SlotsVsSpeed["28.8Kbps"] = 1   
SlotsVsSpeed["33.6Kbps"] = 1
SlotsVsSpeed["56Kbps"] = 2
SlotsVsSpeed["ISDN"] = 2
SlotsVsSpeed["Satellite"] = 3
SlotsVsSpeed["Cable"] = 5
SlotsVsSpeed["DSL"] = 3
SlotsVsSpeed["LAN(T1)"] = 10
SlotsVsSpeed["LAN(T3)"] = 10
forbiddenWords = { "[ADM]", "[ADMIN]", "[Admin]", "[??M]","[Adm]", "[OP]", "[Op]", "[op]", "[??]", "[VIP]", "[Vip]", "[vip]", "[V??]", "[I?P]", "[?.VIP]", "#" }
------------------->  Dont Change Anything Below This Point, unless you really Really REALLY know what your doing  <-------------------

BotName = frmHub:GetHubBotName()
OpChat = frmHub:GetOpChatName()
MessMode = DefMessMode
DevChatArray={}
DevChatFile = "Developers.tbl"
WatcherArray = {}
WatcherFile = "Watchers.tbl"
OpsArray = {}
OpsFile = "Operators.tbl"
ScriptRestart = {}
LogInFollowArray = {}
BotNameInfo = "$MyINFO $ALL "..BotName.." 6Marilyn6Manson6'Sicily v0.1 $ $zizzo $"..E_Mail.."$$"
OpChatInfo = "$MyINFO $ALL "..OpChat.." 6Marilyn6Manson6'Sicily v0.1 $ $zizzo $"..E_Mail.."$$"
PmToOpsInfo = "$MyINFO $ALL "..PmToOps.." 6Marilyn6Manson6'Sicily v0.1 $ $zizzo $"..E_Mail.."$$"
DevBotInfo = "$MyINFO $ALL "..DevBot.." 6Marilyn6Manson6'Sicily v0.1 $ $zizzo $"..E_Mail.."$$"

--============================================================    Main:    ============================================================--

function Main()
frmHub:RegBot(DevBot)
DevChatArray = LoadFromFile(DevChatFile)
frmHub:RegBot(PmToOps)
WatcherArray = LoadFromFile(WatcherFile)
OpsArray = LoadFromFile(OpsFile)
SetTimer(ShowTimeText*60000)
StartTimer()
ScriptRestart = "  (? ?.??.->  "..Version.." Lanciato il "..date(" %d-%m-%Y alle %X ").."  <-.??.???)"
SendToAll(ScriptRestart)
SendToAll(BotNameInfo)
SendToAll(OpChatInfo)
SendToAll(PmToOpsInfo)
SendToAll(DevBotInfo)
end

--========================================================    DataArrival:    =========================================================--

function DataArrival(user, data)
   if (strsub(data, 1, 1) == "<" ) then
   local data=strsub(data,1,strlen(data)-1)
   local _,_,cmd=strfind(data, "%b<>%s+(%S+)")
   local Commands = (UserCommands(user, data, cmd) or OpCommands(user, data, cmd) or SUCommands(user, data, cmd) or DeveloperCommands(user, data, cmd) or SvipCommands(user,data,cmd))
   return Commands
   elseif (strsub(data, 1, 12) == "$OpForceMove") or (strsub(data, 1, 10) == "$ForceMove") and (user.iProfile < 0 or user.iProfile > 0)then
   return 1
   elseif strsub(data, 1, 5) == "$To: " then
   local s, e, to = strfind(data, "$To: (%S+)")
      if to ~= BotName and to ~= PmToOps and to ~= DevBot then
         return 0
      else
         if to == BotName then
         local data=strsub(data,1,strlen(data)-1)
         local _,_,cmd = strfind(data,"$%b<>%s+(%S+)")
         if user.iProfile == 1 or user.iProfile == 0 then
         local Commands = (UserCommands(user, data, cmd) or OpCommands(user, data, cmd) or SUCommands(user, data, cmd) or DeveloperCommands(user, data, cmd))
         return Commands
         end

         elseif to == PmToOps then
         local data=strsub(data,1,strlen(data)-1)
         local _,_,message = strfind(data,"$%b<>%s+(.+)")
         SendToAll(PmToOps, "prova")
--         SendPmToNick(OpChat,PmToOps, "<"..user.sName.."> ..message..")

         elseif to == DevBot then
         local data=strsub(data,1,strlen(data)-1)  
         local s,e,from,msg = strfind(data,"From:%s+(%S+)%s+$%b<>%s+(.+)")  
            if DevChatArray[user.sName] ~= nil then
            DevChatArray[user.sName] = nil
               for i,v in DevChatArray do
               Developer=GetItemByName(i)
                  if (Developer~=nil) then
                  Developer:SendData("$To: "..i.." From: "..DevBot.." $<"..user.sName.."> "..msg.."|")
                  end
               end
            DevChatArray[user.sName] = user.sName
            else
            user:SendPM(DevBot,"Te non hai il permesso di scrivere qui.. (Se hai bisogno del permesso, chiedilo a un ADMIN)")
            end
         local _,_,cmd = strfind(data,"$%b<>%s+(%S+)")
         local Commands = (DeveloperCommands(user, data, cmd))
         end
      end
   elseif CheckingEnabled then
      if strsub( data, 1, 8 ) == "$MyINFO " and (user.iProfile < 0 or user.iProfile > SetCheckLvl) then
      CheckMyInfo(user, strsub(data, 1, strlen(data) -1))
      end
   end
end

--=====================================================    DeveloperCommands:    ======================================================--

function DeveloperCommands(user, data, cmd)
   if user.iProfile < 0 then
   return
   end
   if user.iProfile <= DevClvl then
      if (cmd == "+devhelp") then
      DevHelp(user)
      return 1
      elseif (cmd == "+dev") then
      local s,e,cmd,ChatName = strfind( data, "%b<>%s+(%S+)%s+(.*)" )
         if (ChatName == nil) then
         ChatName = user.sName
         end
         if DevChatArray[ChatName] == nil then
         DevChatArray[ChatName] = ChatName
            for index, value in DevChatArray do
            SendPmToNick(index, DevBot, "  "..ChatName.." ? entrato nella DevChat")
            end
         else
            for index, value in DevChatArray do
            SendPmToNick(index, DevBot, "  "..ChatName.." ? uscito dalla DevChat")
            end
         DevChatArray[ChatName] = nil
         end
         SaveToFile(ChatName,DevChatFile,DevChatArray)
         return 1
      elseif (cmd == "+showdev") then
         function ShowDev()
         local disp = ""
            for index, value in DevChatArray do
            local line = index
               if GetItemByName(index) then
                  if (strlen(index) <= 8) then
                  disp = disp.." ? "..line.."\t\t\t~ On-line ~\r\n"
                  else
                  disp = disp.." ? "..line.."\t\t~ On-line ~\r\n"
                  end
               else
                  if (strlen(index) <= 8) then
                  disp = disp.." ? "..line.."\t\t\t? Off-Line ?\r\n"
                  else
                  disp = disp.." ? "..line.."\t\t? Off-Line ?\r\n"
                  end
               end
            end
            return disp
         end
         user:SendPM(DevBot, "\r\n\r\n(? ?.??.->      Developer Chatters      <-.??.???)\r\n\r\n"..ShowDev())
         return 1
      end
   end
end

function DevHelp (user)
   local disp = "\r\n\r\n"
   disp = disp.."~~ Scripted DeveloperChat Commands: ~~\r\n\r\n"
   disp = disp.."   +dev       -   Add or part a user to the list of people that can chat in the "..DevBot.."\r\n"
   disp = disp.."   +showdev      -   See witch users that can chat in the "..DevBot.."\r\n"
   disp = disp.."\r\n"
   user:SendPM(DevBot, disp)
end

6Marilyn6Manson6

--=======================================================    UserCommands:    ========================================================--

function UserCommands(user, data, cmd)
   if (cmd == "+help") then
      AlmHelp(user)
      if user.iProfile == 1 then
         OpHelp(user)
         return 1
         elseif user.iProfile == 0 then
            SuHelp(user)
            return 1
            elseif user.iProfile == 4 then
               SvipHelp(user)
               return 1
      end
      return 0
   elseif (cmd == "+rules") then
      ShowFile("rules.txt", user, BotName, "PM")
      return 0
   elseif (cmd == "+faq") then
      ShowFile("faq.txt", user, BotName, "PM")
      return 0
   elseif (cmd == "+network") then
      ShowFile("network.txt", user, BotName, "PM")
      return 0
   elseif (cmd == "+disclaimer") then
      ShowFile("disclaimer.txt", user, BotName, "PM")
      return 0
   elseif (cmd == "+ops") then
      function OpList()
      local disp = ""
         for index, value in OpsArray do
         local line = value
         disp = disp.." ? "..line.."\r\n"
         end
         return disp
         end
   user:SendPM(BotName, "\r\n\r\n\t\t\t\t(? ?.??.->   Amministratori & Operatori   <-.??.???)\r\n\r\n"..OpList())
      return 0
   elseif (cmd == "!time") then
      OnTimer()
      return 0
   elseif (cmd == "+watch") then
      local s,e,cmd,DevChatName = strfind( data, "%b<>%s+(%S+)%s+(.*)" )
      if (DevChatName ~= nil and user.iProfile == 0) then
      user.sName = DevChatName
      else
      user.sName = user.sName
      end
      if (MessMode == 1) or (MessMode == 3) then
         if (not (WatcherArray[user.sName])) then
         WatcherArray[user.sName] = 1
         SaveToFile(user.sName,WatcherFile,WatcherArray)
            if (MessMode == 2) or (MessMode == 3) then
            user:SendPM(BotName, " You have joined "..BotName.." for Kick & Bans, messages about Kicks & Bans will now be shown to you inhere !!")
            else
            user:SendData(BotName, " You have joined "..BotName.." for Kick & Bans, messages about Kicks & Bans will now be shown to you !!")
            end
         else
         WatcherArray[user.sName] = nil
         SaveToFile(user.sName,WatcherFile,WatcherArray)
            if (MessMode == 2) or (MessMode == 3) then
            user:SendPM(BotName, " You have left "..BotName.." for Kick & Bans, messages about Kicks & Bans will not be shown to you inhere !!")
            else
            user:SendData(BotName, " You have left "..BotName.." for Kick & Bans, messages about Kicks & Bans will not be shown to you !!")
         end
         return 0
         end
      else
         if (MessMode == 0) then
         user:SendData(BotName, "Kick & Bans is shown to ALL nothing you can do about it.....;-)")
         else
         user:SendPM(BotName, "Kick & Bans is shown to ALL nothing you can do about it.....;-)")
         end
         return 0
      end
   elseif (cmd == "!version") then
      user:SendData("Currently Script Version", "  "..Version)
      return 1
   elseif (cmd == "+showreg") then
         local profiles = GetProfiles()
         local index, profile, index2, username
         local disp = ""
            for index, profile in profiles do
            local line = profile
            disp = disp.."\r\nProfile "..line..":\r\n"
            users = GetUsersByProfile(profile)
               for index2, username in users do
               local line = username
                  if GetItemByName(username) then
                     if (strlen(username) <= 8) then
                     disp = disp.." ? "..line.."\t\t\t~ On-line ~\r\n"
                     else
                     disp = disp.." ? "..line.."\t\t~ On-line ~\r\n"
                     end
                  else
                     if (strlen(username) <= 8) then
                     disp = disp.." ? "..line.."\t\t\t? Off-Line ?\r\n"
                     else
                     disp = disp.." ? "..line.."\t\t? Off-Line ?\r\n"
                     end
                  end
               end
            end
   end
end
--========================================================    SvipCommands:    =========================================================--
function SvipCommands(user, data, cmd)
   if user.iProfile == 4 then
      if (cmd=="#warn") then
      local s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s*(.*)" )
      local victim = GetItemByName(Name)
         if victim ~= nil then
         victim:SendPM(user.sName, "You are being warned because: "..reason)
         SendToAll(BotName, user.sName.." is warning <"..Name.."> because: "..reason)
         return 1
         else
         user:SendData("*** No such nick in the userlist !! ***")
         end
   elseif (cmd=="#disc") then
      local s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s*(.*)" )
      local victim = GetItemByName(Name)
         if victim ~= nil then
            if victim.iProfile ~= 0 then
            victim:SendPM(user.sName, "You are being disconnected because: "..reason)
            SendToWatcher(user.sName.." is disconnecting <"..Name.."> because: "..reason)
            victim:Disconnect()
            return 1
            else
            user:SendData("*** You can't disconnect a Superuser !! ***")
            end
         else
         user:SendData("*** No such nick in the userlist !! ***")
         end
   elseif (cmd=="#kick") then
      local s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s*(.*)" )
      local victim = GetItemByName(Name)
         if victim ~= nil then
            if victim.iProfile ~= 0 then
            victim:SendPM(user.sName, "You are being kicked because: "..reason)
            SendToWatcher(user.sName.." is kicking <"..Name.."> because: "..reason)
               if (MessMode == 2) or (MessMode == 3) then
               user:SendPM(BotName, Name.." IP:  "..victim.sIP)
               else
               user:SendData(BotName, Name.." IP:  "..victim.sIP)
               end
            victim:TempBan()
            return 1
            else
            user:SendData("*** You can't kick a Superuser !! ***")
            end
         else
         user:SendData("*** No such nick in the userlist !! ***")
         end
   elseif (cmd == "#userinfo") then
      local s,e,Name = strfind( data, "%b<>%s+%S+%s+(.+)" )
         UserInfo(user, GetItemByName(Name))
         return 1
   elseif (cmd == "#hubinfo") then
         hubinfo(user)
         return 1
   elseif (cmd == "#showreg") then
         local profiles = GetProfiles()
         local index, profile, index2, username
         local disp = ""
            for index, profile in profiles do
            local line = profile
            disp = disp.."\r\nProfile "..line..":\r\n"
            users = GetUsersByProfile(profile)
               for index2, username in users do
               local line = username
                  if GetItemByName(username) then
                     if (strlen(username) <= 8) then
                     disp = disp.." ? "..line.."\t\t\t~ On-line ~\r\n"
                     else
                     disp = disp.." ? "..line.."\t\t~ On-line ~\r\n"
                     end
                  else
                     if (strlen(username) <= 8) then
                     disp = disp.." ? "..line.."\t\t\t? Off-Line ?\r\n"
                     else
                     disp = disp.." ? "..line.."\t\t? Off-Line ?\r\n"
                     end
                  end
               end
            end
         user:SendPM(BotName, "\r\n\r\n(? ?.??.->        Registered Users        <-.??.???)\r\n"..disp)
         return 1
   elseif (cmd == "#chpass") then
      local _,_,cmd,arg = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
         if arg ~= nil then
         DelRegUser(user.sName)
         AddRegUser(user.sName, arg, user.iProfile)
         user:SendPM(BotName, "Your password has been changed to: "..arg)
         return 1
         end
      end
   elseif (cmd == "#hidden") then
      ShowFile("/Ascii/hidden.txt", user, BotName)
      return 1
   elseif (cmd == "#disclaimer") then
      ShowFile("Disclaimer.txt", user, BotName, "PM")
      return 1
   elseif (cmd == "#coffee") then
      ShowFile ("/Ascii/Cofee.txt", user, BotName)
      return 1
   elseif (cmd == "#boom") then
      ShowFile ("/Ascii/boom.txt", user, BotName)
      return 1
   end
end
--========================================================    OpCommands:    =========================================================--

function OpCommands(user, data, cmd)
   if user.iProfile == 1 or user.iProfile == 0 then
      if (cmd=="+warn") then
      local s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s*(.*)" )
      local victim = GetItemByName(Name)
         if victim ~= nil then
         victim:SendPM(user.sName, "You are being warned because: "..reason)
         SendToAll(BotName, user.sName.." is warning <"..Name.."> because: "..reason)
         return 1
         else
         user:SendData("*** No such nick in the userlist !! ***")
         end
      elseif (cmd=="+disc") then
      local s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s*(.*)" )
      local victim = GetItemByName(Name)
         if victim ~= nil then
            if victim.iProfile ~= 0 then
            victim:SendPM(user.sName, "You are being disconnected because: "..reason)
            SendToWatcher(user.sName.." is disconnecting <"..Name.."> because: "..reason)
            victim:Disconnect()
            return 1
            else
            user:SendData("*** You can't disconnect a Superuser !! ***")
            end
         else
         user:SendData("*** No such nick in the userlist !! ***")
         end
      elseif (cmd=="+kick") then
      local s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s*(.*)" )
      local victim = GetItemByName(Name)
         if victim ~= nil then
            if victim.iProfile ~= 0 then
            victim:SendPM(user.sName, "You are being kicked because: "..reason)
            SendToWatcher(user.sName.." is kicking <"..Name.."> because: "..reason)
               if (MessMode == 2) or (MessMode == 3) then
               user:SendPM(BotName, Name.." IP:  "..victim.sIP)
               else
               user:SendData(BotName, Name.." IP:  "..victim.sIP)
               end
            victim:TempBan()
            return 1
            else
            user:SendData("*** You can't kick a Superuser !! ***")
            end
         else
         user:SendData("*** No such nick in the userlist !! ***")
         end
      elseif (cmd=="+timekick") then
      local s,e,cmd,Name,time,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s*(%S*)%s*(.*)" )
      local victim = GetItemByName(Name)
         if victim ~= nil then
            if time ~= nil then
            local x = time*60
               if victim.iProfile ~= 0 then
               victim:SendPM(user.sName, "You are being kicked because: "..reason..
               "\r\n\r\n If you get unrightfully banned, then pleazze complaint to: "..E_Mail..""..
               "\r\n Be sure to include your IP, Username and why you got banned in the mail."..
               "\r\n You can write the complaint in English or Danish")
               SendToWatcher(user.sName.." is kicking <"..Name.."> for "..time.." hour(s). Because: "..reason)
                  if (MessMode == 2) or (MessMode == 3) then
                  user:SendPM(BotName, Name.." IP:  "..victim.sIP)
                  else
                  user:SendData(BotName, Name.." IP:  "..victim.sIP)
                  end
               victim:TimeBan(x)
               return 1
               else
               user:SendData("*** You can't kick a Superuser !! ***")
               end
            else
            user:SendData("*** +timekick

6Marilyn6Manson6

else
            user:SendData("*** You can't ban a Superuser !! ***")
            end
         else
         user:SendData("*** No such nick in the userlist !! ***")
         end
      elseif (cmd=="+flood") then
      local s,e,cmd,Name,number,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(%S+)%s*(.*)" )
      local victim = GetItemByName(Name)
         if victim ~= nil then
            if victim.iProfile ~= 0 then
               count = number
               for a=1,count do
               victim:SendPM(a, "  "..reason)
               end
            SendToWatcher(user.sName.." is flooding <"..Name.."> with "..count.." PM's because: "..reason)
            return 1
            else
            user:SendData("*** You can't flood a Superuser !! ***")
            end
         else
         user:SendData("*** No such nick in the userlist !! ***")
         end
      elseif (cmd == "+userinfo") then
      local s,e,Name = strfind( data, "%b<>%s+%S+%s+(.+)" )
         UserInfo(user, GetItemByName(Name))
         return 1
      elseif (cmd == "+hubinfo") then
         hubinfo(user)
         return 1
      elseif (cmd == "+advert") then
      local _,_,cmd,message = strfind( data, "%b<>%s+(%S+)%s+(.+)" )
         if message ~= nil then
         advert(message, "MAIN")
         return 1
         end
      elseif (cmd == "+showwatch") then
         function ShowWatch()
         local disp = ""
            for index, value in WatcherArray do
            local line = index
               if GetItemByName(index) then
                  if (strlen(index) <= 8) then
                  disp = disp.." ? "..line.."\t\t\t~ On-line ~\r\n"
                  else
                  disp = disp.." ? "..line.."\t\t~ On-line ~\r\n"
                  end
               else
                  if (strlen(index) <= 8) then
                  disp = disp.." ? "..line.."\t\t\t? Off-Line ?\r\n"
                  else
                  disp = disp.." ? "..line.."\t\t? Off-Line ?\r\n"
                  end
               end
            end
            return disp
         end
         user:SendPM(BotName, "\r\n\r\n(? ?.??.->    Kick & Bans Watchers    <-.??.???)\r\n\r\n"..ShowWatch())
         return 1
      elseif (cmd == "+showreg") then
         local profiles = GetProfiles()
         local index, profile, index2, username
         local disp = ""
            for index, profile in profiles do
            local line = profile
            disp = disp.."\r\nProfile "..line..":\r\n"
            users = GetUsersByProfile(profile)
               for index2, username in users do
               local line = username
                  if GetItemByName(username) then
                     if (strlen(username) <= 8) then
                     disp = disp.." ? "..line.."\t\t\t~ On-line ~\r\n"
                     else
                     disp = disp.." ? "..line.."\t\t~ On-line ~\r\n"
                     end
                  else
                     if (strlen(username) <= 8) then
                     disp = disp.." ? "..line.."\t\t\t? Off-Line ?\r\n"
                     else
                     disp = disp.." ? "..line.."\t\t? Off-Line ?\r\n"
                     end
                  end
               end
            end
         user:SendPM(BotName, "\r\n\r\n(? ?.??.->        Registered Users        <-.??.???)\r\n"..disp)
         return 1
      elseif (cmd == "!!") then
         user:SendPM(BotName, "Your wish is my command !!\r\n")
         return 1
      elseif (cmd == "##") then
         user:SendPM(OpChat, ""..user.sName.." si ? aggiunto all'OpChat ")
         return 1
      elseif (cmd == "+chpass") then
         local _,_,cmd,arg = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
            if arg ~= nil then
            DelRegUser(user.sName)
            AddRegUser(user.sName, arg, user.iProfile)
            user:SendPM(BotName, "Your password has been changed to: "..arg)
            return 1
         end
      elseif (cmd == "+hidden") then
         ShowFile("/Ascii/Hidden.txt", user, BotName)
         return 1
      elseif (cmd == "+disclaimer") then
         ShowFile("Disclaimer.txt", user, BotName, "PM")
         return 1
      elseif (cmd == "+coffee") then
         ShowFile ("/Ascii/Coffee.txt", user, BotName)
         return 1
      elseif (cmd == "+boom") then
         ShowFile ("/Ascii/boom.txt", user, BotName)
         return 1
      end
   end
end

--========================================================    SUCommands:    =========================================================--

function SUCommands(user, data, cmd)
   if user.iProfile == 0 then
      if (cmd == "+massmess") then
      local _,_,cmd,message = strfind( data, "%b<>%s+(%S+)%s+(.+)" )
         if message ~= nil then
         advert(message, "PM")
         return 1
         end
      elseif (cmd == "+addreg") then
      local s,e,cmd,AddName,AddPass,AddLvl = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(%S+)%s+(.+)" )
         if (AddName ~= nil and  AddPass ~= nil and AddLvl ~= nil) then
         AddRegUser(AddName, AddPass, AddLvl)
         SendToOps(AddName, "*** Have been succesfull added as new registered user with level "..AddLvl.." !! ***")
         NewUser=GetItemByName(AddName)
            if NewUser ~= nil then
            NewUser:SendPM(BotName, "Your have been added as registered user with lvl "..AddLvl.." your password is:  "..AddPass.."  Reconnect and use that!!")
            end
         else
         user:SendData(BotName, "*** the command is +addreg ***")
         end
         return 1
      elseif (cmd == "+delreg") then
      local s,e,cmd,RegName = strfind( data, "%b<>%s+(%S+)%s+(.+)" )
         DelRegUser(RegName)
         SendToOps(RegName, "*** Have been succesfull removed !! ***")
         UnRegged=GetItemByName(RegName)
         if UnRegged ~= nil then
         UnRegged:Disconnect()
         end
         return 1
      elseif (cmd == "+chhubname") then
      local _,_,cmd,arg = strfind( data, "%b<>%s+(%S+)%s+(.+)" )
         frmHub:SetHubName(arg)
         SendToOps(BotName, user.sName.."*** changed the hub name to: "..arg.." ***")
         return 1
      elseif (cmd == "+chdesc") then
      local _,_,cmd,arg = strfind( data, "%b<>%s+(%S+)%s+(.+)" )
         frmHub:SetHubDescr(arg)
         SendToOps(BotName, user.sName.."*** changed the hub description to: "..arg.." ***")
         return 1
      elseif (cmd == "+chregserver") then
      local _,_,cmd,arg = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
         frmHub:SetRegServer(arg)
         SendToOps(BotName, user.sName.."*** changed the address for the regserver to: "..arg.." ***")
         return 1
      elseif (cmd == "+chmaxusers") then
      local _,_,arg = strfind( data, "%b<>%s+%S+%s+(%S+)" )
         frmHub:SetMaxUsers(arg)
         SendToOps(BotName, user.sName.."*** changed the maximum number of user connections to: "..arg.." ***")
         return 1
      elseif (cmd == "+chminshare") then
      local _,_,cmd,arg = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
         frmHub:SetMinShare(arg, 3)
         SendToOps(BotName, user.sName.."*** changed the hub Min share to: "..arg.." ***")
         return 1
      elseif (cmd == "+chred") then
      local _,_,cmd,arg = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
         frmHub:SetRedirectAddress(arg)
         SendToOps(BotName, user.sName.."*** changed the hub redirect address to: "..arg.." ***")
         return 1
      elseif (cmd == "+chredfull") then
      local _,_,arg = strfind( data, "%b<>%s+%S+%s+(%S+)" )
         if (arg == "on" or arg == "ON") then
            frmHub:SetRedirectAll(0)
            frmHub:SetRedirectFull(1)
            SendToOps(BotName, user.sName.."*** changed the redirect all new connections when maximum connections reached to: "..arg.." ***")
         elseif (arg == "off" or arg == "OFF") then
            frmHub:SetRedirectFull(0)
            SendToOps(BotName, user.sName.."*** changed the redirect all new connections when maximum connections reached to: "..arg.." ***")
            return 1
         end
      elseif (cmd == "+chredall") then
      local _,_,arg = strfind( data, "%b<>%s+%S+%s+(%S+)" )
         if (arg == "on" or arg == "ON") then
            frmHub:SetRedirectFull(0)
            frmHub:SetRedirectAll(1)
            SendToOps(BotName, user.sName.."*** changed the redirect all new connections to: "..arg.." ***")
            elseif (arg == "off" or arg == "OFF") then
               frmHub:SetRedirectAll(0)
               SendToOps(BotName, user.sName.."*** changed the redirect all new connections to: "..arg.." ***")
               return 1
            else
               user:SendPM(BotName, "You have to use, on or off as an argument. It can't be: "..arg)
         end
      elseif (cmd == "+redirectallnow") then
         SendToOps(BotName, user.sName.."** is redirecting all users to: "..frmHubGetRedirectAddress().." ***")
         SendToAll(BotName, "Redirecting... |$ForceMove "..frmHub:GetRedirectAddress().."|")
         return 1
      elseif (cmd == "+messmode") then
      local _, _, ModeDigit = strfind(data, "%b<>%s+%S+%s+(%d+)")
         if (ModeDigit ~= nil) then
            MessMode = tonumber(ModeDigit)
            if (MessMode == 0) then
               SendToAll(user.sName, "? ? Kick & Ban Messages are shown in chat to all !! ? ?")
               return 1
            elseif (MessMode == 1) then
               SendToAll(user.sName, "? ? Kick & Ban Messages are shown in chat but only to watchers !! ? ?")
               return 1
            elseif (MessMode == 2) then
               SendToAll(user.sName, "? ? Kick & Ban Messages are shown in "..BotName.." to all !! ? ?")
               return 1
            elseif (MessMode == 3) then
               SendToAll(user.sName, "? ? Kick & Ban Messages are shown in "..BotName.." but only to watchers !! ? ?")
               return 1
            else
               user:SendData("< Errorous messmode, messmode set to default >")
               MessMode = DefMessMode
               return 1
            end
         end
      elseif (cmd == "+follow") then
      local s,e,cmd,Follower = strfind( data, "%b<>%s+(%S+)%s+(.*)" )
         if (Follower == nil) then
         Follower = user.sName
         end
         if LogInFollowArray[Follower] == nil then
         LogInFollowArray[Follower] = Follower
         user:SendPM(BotName, Follower.." are now following Log-In Check")
         else
         LogInFollowArray[Follower] = nil
         user:SendPM(BotName, Follower.." are now stopped following Log-In Check")
         end
         return 1
      elseif (cmd == "+showfollow") then
         function ShowFollow()
         local disp = ""
            for index, value in LogInFollowArray do
            local line = index
               if GetItemByName(index) then
                  if (strlen(index) <= 8) then
                  disp = disp.." ? "..line.."\t\t\t~ On-line ~\r\n"
                  else
                  disp = disp.." ? "..line.."\t\t~ On-line ~\r\n"
                  end
               else
                  if (strlen(index) <= 8) then
                  disp = disp.." ? "..line.."\t\t\t? Off-Line ?\r\n"
                  else
                  disp = disp.." ? "..line.."\t\t? Off-Line ?\r\n"
                  end
               end
            end
            return disp
         end
         user:SendPM(BotName, "\r\n\r\n(? ?.??.->    Log-In Check Follower    <-.??.???)\r\n\r\n"..ShowFollow())
         return 1
      elseif (cmd == "+hide") then
      local s,e,cmd,Hide = strfind( data, "%b<>%s+(%S+)%s+(.*)" )
         if (Hide == nil) then
         Hide = user.sName
         end
         frmHub:UnregBot(Hide)
         return 1
      elseif (cmd == "+unhide") then   --  Use with extreme caution and only on Bots !!
      local s,e,cmd,Unhide = strfind( data, "%b<>%s+(%S+)%s+(.+)" )
         frmHub:RegBot(Unhide)
         return 1
      end
   end
end

6Marilyn6Manson6

--=====================================================    Functions Tools:    =======================================================--

function OnTimer()
   SendToAll(TimeText, date(" Oggi ? il %d/%m/%Y e sono le ore %T "))
   SendToAll(TimeText, (" "))
   SendToAll(TimeText, (" *** Lo Staff di Italian Share Planet vi da il Benvenuto e vi augura un felice soggiorno in nostra compagnia!! ;) ***"))
   end

function advert(message, where)
   tosend = ""
   border = strrep ("~", strlen (message)*2/3+2)
   tosend = "\r\n\r\n"..border.."\r\n"..message.."\r\n"..border.."\r\n"
   if (where == "PM") then
      SendPmToAll(BotName, tosend)
   else
      SendToAll(BotName, tosend)
   end
end

function ShowFile(file, to, from, where)
   local text = ""
   local line
   ret, err =  readfrom("txt/"..file)
   if (ret) then
      while 1 do
      line = read()
         if line == nil then
         6Marilyn6Manson6
         end
      text = text..line.."\r\n"
      end
      if (where == "PM")  then
         to:SendPM(from, text)
--      elseif (where == "Main") then
--         to:SendData(from, text)
      else
      to:SendData(from, text)
      end
      readfrom()
   else
   to:SendData("Error","txt/"..file)
   to:SendData("Error",err)
   end
end

function SendToWatcher(msg)
   if ((MessMode > 3) or (MessMode < 0)) then
   MessMode = DefMessMode
   end
   if (MessMode == 0) then
   SendToAll(BotName, msg)
   elseif (MessMode == 1) then
      for index, value in WatcherArray do
      local tempuser=GetItemByName(index)
         if (tempuser~=nil) then
         tempuser:SendData(" ~ "..msg.."|")
         end
      end
   elseif (MessMode == 2) then
      SendPmToAll(BotName, msg)
   elseif (MessMode == 3) then
      for index, value in WatcherArray do
      local tempuser=GetItemByName(index)
         if (tempuser~=nil) then
         tempuser:SendData("$To: "..index.." From: "..BotName.." $ ~  "..msg.."|")
         end
      end
   end
end

function SendToFollow(msg)
   for index, value in LogInFollowArray do
   local tempuser=GetItemByName(index)
      if (tempuser~=nil) then
      tempuser:SendData("$To: "..index.." From: "..BotName.." $ ? "..msg.."|")
      end
   end
end

function SaveToFile(arg,file,table)
   local aString = pickle(table)
   writeto(file)
   write(aString)
   writeto()
end

function LoadFromFile(file)
   readfrom(file)
   local aString = read("*all")
   return  unpickle(aString)
end

----------------------------------------------
-- Pickle.lua
-- An table serialization utility for lua
-- Steve Dekorte, http://www.dekorte.com, Apr 2000
-- Freeware
----------------------------------------------
function pickle(t)
return Pickle:clone():pickle_(t)
end

Pickle = {
clone = function (t) local nt={}; for i, v in t do nt=v end return nt end
}

function Pickle:pickle_(root)
   if type(root) ~= "table" then
   error("can only pickle tables, not ".. type(root).."s")
   end
   self._tableToRef = {}
   self._refToTable = {}
   local savecount = 0
   self:ref_(root)
   local s = ""
   while getn(self._refToTable) > savecount do
   savecount = savecount + 1
   local t = self._refToTable[savecount]
   s = s.."{\n"
      for i, v in t do
      s = format("%s[%s]=%s,\n", s, self:value_(i), self:value_(v))
      end
   s = s.."},\n"
   end
return format("{%s}", s)
end

function Pickle:value_(v)
local vtype = type(v)
   if vtype == "string" then return format("%q", v)
   elseif vtype == "number" then return v
   elseif vtype == "table" then return "{"..self:ref_(v).."}"
   else --error("pickle a "..type(v).." is not supported")
   end  
end

function Pickle:ref_(t)
local ref = self._tableToRef[t]
   if not ref then
      if t == self then error("can't pickle the pickle class") end
   tinsert(self._refToTable, t)
   ref = getn(self._refToTable)
   self._tableToRef[t] = ref
   end
return ref
end

----------------------------------------------
-- unpickle
----------------------------------------------

function unpickle(s)
   if type(s) ~= "string" then
   error("can't unpickle a "..type(s)..", only strings")
   end
   local tables = dostring("return "..s)
   for tnum = 1, getn(tables) do
   local t = tables[tnum]
   local tcopy = {}; for i, v in t do tcopy = v end
      for i, v in tcopy do
      local ni, nv
         if type(i) == "table" then ni = tables[i[1]] else ni = i end
         if type(v) == "table" then nv = tables[v[1]] else nv = v end
      t[ni] = nv
      end
   end
return tables[1]
end

--=======================================================     Functions:     =========================================================--

--// This function is fired when a new user finishes the login
function CheckMyInfo( user, myinfo )
   if RedirectOnFailed then
      user.FailedLogin = function( o )
         local addr = frmHub:GetRedirectAddress()
         local warning = gsub( "You are being redirected to [H]", "%[H%]", addr, 1 )
         WarnMess = gsub( "has been redirected to {[H]} Because:", "%[H%]", addr, 1 )
         o:SendPM( BotName, warning )
         o:SendData( "$ForceMove "..addr )
            if useTempBan then
            o:TempBan()
            else
            o:Disconnect()
            end
      end
   else
      if useTempBan then
      user.FailedLogin = user.TempBan
      WarnMess = "has been TempBanned because:"
      else
      user.FailedLogin = user.Disconnect
      WarnMess = "has been Disconnected because:"
      end
   end
   --// get needed info from string
   local ret,c,V,M,H,S,O,speed,share = strfind( myinfo,
      --     V:0123    M:P|A H:0-99    S:0-99    O:0-99      speed         share
      "<%+%+ V:([^,]+),M:(.),H:([^,]+),S:([^,]+),O:([^,>]+).*>$ $([^$]*)%$[^$]*%$(%d+)%$$" )   -- dc++, with O
   if not ret then
      ret,c,V,M,H,S,speed,share = strfind( myinfo,
      --     V:0123    M:P|A H:0-99    S:0-99        speed          share
      "<%+%+ V:([^,]+),M:(.),H:([^,]+),S:([^,>]+).*>$ $([^$]*)%$[^$]*%$(%d+)%$$" )   -- dc++, without O
   end
   if not ret then
      ret,c,share = strfind( myinfo,
      -- share
      "%$(%d+)%$$" )   -- nmdc/other, non <++ V:
   end
   if not ret then
      user:SendPM( BotName, "We couldn't parse your MyINFO string. Get the steppin" )
      user:FailedLogin()
      SendToFollow("<"..user.sName.."> "..WarnMess.." he's info seemed to be messed up!")
      return
   end
   --// fix new DC024 H:x/y/z notation
   if H then
      local Hn = {0}   -- crappy-ass lua4 workaround
      gsub( H, "(%d+)", function( x ) %Hn[1] = %Hn[1] + tonumber( x ) end, hubCheckMethod )
      H = Hn[1]
   end
   --// fix slots while we're at it, no need for multiple tonumber()'s
   if S then
      S = tonumber( S )
   end
   local userShare = tonumber(share)
   local minShare = tonumber(frmHub:GetMinShare()*1024*1024)
   local minShareGB = (frmHub:GetMinShare()/1024)
   local userShareGB = format("%0.2f", tonumber(share)/1024/1024/1024)
   --// check for NMDC / Version / Share / MaxSlots / MaxHubs / MinSlots / MinSlotsPrHub
   if not V and disallowNmdc then
      user:SendPM( BotName, "We don't like crappy old software, go download a new DC++ at http://dcplusplus.sourceforge.net/ or oDC at http://gempond.com/odc/" )
      user:FailedLogin()
      SendToFollow("<"..user.sName.."> "..WarnMess.." Neo-Modus Direct Connect Client! or DC++ without string!")
      return
   elseif V and minVersion then
      local n = tonumber( V )
      if not n then
         SendPmToOps( BotName, "warning, couldn't parse version V:"..V.." for user <"..user.sName.."> -- "..
                           "skipping version check" )
      elseif n < minVersion then
         local warning = gsub( "The ++ version you are using is too old. Minimum is [V]", "%[V%]", tostring( minVersion ), 1 )
         user:SendPM( BotName, warning )
         user:FailedLogin()
         SendToFollow("<"..user.sName.."> "..WarnMess.." ++ Version ["..n.."] - { minimum version ["..minVersion.."] }")
         return
      end
   elseif userShare < minShare then
      user:SendPM(BotName, "You have not met the minimum share size of "..minShareGB.." GB You have ("..userShareGB..") GB")
      user:FailedLogin()
      SendToFollow("<"..user.sName.."> "..WarnMess.." ("..userShareGB..") GB shared! - { Minimum ("..minShareGB..") GB Share. }")
      return
   elseif H and S then
      if maxSlots and S > maxSlots then
      user:SendPM(BotName, "You have to many slots opent plz close some! Maximum slots ("..maxSlots..") You have ("..S..") Slots")
      user:FailedLogin()
      SendToFollow("<"..user.sName.."> "..WarnMess.." ("..S..") Slots opent! - { Maximum ("..maxSlots..") Slots. }")
      return
      elseif maxHubs and H > maxHubs then
      user:SendPM(BotName, "You are on to many hubs plz close some! Maximum hubs ["..maxHubs.."] You are on ["..H.."] Hubs")
      user:FailedLogin()
      SendToFollow("<"..user.sName.."> "..WarnMess.." ("..H..") Hubs opent! - { Maximum ["..maxHubs.."] Hubs. }")
      return
      elseif minSlotsPerHub and S < ( H * minSlotsPerHub )+ExtraSlots then
      user:SendPM(BotName, "You have not met the minimum slots/hubs inhere Minimum slots/hubs ("..(minSlotsPerHub*H)+ExtraSlots.."/"..H..") You have ("..S.."/"..H..") Slots/Hubs")
      user:FailedLogin()
      SendToFollow("<"..user.sName.."> "..WarnMess.." ("..S.."/"..H..") Slots/Hubs! - { Minimum ("..(minSlotsPerHub*H)+ExtraSlots.."/"..H..") Slots/Hubs. }")
      return
      elseif minSlots and S < minSlots then
      user:SendPM(BotName, "You have not met the minimum slots inhere! Minimum slots ("..minSlots..") You have ("..S..") Slots")
      user:FailedLogin()
      SendToFollow("<"..user.sName.."> "..WarnMess.." ("..S..") Slots opent! - { Minimum ("..minSlots..") Slots. }")
      return
      end
   end
   --// Connection Speed vs Slots.
   if speed and SlotsVsSpeedCheck then
   local speed = strsub(speed,1,strlen(speed)-1)
      if SlotsVsSpeed[speed] and S > SlotsVsSpeed[speed] then
      user:SendPM(BotName, "You have to many slots open for your connection! Maximum slots ("..SlotsVsSpeed[speed]..") You have ("..S..") Slots")
      user:FailedLogin()
      SendToFollow("<"..user.sName.."> "..WarnMess.." ["..speed.."] with ("..S..") Slots! - { Maximum ("..SlotsVsSpeed[speed]..") Slots. }")
      end
   end
end

6Marilyn6Manson6

function hubinfo(user)
   local TotalUpTimeInSec = clock()
   local s, e, hours = strfind(tostring(TotalUpTimeInSec/3600), "(%d+)")
   local s, e, minutes = strfind(tostring((TotalUpTimeInSec-(tonumber(hours)*3600))/60), "(%d+)")
   local CurrentShare = format("%0.2f", tonumber(frmHub:GetCurrentShareAmount())/1024/1024/1024/1024)
   local disp = "\r\n\r\n"
   disp = disp.."\t"..ScriptRestart.." \r\n"
   disp = disp.."\t\t\t\t       ? ? Current uptime is: "..hours.." hours and "..minutes.." minutes ? ? \r\n\r\n"
   disp = disp.."Hubname is: "..frmHub:GetHubName().."\r\n"
--   disp = disp.."Hubaddress is: "..frmHub:GetHubAddress().."\r\n"
   disp = disp.."Hubdescription is: "..frmHub:GetHubDescr().."\r\n"
   disp = disp.."The hub is registering at: "..frmHub:GetRegServer().."\r\n"
   disp = disp.."Users online / max is: "..frmHub:GetUsersCount().." / "..frmHub:GetMaxUsers().."\r\n"
   disp = disp.."Current Share: "..CurrentShare.." Terabyte\r\n\r\n"
      if CheckingEnabled then
      disp = disp.."Scriptet Log-In Check is: ON\r\n"
      else
      disp = disp.."Scriptet Log-In Check is: OFF\r\n"
      end
   disp = disp.."Bypass Scriptet Log-In Check level is: "..SetCheckLvl.." and above. (0 = Master / 1 = Operator / 2 = VIP / 3 = Reg)\r\n"
   disp = disp.."++ version hub check is: "..hubCheckMethod.."  (1=x, 2=x/y, 3=x/y/z (x=normal / y=registered / z=operator))\r\n"
      if disallowNmdc then
      disp = disp.."Neo-Modus Direct Connect Client allowed inhere: NO\r\n"
      else
      disp = disp.."Neo-Modus Direct Connect Client allowed inhere: YES\r\n"
      end
      if minVersion then
      disp = disp.."Minimum ++ version is: "..minVersion.."\r\n"
      else
      disp = disp.."Minimum ++ version is: OFF\r\n"
      end
   disp = disp.."The minimum share is: "..(frmHub:GetMinShare()/1024).." Gb\r\n"
      if minSlots then disp = disp.."The minimum slots is: "..minSlots.."\r\n" end
      if minSlotsPerHub then disp = disp.."The slot/hub limit is: "..minSlotsPerHub.."\r\n" end
--   disp = disp.."Extra slots for this hub: "..ExtraSlots.."\r\n"
      if SlotsVsSpeedCheck then
      disp = disp.."The maximum slots is: [28.8Kbps] = "..SlotsVsSpeed["28.8Kbps"].." ~ [33.6Kbps] = "..SlotsVsSpeed["33.6Kbps"].." ~ [56Kbps] = "..SlotsVsSpeed["56Kbps"].." ~ [ISDN] = "..SlotsVsSpeed["ISDN"].." ~ [Satellite] = "..SlotsVsSpeed["Satellite"].." ~ [Cable] = "..SlotsVsSpeed["Cable"].." ~ [DSL] = "..SlotsVsSpeed["DSL"].." ~ [LAN(T1)] = "..SlotsVsSpeed["LAN(T1)"].." ~ [LAN(T3)] = "..SlotsVsSpeed["LAN(T3)"].."\r\n"
      else
      if maxSlots then disp = disp.."The maximum slots is: "..maxSlots.."\r\n" end
      end
      if maxHubs then disp = disp.."The maximum hub is: "..maxHubs.."\r\n" end
   disp = disp.."Redirectaddress = "..frmHub:GetRedirectAddress().."\r\n"
      if (frmHub:GetRedirectAll() == 0) then
         disp = disp.."Redirect all is: OFF\r\n"
      else
         disp = disp.."Redirect all is: ON\r\n"
      end
      if (frmHub:GetRedirectFull() == 0) then
         disp = disp.."Redirect if hub is full is: OFF\r\n"
      else
         disp = disp.."Redirect if hub is full is: ON\r\n"
      end
      if not RedirectOnFailed then
         disp = disp.."Redirect on Scriptet Log-In Check is: OFF\r\n"
      else
         disp = disp.."Redirect on Scriptet Log-In Check is: ON\r\n"
      end
      if useTempBan then
      disp = disp.."TempBan users on Log-In Check mismatch: ON\r\n\r\n"
      else
      disp = disp.."TempBan users on Log-In Check mismatch: OFF\r\n\r\n"
      end
   disp = disp.."Time text there is shown on time is: "..TimeText.."\r\n"
   disp = disp.."Time text is shown every: "..ShowTimeText.." minuts.\r\n"
   disp = disp.."E-Mail to show in +kill text is: "..E_Mail.."\r\n\r\n"
      if (MessMode == 0) then
         disp = disp.."? ? Kick & Ban Messages are shown in chat to all ? ? \r\n"
      elseif (MessMode == 1) then
         disp = disp.."? ? Kick & Ban Messages are shown in chat but only to watchers ? ? \r\n"
      elseif (MessMode == 2) then
         disp = disp.."? ? Kick & Ban Messages are shown in "..BotName.." to all ? ? \r\n"
      elseif (MessMode == 3) then
         disp = disp.."? ? Kick & Ban Messages are shown in "..BotName.." but only to watchers ? ? \r\n"
      end
   user:SendPM(BotName, disp)
end

function ParseMyInfoString(data)
local user = (Name)
s,e,description,speed,email,share = strfind(data, "$MyINFO $ALL ([^$]+)$ $([^$]*)$([^$]*)$([^$]+)")
speed = strsub(speed,1,strlen(speed)-1)
return description,speed,email,share
end

function ParseDCPPDescription(description)
local user = (Name)
_,b, dcver = strfind(description,"V:(%x.%x+)")
_,b, slots = strfind(description,"S:(%d+)")
_,b, hubs = strfind(description,"H:(%d+)")
_,b, bs = strfind(description,"B:(%x+)")
slots=tonumber(slots)
hubs=tonumber(hubs)
return dcver, slots, hubs, bs
end

function UserInfo (user,Name)
local victim = (Name)
   if victim ~= nil then
   local description,speed,email,share=ParseMyInfoString(victim.sMyInfoString)
   local dcver, slots, hubs, bs=ParseDCPPDescription(description)
   local ShownShare = format("%0.2f", tonumber(share)/1024/1024/1024)
      if dcver ~= nil and slots ~= nil and hubs ~= nil then
      local disp = "\r\n\r\n"
      disp = disp.."Userinfo for: "..victim.sName.."\r\n\r\n"
      disp = disp.." ? Description\t"..description.."\r\n"
      disp = disp.." ? Client version\t"..dcver.."\r\n"
      disp = disp.." ? Connected hubs\t"..hubs.." (at least)\r\n"
      disp = disp.." ? E-Mail\t"..email.."\r\n"
      disp = disp.." ? Opent slots\t"..slots.."\r\n"
      disp = disp.." ? Connection\t"..speed.."\r\n"
      disp = disp.." ? Shown Share\t"..ShownShare.." GigaBytes\r\n"
      disp = disp.." ? True Share\t"..share.." Bytes\r\n"
      disp = disp.." ? Currently used IP:\t"..victim.sIP.." \r\n\r\n"
         if GetItemByName(victim.sName) then
      disp = disp.."The user is currently Online\r\n"
         else
      disp = disp.."The User is currently Offline\r\n"
         end
      user:SendPM(BotName, disp)
      else
      local disp = "\r\n\r\n"
      disp = disp.."Userinfo for: "..victim.sName.."\r\n\r\n"
      disp = disp.." ? DC Version:\tNeo-Modus (NMDC)\r\n"
      disp = disp.." ? Connection\t"..speed.."\r\n"
      disp = disp.." ? Shown Share\t"..ShownShare.." GigaBytes\r\n"
      disp = disp.." ? True Share\t"..share.." Bytes\r\n"
      disp = disp.." ? Currently used IP:\t"..victim.sIP.." \r\n\r\n"
         if GetItemByName(victim.sName) then
      disp = disp.."The user is currently Online\r\n"
         else
      disp = disp.."The User is currently Offline\r\n"
         end
      user:SendPM(BotName, disp)
      end
   end
end

--==========================================    OPs/SUs/VIPs/USERs Connect and Disconnect.    =========================================--

function OpConnected(user)
   if user.iProfile == 1 then
      if user.sName=="[BOT]-AntiFaker" then
         SendToAll(frmHub:GetHubName(),"? Faker, Tremate !! Il " ..user.sName.. " ? venuto a prendervi!! ?")
      else SendToAll(frmHub:GetHubName(), "l'Operatore  "..user.sName.." ? entrato nell'Hub")
      end
   elseif user.iProfile == 0 then
      if user.sName=="6Marilyn6Manson6" then
         SendToAll(frmHub:GetHubName(),"?" ..user.sName.. " ? entrato nell'Hub!! ?")
      elseif user.sName=="6Marilyn6Manson6" then
         SendToAll(frmHub:GetHubName(),"? Tremate mortali ... "..user.sName.." ? entrato nell'Hub!")
      else SendToAll(frmHub:GetHubName(), "?"..user.sName.."  ? entrato nell'Hub!")
      end
   if user.iProfile == 0 then
      if (strlen(user.sName) <= 8) then
         OpsArray[user.sName]=date("  Il nostro mitico Amministratore\t"..user.sName.."\t\t~~\t? connesso dal:\t~~\t %d/%m/%Y alle %T")
      else
         OpsArray[user.sName]=date("  Il nostro mitico Amministratore\t"..user.sName.."\t~~\t? connesso dal:\t~~\t %d/%m/%Y alle %T")
      end
   SaveToFile(user.sName,OpsFile,OpsArray)
   elseif user.iProfile == 1 then
      if (strlen(user.sName) <= 8) then
         OpsArray[user.sName]=date("  L'Operatore\t"..user.sName.."\t\t~~\t? connesso dal:\t~~\t %d/%m/%Y alle %T")
      else
         OpsArray[user.sName]=date("  L'Operatore\t"..user.sName.."\t~~\t? connesso dal:\t~~\t %d/%m/%Y alle %T")
      end
   SaveToFile(user.sName,OpsFile,OpsArray)
   end
user:SendData(BotNameInfo)
user:SendData(OpChatInfo)
user:SendData(PmToOpsInfo)
user:SendData(DevBotInfo)
end
end
function OpDisconnected(user)
   if user.iProfile == 0 then
      if user.sName=="6Marilyn6Manson6" then
         SendToAll(frmHub:GetHubName(), "? "..user.sName.." si ? disconnesso!?")
      elseif user.sName=="6Marilyn6Manson6" then
         SendToAll(frmHub:GetHubName(), "? Il nostro Admin "..user.sName.." ? uscito dall'Hub!")
      else SendToAll(frmHub:GetHubName(), "Il nostro Amministratore "..user.sName.."  ? uscito dall'Hub")
      end
   elseif user.iProfile == 1 then
      SendToAll(frmHub:GetHubName(), "L'Operatore  "..user.sName.."  si ? disconnesso! :(")
   end
   if user.iProfile == 0 then
      if (strlen(user.sName) <= 8) then
         OpsArray[user.sName]=date("  Il nostro mitico Amministratore\t"..user.sName.."\t\t~~\t? offline - L'ultima volte che l'abbiamo visto ? stato il:\t~~\t %d/%m %Y alle %T")
      else
         OpsArray[user.sName]=date("  Il nostro mitico Amministratore\t"..user.sName.."\t~~\t? offline - L'ultima volte che l'abbiamo visto ? stato il:\t~~\t %d/%m/Y alle %T")
      end
   SaveToFile(user.sName,OpsFile,OpsArray)
   elseif user.iProfile == 1 then
      if (strlen(user.sName) <=8) then
         OpsArray[user.sName]=date("  L'Operatore\t"..user.sName.."\t\t~~\t? Offline - L'ultima volte che l'abbiamo visto ? stato il:\t~~\t %d/%m/%Y alle %T")
      else
         OpsArray[user.sName]=date("  L'Operatore\t"..user.sName.."\t~~\tIs Offline - L'ultima volte che l'abbiamo visto ? stato il:\t~~\t %d/%m/%Y alle %T")
      end
--**************************1250*********************************--
   SaveToFile(user.sName,OpsFile,OpsArray)
   end
end

function NewUserConnected(user)
   local description,speed,email,share=ParseMyInfoString(user.sMyInfoString)
   local Share = format("%0.2f", tonumber(share)/1024/1024/1024)
--   ShowFile("rules.txt", user, BotName)
   user:SendData("<"..frmHub:GetHubName()..">Benvenuto su "..frmHub:GetHubName().." !! :) \r\n Il minimo di share qui ? di "..(frmHub:GetMinShare()/1024).." Gb. Te stai sharando "..Share.." Gb!\r\n\r\n\t     *** Per conoscere i comandi disponibili, digita +Help ***\r\n *** Se hai bisogno di aiuto, chiama un OP. Lui certamente sapr? aiutarti! ;) ***")
   if user.iProfile == 2 then
      if user.sName=="[V??]-G??zZ?" then
         SendToAll(frmHub:GetHubName(),"? Il Vip " ..user.sName.. " ci degna della sua presenza!! ?")
      elseif user.sName=="[V??]-VDV" then
         SendToAll(frmHub:GetHubName(),"? Abbiamo l'onore di avere con noi il nostro caro VIP "..user.sName.." ?")
      else SendToAll(frmHub:GetHubName(), "Il nostro caro Vip  "..user.sName.."  ? entrato nell'hub!!")
      end
   elseif user.iProfile == 3 then
      SendToAll(frmHub:GetHubName(), "Il Reg "..user.sName.." ? entrato nell'hub!")
   elseif user.iProfile == 4 then
      SendToAll(frmHub:GetHubName(), "Il Nostro Caro Super VIP "..user.sName.." ? venuto a farci compagnia!! :)")
   if (user.iProfile < 0 or user.iProfile > SetCheckLvl) then
      for key,checkWord in forbiddenWords do
      if strfind(user.sMyInfoString, checkWord, 1, 1) then
         SendToNick(user.sName, "<" ..BotName .."> Te hai questo segno ("..checkWord..") nel nick. Questo segno non ? accettato dall'hub. Rimuovilo e riconnettiti.")
         SendToNick(user.sName, "<" ..BotName .."> Disconnettendo...")
         SendToFollow("<"..user.sName.."> has been disconnected because: ("..checkWord..") In his nick!")
         user:Disconnect()
      end
   end
end
end
function UserDisconnected(user)
   if user.iProfile == 2 then
      SendToAll(frmHub:GetHubName(), "Il nostro caro Vip "..user.sName.."  si ? disconnesso!!")
   elseif user.iProfile == 3 then --else
      SendToAll(frmHub:GetHubName(), "Il Reg "..user.sName.." ? uscito dall'hub!")
   elseif user.iProfile == 4 then
      SendToAll(frmHub:GetHubName(), " Il Nostro Caro SuperVIP "..user.sName.." ci ha lasciato!! :( ")
   end

user:SendData(BotNameInfo)
user:SendData(OpChatInfo)
user:SendData(PmToOpsInfo)
user:SendData(DevBotInfo)
end
end

6Marilyn6Manson6

--============================================    Help files for alm. users / Ops / SUs    ============================================--

function AlmHelp (user)
   local disp = "\r\n\r\n"
   disp = disp.."Comandi degli utenti:\r\n\r\n"
   disp = disp.."   +help         -   Visualizza questo aiuto!!\r\n"
   disp = disp.."   +rules          -   Visualizza le regole\r\n"
   disp = disp.."   +faq         -   Visualizza le domande frequenti\r\n"
   disp = disp.."   +disclaimer      -   Visualizza il disclaimer\r\n"
   disp = disp.."   +network      -   Visualizza il network\r\n"
   disp = disp.."   +watch         -   Guarda chi viene kickato/bannato o disabilita questa funzione\r\n"
   disp = disp.."   +showreg      -   Visualizza gli utenti registrati dell'hub \r\n"
   disp = disp.."   We will get yours PM in ours "..OpChat.." and take care of the problem\r\n\r\n"
   user:SendData(BotName, disp)
end

function OpHelp (user)
   local disp = "\r\n\r\n"
   disp = disp.."Comandi degli OPeratori:\r\n\r\n"
   disp = disp.."   !help               -   Visualizza i comandi dello Ptokax!!\r\n"
   disp = disp.."   +help               -   Visualizza questo aiuto!!\r\n"
   disp = disp.."   +hubinfo            -   Visualizza le informazioni dell'hub\r\n"
   disp = disp.."   +showwatch            -   Visualizza chi vede i messaggi dei Kick/Ban\r\n"
   disp = disp.."   +userinfo             -   Visualizza alcune informazioni di un utente\r\n"
   disp = disp.."   +advert             -   Manda un messaggio a tutti in main chat\r\n"
   disp = disp.."   +warn          -   Avverte un utente \r\n"
   disp = disp.."   +disc          -   Disconnette un utente\r\n"
   disp = disp.."   +kick          -   Kicka un user e lo aggiunge ai ban temporanei\r\n"
   disp = disp.."   +timekick

Herodes

Long script that one :)
I check it for sure .. hehe

keep it up Manson ...

Typhoon

#7
btw why take credit for the whole script when you just modded it, some there and somthing there,,,

that script is by [aXs]?Wellx and i named IceGuard !
find it on plops page under Wellx !
just look at the 1.88 version

this is one reason of why he compiled all other versions of IceGuard !


just my cents ..

***Typhoon?



Corayzon

yo Typhoon?,

i thought the intention of releasing public open source scripts, was for other ppl to use, change and learn from.
Who cares who wrote what:- cause in the end, ppl know their scripts and can just say, look ive had an influence on someone.

dont mean to be havin a go, but let the real writer complain if he wishs to:- and any ppl that do, should complile their scripts so ppl cant use them :S

give and let learn

6Marilyn6Manson6

This is script is IceGuard 1.88 in italian version.. click

Typhoon

QuoteOriginally posted by Corayzon
yo Typhoon?,

i thought the intention of releasing public open source scripts, was for other ppl to use, change and learn from.
Who cares who wrote what:- cause in the end, ppl know their scripts and can just say, look ive had an influence on someone.

dont mean to be havin a go, but let the real writer complain if he wishs to:- and any ppl that do, should complile their scripts so ppl cant use them :S

give and let learn

He would have written the same as I , but since he quit lua for that reason an some others he sadly cant write inhere,,,

i just stated my point , give credits where its supposed to be... nothing else... i have build my first script from the 1.88, an i got the 1,97 version from Wellx when he quit the forum and build on that to...
nothing wrong when building from other scripts, just remember the credits...  not very fun to see some other dude taking credits for the whole script when changing " SendToAll " into " user:SendData " ...
you get my point !  

*** Typhoon?



SMF spam blocked by CleanTalk