Console# 0.05 by [NL]Pur - converting
 

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

Console# 0.05 by [NL]Pur - converting

Started by Ubikk, 22 May, 2005, 21:30:15

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ubikk

Hello again. I need some help converting this script to LUA 5

Part I:

Quote
-- Console# 0.05 by [NL]Pur  see -= history.txt =- for details


--- 31 Aug 2003 Changes by [NL]Pur
--- Changed Commands, they all have now ! before them
--- Neater !help for all profiles different
--- Changed so all profiles (Master, Operators, Vip, Reg, Guest) have their own commands

-- option warn script
warningfile="warned.dat"
Version="Console# v0.05 by [NL]Pur"

max = 3 -- number of warnings before kick
warnings={}
c={[1]="1st", [2]="2nd"}

-- options slot script
tmrSlots = 5 -- Number of seconds waiting for replys
tabSlots = {n=0}
Command = "!slots"
badshare="on"
slotschk="on"
msgenter="on"

Connection={}

Connection["LAN(T1)"] = "1/30/50"
Connection["LAN(T3)"] = "1/30/50"

function Main()

assert(dofile("settings.ini"))

frmHub:RegBot(bot)
LoadWarn()
SetTimer(tmrSlots*1000)
StartTimer()


end

function OnTimer()
   local i = 1 while tabSlots do
      local table = tabSlots
      if clock() >= table.iClock + tmrSlots then
         if table.tItems.n == 0 then SendPmToNick(table.sName, bot, "No users with free slots found|") end
         SendPmToNick(table.sName, bot, "Done|")
         tremove(tabSlots, i)
         if tabSlots.n == 0 then frmHub:EnableSearchData(0) end
      else i = i + 1 end
   end
end

function NewUserConnected(curUser)
warnings[curUser.sName]=0
EnterHub(curUser)
end

function OpConnected(curUser)
EnterHub(curUser)
end

function DataArrival(user,data)

   local ddata=strsub(data,1,strlen(data)-1)
   s,e,cmd = strfind(ddata,"%b<>%s+(%S+)")
   s,e,arg = strfind(ddata,"%b<>%s+%S+%s+(%S+)")
   s,e,arg2 = strfind(ddata,"%b<>%s+%S+%s+%S+%s(.+)")

if strfind(data, "^%$SR") then slotsOnHub(user, data) end  
        

if (OPPRO==1) then
local s, e, protected = strfind(data, "^$Kick (%S+)|$")
   if s then
      local usr = GetItemByName(protected)
   if usr and usr.bOperator then
         user:SendData(Bot, "Don't be an idiot and try and kick ops, if you try it again you will be deoped!!!")
         user:Disconnect()
      SendToAll("ILLEGAL KICK", "LoOoL some stupid silly pillock tried to kick "..protected.." , what a stupid silly nutter, goodbye!!!")
      return 1
   end
end

end


if (strsub(data, 1,6) == "$Kick ") then
      if (blockedkick == 1) then
                  return 1
           end
   elseif (strsub(data, 1,12) == "$OpForceMove ") then
      if (blockedOpForceMove == 1) then
                  return 1
           end
   elseif (strsub(data, 1,7) == "$Search ") then
      if (blockedSearch == 1) then
                  return 1
           end
   elseif (strsub(data, 1,12) == "$MultiSearch ") then
      if (blockedMultiSearch == 1) then
                  return 1
           end
   elseif (strsub(data, 1,4) == "$To ") then
      if (blockedTo == 1) then
                  return 1
           end
   elseif (strsub(data, 1,13) == "$ConnectToMe ") then
      if (blockedConnectToMe == 1) then
                  return 1
           end
   elseif (strsub(data, 1,16) == "$MultiConnectToMe ") then
      if (blockedMultiConnectToMe == 1) then
                  return 1
           end
   elseif (strsub(data, 1,14) == "$RevConnectToMe ") then
      if (blockedRevConnectToMe == 1) then
                  return 1
           end
   elseif (strsub(data, 1,4) == "$SR ") then
      if (blockedSR == 1) then
                  return 1
           end
   end
--
-- C O M M A N D S --------------------------------------------------------------------------------------
--

if (user.iProfile == 0) then                        -- 0 Master

 if (cmd=="!sethubname") then
      frmHub:SetHubName(arg)
      user:SendPM(bot, "Hubname is now set to: "..arg)
       elseif (cmd=="!sethubdescription") then
      frmHub:SetHubDescr(string)
      user:SendPM(bot, "Hub Description is now set to: "..arg)
       elseif (cmd=="!setredirectadress") then
      frmHub:SetRedirectAddress(string)
      user:SendPM(bot, "Hub Redirect adress is now set to: "..arg)
       elseif (cmd=="!setredirectall") then
      if (arg=="1") then
                  frmHub:SetRedirectAll(tonumber(arg))
            user:SendPM(bot, "Setredirectall is now set too: ON")
      elseif(arg=="0") then
        frmHub:SetRedirectAll(tonumber(arg))
        user:SendPM(bot, "Setredirectall is now set too: OFF")
                else
        user:SendPM(bot, "You entered a invalid value for setredirectall property. ")
      end
            elseif (cmd=="!setredirectfull") then
                if (arg=="1") then
                  frmHub:SetRedirectFull(tonumber(arg))
        user:SendPM(bot, "SetredirectFull is now set too: ON ")
      elseif (arg=="0") then
        frmHub:SetRedirectFull(tonumber(arg))
        user:SendPM(bot, "SetredirectFull is now set too: OFF ")
      else
        user:SendPM(bot, "You entered a invalid value for setredirectfull property. ")
      end
       elseif (cmd=="!setregserver") then
      frmHub:SetRegServer(arg)
      user:SendPM(bot, "Registerserver is now set too: "..arg)
       elseif (cmd=="!autoregister") then
      if (arg=="1") then
        frmHub:SetAutoRegister(tonumber(arg))
        user:SendPM(bot, "SetAutoRegister is now set: ON")
      elseif (arg=="0") then
        frmHub:SetAutoRegister(tonumber(arg))
        user:SendPM(bot, "SetAutoRegister is now set: OFF")
      else
        user:SendPM(bot, "You entered a invalid value for setautoregister property. ")
      end
        elseif (cmd=="!setmaxusers") then
       if (tonumber(arg) > 0) and (tonumber(arg) < 2001) then
        frmHub:SetMaxUsers(tonumber(arg))
        user:SendPM(bot, "Maximum users now set too: "..arg)
       else
        user:SendPM(bot, "You must enter a value between 0 and 2001 ")
       end
        elseif (cmd=="!delreguser") then
            if arg then
        tmp = GetItemByName(arg)
        DelRegUser(tmp)
            end
        elseif (cmd=="!removeprofile") then
            if arg then
                   ret = RemoveProfile(arg)
                   if (ret==0) then
                     user:SendPM(bot, "Profile doesn't exist. ")
                   elseif (ret==1) then
                user:SendPM(bot, "Profile is removed with success. ")
              elseif (ret==-1) then
           user:SendPM(bot, "Profile is in use, can't be removed. ")
              else
                user:SendPM(bot, "There is unknown value returned. ")
                   end
            end
       
         elseif (cmd=="!blockopforcemove") then
           if (arg == "1") then
                   blockedOpForceMove = 1
         user:SendPM(bot, "The $OpForceMove is now blocked.")
           elseif (arg == "0") then
              blockedOpForceMove = 0
         user:SendPM(bot, "The $OpForceMove is now unblocked.")
                else
                   user:SendPM(bot, "invalid value")
                end
         elseif (cmd=="!blockkick") then
           if (arg == "1") then
                   blockedkick = 1
         user:SendPM(bot, "The $Kick is now blocked.")
           elseif (arg == "0") then
              blockedkick = 0
         user:SendPM(bot, "The $Kick is now unblocked.")
                else
                   user:SendPM(bot, "invalid value")
                end
         elseif (cmd=="!blocksearch") then
           if (arg == "1") then
                   blockedSearch = 1
         user:SendPM(bot, "The $Search is now blocked.")
           elseif (arg == "0") then
              blockedSearch = 0
         user:SendPM(bot, "The $Search is now unblocked.")
                else
                   user:SendPM(bot, "invalid value")
                end              
         elseif (cmd=="!blockmultisearch") then
           if (arg == "1") then
                   blockedMultiSearch = 1
         user:SendPM(bot, "The $MultiSearch is now blocked.")
           elseif (arg == "0") then
              blockedMultiSearch = 0
         user:SendPM(bot, "The $MultiSearch is now unblocked.")
                else
                   user:SendPM(bot, "invalid value")
                end
         elseif (cmd=="!blockto") then
           if (arg == "1") then
                   blockedTo = 1
         user:SendPM(bot, "The $To is now blocked.")
           elseif (arg == "0") then
              blockedTo = 0
         user:SendPM(bot, "The $To is now unblocked.")
                else
                   user:SendPM(bot, "invalid value")
                end
         elseif (cmd=="!blockconnecttome") then
           if (arg == "1") then
                   ConnectToMe = 1
         user:SendPM(bot, "The $connecttome is now blocked.")
           elseif (arg == "0") then
              ConnectToMe = 0
         user:SendPM(bot, "The $connecttome is now unblocked.")
                else
                   user:SendPM(bot, "invalid value")
                end
         elseif (cmd=="!blockmulticonnecttome") then
           if (arg == "1") then
                   blockedMultiConnectToMe = 1
         user:SendPM(bot, "The $MultiConnectToMe is now blocked.")
           elseif (arg == "0") then
              blockedMultiConnectToMe = 0
         user:SendPM(bot, "The $MultiConnectToMe is now unblocked.")
                else
                   user:SendPM(bot, "invalid value")
                end          
         elseif (cmd=="!blockrevconnecttome") then
           if (arg == "1") then
                   blockedRevConnectToMe = 1
         user:SendPM(bot, "The $RevConnectToMe is now blocked.")
           elseif (arg == "0") then
              blockedRevConnectToMe = 0
         user:SendPM(bot, "The $RevConnectToMe is now unblocked.")
                else
                   user:SendPM(bot, "invalid value")
                end     
         elseif (cmd=="!blockedSR") then
           if (arg == "1") then
                   blockedSR = 1
         user:SendPM(bot, "The $SR is now blocked.")
           elseif (arg == "0") then
              blockedSR = 0
         user:SendPM(bot, "The $SR is now unblocked.")
                else
                   user:SendPM(bot, "invalid value")
                end   
        elseif (cmd =="!badshare") then
                if (arg == "on") then
                   badshare="on"
                   user:SendPM(bot, "badshare check is ON")
                elseif (arg =="off") then
                   badshare="off"
                   user:SendPM(bot, "badshare check is OFF")
                else
                   user:SendPM(bot, "invalid value")
                end
        elseif (cmd =="!slotschk") then
                if (arg == "on") then
                   slotschk="on"
                   user:SendPM(bot, "slots check is ON")
                elseif (arg =="off") then
                   slotschk="off"
                   user:SendPM(bot, "slots check is OFF")
                else
                   user:SendPM(bot, "invalid value")
                end
        elseif (cmd =="!msgenter") then
                if (arg == "on") then
                   msgenter="on"
                   user:SendPM(bot, "slots check is ON")
                elseif (arg =="off") then
                   msgenter="off"
                   user:SendPM(bot, "slots check is OFF")
                else
                   user:SendPM(bot, "invalid value")
                end
       
        elseif (cmd == "!count") then    
      if (arg ~= nil) then
         usrp = getn(GetUsersByProfile(arg))      
                   if (usrp ~= nil) then
            if (tonumber(usrp) == 1) then
          user:SendPM(bot, "There is one "..arg.." online. ")
            elseif (tonumber(usrp) > 1) then
                         user:SendPM(bot, " There are "..usrp.. " "..arg.." online. ")
            elseif (tonumber(usrp) < 1) then
               user:SendPM(bot, " There no "..arg.." online at the moment.")
            end
         else
             user:SendPM(bot," No such profile ")
         end
      else
          user:SendPM(bot, " No argument given!")
      end
        elseif (cmd == "!view") then
          if arg then
                  Userlist = GetUsersByProfile(arg)
        user:SendPM(bot,printTable(Userlist,"#"))
          end

        elseif (cmd=="!setminshare") then
      
       if (arg2=="b") then
         unit=0
       elseif (arg2=="kb") then
         unit=1
       elseif (arg2=="mb") then
         unit=2
       elseif (arg2=="gb") then
         unit=3
       else
         user:SendPM(bot, "You used a unknown unit, use one of these (b=bytes, kb=kilobytes,mb=megabytes,gb=gigabytes)")
       end
       if arg then
         frmHub:SetMinShare(tonumber(arg), unit)
         user:SendPM(bot, "The minimal share is now set too: "..tonumber(arg).." "..unit)
       else
         user:SendPM(bot, "You didn't povide a share amount.")
       end
   
         
      
[/size]

Ubikk

Quote   
         end

         s,e,cmd,arg,arg2,arg3 = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(%S+)%s+(.+)" )
         if (cmd=="!addreguser") then
       nick = GetItembyName(arg)
       profileidx = GetProfileIdx(arg3)
            AddRegUser(nick,arg2,profileidx)
       user:SendPM(bot, "The user "..arg.." is now registered with profile "..arg3.." and passw: "..arg2)
       nick:SendPM(bot, "You are "..arg.." now registereded with profile "..arg3.." and passw: "..arg2.. "by operator: "..user)      
         end
       
end

if (user.iProfile <= 1) then                     -- 1 Operator

           if (cmd=="!hubinfo") then
      user:SendPM(bot, "Hubinfo______________________________________________________")
      user:SendPM(bot, "Hubbot:       "..frmHub:GetHubBotName())
      user:SendPM(bot, "Opchatname:       "..frmHub:GetOpChatName())      
           user:SendPM(bot, "Minshare:       "..frmHub:GetMinShare())  
           user:SendPM(bot, "CurrentShareAmount:    "..frmHub:GetCurrentShareAmount())
      user:SendPM(bot, "Usercount:       "..frmHub:GetUsersCount())
      user:SendPM(bot, "Hubname:         "..frmHub:GetHubName())
      user:SendPM(bot, "Hubdescription      "..frmHub:GetHubDescr())
      user:SendPM(bot, "HubRedirectadress    "..frmHub:GetRedirectAddress())
      user:SendPM(bot, "Redirectall *       "..frmHub:GetRedirectAll())
      user:SendPM(bot, "RedirectifFull *       "..frmHub:GetRedirectFull())
      user:SendPM(bot, "RegisterServer       "..frmHub:GetRegServer())   
      user:SendPM(bot, "___________________________________________________________-_")
      user:SendPM(bot, "* (1=yes 0=no) ")
   
            elseif (cmd=="!cleartempban") then
       user:SendPM(bot, "Temp ban list cleared. ")
       ClearTempBan()    
       elseif (cmd=="!getprofiles") then
                 local allprofiles = GetProfiles()
            local index, profile
                 user:SendPM(bot, "Profiles. ")
            for index, profile in allprofiles do        
              user:SendPM(bot, profile)
                 end
       elseif (cmd=="!sendpmtoall") then
                if arg then
                 SendPmToAll(user, arg)
                end
       elseif (cmd=="!sendpmtoops") then
                if arg then
                 SendPmToOps(user, arg)
                end
            elseif (cmd=="!listprofile") then                
       local allprofiles = GetUsersByProfile(arg)
            local index, profile
                 user:SendPM(bot, "Profiles. ")
            for index, profile in allprofiles do        
              user:SendPM(bot, profile)
                 end
          elseif (cmd=="!tempban") then
       tmp = GetItemByName(arg)
       tmp:TempBan()
       user:SendPM(bot, "User: "..arg.. " is now temporarily banned. ")
       tmp:SendPM(bot, "You are temporarily banned. Reason: "..arg2.." by operator: "..user)
       elseif (cmd=="!nickban") then
       tmp = GetItemByName(arg)
       tmp:TempBan()
       user:SendPM(bot, "User: "..arg.. " is now banned (nick). ")
       tmp:SendPM(bot, "You are banned. Reason: "..arg2.." by operator: "..user)   
       elseif (cmd=="!disconnect") then
       tmp = GetItemByName(arg)
       tmp:Disconnect()
       user:SendPM(bot, "User: "..arg.. " is now disconnected. ")
       tmp:SendPM(bot, "You are being disconnected. Reason: "..arg2.." by operator: "..user)
       elseif (cmd=="!timeban") then
            tmp = GetItemByName(arg)
            tmp:TimeBan(tonumber(arg2))
       user:SendPM(bot, "The user "..arg.." is temporarily banned for "..arg2.." min.")
       tmp:SendPM(bot, "You are Temporarily banned for: "..arg2.." min by operator: "..user)
       elseif (cmd=="!unban") then
            tmp = GetItembyName(arg)
                 Unban(tmp)
       user:SendPM(bot, "The user "..arg.." is unbanned by operator "..arg2)
       end
       elseif (cmd=="!warn") then
   
        if arg~=nil then
            victim=GetItemByName(arg)
             if victim~=nil then
                if warnings[arg]==nil then
                      warnings[arg]=0
                 end
                 if warnings[arg]==(max - 1) then
                      SendPmToNick(bot, "This was your last warning. You are now banned!")
                      SendPmToOps(bot, "This was "..arg.."'s last warning and the user is now banned")
                      SendToAll(bot, arg.." got his last warning and was now banend!")
                      victim:Ban()
                      victim:Disconnect()
                      SaveWarn()
                      return 1
                 else
                      if victim.bOperator then
                      warnings[arg]=0
                      return 1
                 end
                 warnings[arg]=warnings[arg]+1
                 if arg2~=nil then
                    victim:SendPM(bot,"Warning: "..arg2)
                    SendToAll(bot, arg.." got his "..c[warnings[arg]].." warning. Reason: "..arg2)
                 end
                 SendPmToNick(bot, "This is your "..c[warnings[arg]].." warning! Get 3 and you are banned!")
                 SendPmToOps(bot, "This was "..arg.."'s "..c[warnings[arg]].." warning. Reason: "..arg2)
                 SaveWarn()
                 return 1
             end
             else
                user:SendPM(bot, "No such user in the userlist: "..arg)
                return 1
             end
       else
         user:SendPM(bot, "Syntax: !warn ")
         return 1
       end
elseif (cmd=="!reset") then
 if arg~=nil then
    warnings[arg]=nil
    user:SendPM(bot, arg.."'s warning were reset.")
    SaveWarn()
    return 1
 else
    user:SendPM(bot, "Syntax: !reset ")
    return 1
 end




end

if (user.iProfile <= 2) then                     -- 2 Vip
 
   if strfind(data, "%b<>%s+("..Command..").*|") then
           s, e, nr = strfind(data, "%b<>%s+"..Command.."%s+([0-9]+)")
           if s then nr = tonumber(nr) else nr = 1 end
           doSlots(user, nr) return 1
       end
     
end

if (user.iProfile <= 3) then                      -- 3 Reg

       if (strfind(strlower(data), strlower("!faq")) ) then
                readfile("faq.txt", user)
       elseif (strfind(strlower(data), strlower("!time"))) then
                time()
       elseif (strfind(strlower(data), strlower("!version"))) then
               user:SendPM(bot,"Script: "..Version..".")
       end

end
                               -- 4 Guest

if (user.iProfile <= 3 or user.iProfile == -1) then

        if( strfind( strlower(data), strlower("!rules")) ) then
                 readfile("rules.txt",user)
            elseif (strfind(strlower(data), strlower("!fame")))  then
                 readfile("fame.txt",user)
       elseif (strfind(strlower(data), strlower("!help"))) then      
                   idx = user.iProfile
            if (idx ~= nil) then
                usrprof = GetProfileName(idx)
       end
            if (usrprof == nil) then
          usrprof = "guest"
       end
      
                     readfile(""..usrprof..".txt",user)
                     return 1
      
       elseif (strfind(strlower(data), strlower("!network")) ) then
                 readfile("network.txt",user)
       end
end

end

function SlotsCheck(user, myinfo)

  if strfind (myinfo,"<++") then
     local _,_,Hubs,Slots,speed = strfind(myinfo,"H:([^,]+),S:([^,>]+).*>$ $(.-).%$")
     local _,_,Guest,Reg,OP = strfind(Hubs, "(%x+)/(%x+)/(%x+)")
     local Slots = tonumber(Slots)
 
  if Guest then
     Hubs = tonumber(Guest)+tonumber(Reg)+tonumber(OP)
  else
     local Hubs = tonumber(Hubs)
  end

  if speed then
    local s,e,MinSlots ,MaxSlots, MaxHubs = strfind(Connection[speed],"(%x+)/(%x+)/(%x+)")
        if (Slots < tonumber(MinSlots)) then
            user:SendData("For a "..speed.." connection the minimum amount of slots is: "..MinSlots)            
       user:Disconnect()   
        elseif (Slots > tonumber(MaxSlots)) then
            user:SendData("For a "..speed.. " connection the maximum amount of slots is: "..MaxSlots)         
       user:Disconnect()   
        elseif  (tonumber(Hubs) > tonumber(MaxHubs)) then        
      user:SendData("For a "..speed.." connection you may not be in more than: "..MaxHubs)           
      user:Disconnect()   
        end
  end
end
end

function Badsharesize(user,data)

badShare = {    "10000000000","5368709120","10737418240","13630010000","16106127360",
      "21474836480","26843545600","27000000000","32212254720","7970010000",
      "37580963840","37970010000","6599201000000","65992010000000","36772010000000",
      "3677201000000","42949672960","48318382080","214266156265","53687091200",
      "59055800320","1747201000000","16772010000000","147720100000000","10240000000000",
      "64424509440","65719010000","69793218560","75161927680","80530636800","85899345920",
      "91268055040","96636764160","102005473280","102400000000","107374182400","118648471552",
      "128849018880","140301549174","161061273600","174720100000","183287729356","214748364800",
      "268435456000","322122547200","375809638400","397760100000","429496729600","536870912000",
      "657190100000","1024000000000","183287729357","102392020337","13625783747","174719269601",
      "65712999629","26993869455","140295106724" }



   local s, e, shared = strfind(user.sMyInfoString, "$ALL %S+ .-$ $.+.$.-$(%d+)")
       
  for key,checkWord in badShare do
    if strfind(data, checkWord, 1, 1) then   
      user:SendData("Your sharesize matches a size used by fakers. ")
       user:Disconnect()
    end
  end
 
end

function readfile(file,user)
   readfrom(file)
   while 1 do
      local line = read()
      if line == nil then break
      else
        user:SendPM(bot,line)   
      end
   end
   readfrom()
end

function time()
H = date("%H")
M = date("%M")
D = date("%d")
MM = date("%m")
Y = date("%y")
Time = ("It's now "..D.."."..MM.."."..Y.." - "..H.." : "..M.."")
SendToAll(Bot,Time)
end

function getid(table, name)      -- Slots script
   return foreachi(table, function(id, item) if item.sName == %name then return id end end)
end

function putitem(table, item)           -- Slots script
   if not item then return end
   local id = getid(table, item.sName)
   if id then table[id] = item
   else tinsert(table, item) id = table.n
   end return id
end

function slotsOnHub(user, args)      -- Slots script
   local s, e, free, all = strfind(args, " (%d+)/(%d+)"..strchar(5))
   foreachi(tabSlots, function(id, item)
      if not getid(item.tItems, %user.sName) then
         putitem(item.tItems, { sName = %user.sName, sValue = %free.."/"..%all })
--         if item.sTarget and (%user.sName == item.sTarget) then
--            SendToNick(item.sName, "    user "..%user.sName.." "..%free.."/"..%all.."|")
--            item.iClock = item.iClock - tmrSlots
--         elseif not item.sTarget and
         if (tonumber(%free) >= item.iNR) then
            SendPmToNick(item.sName, bot, "    user "..%user.sName.." "..%free.."/"..%all.."|")
         end
   end end)
end

function doSlots(user, nr, nick)   -- Slots script
   user:SendPM(bot, "Checking..|")
   frmHub:EnableSearchData(1)
   SendToAll("$Search Hub:"..Command.." T?F?0?1?.|")
   putitem(tabSlots, { sName = user.sName, iClock = clock(), iNR = nr, tItems = {n=0}  })
--   putitem(tabSlots, { sName = user.sName, sTarget = nick, iClock = clock(), iNR = nr, tItems = {n=0}  })
end

function SaveWarn()
local handle = openfile(warningfile, "w")
for index, value in warnings do
write(handle,index.."|"..value.."\r\n")
end
closefile(handle)
end

function LoadWarn()
local handle = openfile(warningfile, "r")
if (handle~=nil) then
local line = read(handle)
while line do
local arrTmp = tokenize(line, "|")
if ((arrTmp[1] ~= nil) and (arrTmp[2] ~= nil)) then
warnings[arrTmp[1]] = tonumber(arrTmp[2])
end
line = read(handle)
end
closefile(handle)
end
end

function tokenize (inString,token)
_WORDS = {}
local matcher = "([^"..token.."]+)"
gsub(inString, matcher, function (w) tinsert(_WORDS,w) end)
return _WORDS
end


function printTable(table,string)
   all =""
   for k,v in table do
      if type(v)=="table" then
         print(string,k," is a table")
         printTable(v,"\t"..string)
      else
         print(string,k,v)
      end
   end
return all
end

function print (...)
   local s =""   
   for i=1,arg.n do
      s = s..tostring(arg)   
   end
   all = all..s.."   "
   
end  





[/size]

This was Part II :)
Thanks you very much

[NL]Pur

sorry this script is 2 years old , i didn't had the intention to convert or update it. Since there are many more other scripts that provide you with the same functionality and more.

Also i don't like certain features myself anymore, like ban on sharesize.

But if anyone feels like converting or updating etc . feel free.

bastya_elvtars

Oh, consolemoon! I love this script, I learned MANY lua from this. It is really a monument. :D
Everything could have been anything else and it would have just as much meaning.

Dessamator

QuoteOriginally posted by bastya_elvtars
Oh, consolemoon! I love this script, I learned MANY lua from this. It is really a monument. :D

so u can convert it and learn some more from it in the process, or at least help others to learn , :)
Ignorance is Bliss.

Ubikk

#5
I also love it, that's why i requested converting in the first place... a little help would be apreciated :D
Or maybe you could point out to me some newer scripts with the same functionalities :)

Dessamator

well, guardian probably does that, robocop, and many many others, anyhow if you really want this script converted, first of all and ive said this quite a few times, use "NIGHTLITCH'S GUI CONVERTER", thats the primary thing any person who wants his/her script converted should do(thats probably what even the best scripters do) then post the errors u get, with the lines it refers to anyways,

GOOD LUCK !!!!
Ignorance is Bliss.

bastya_elvtars

QuoteOriginally posted by Dessamator
QuoteOriginally posted by bastya_elvtars
Oh, consolemoon! I love this script, I learned MANY lua from this. It is really a monument. :D

so u can convert it and learn some more from it in the process, or at least help others to learn , :)

If I had time, I would convert it. I wanna deal with my own scripts 1st, because they are pretty much outdated.  ;(
Everything could have been anything else and it would have just as much meaning.

SMF spam blocked by CleanTalk