PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: SteffJay on 12 September, 2004, 18:52:44

Title: 3 New scripts required.
Post by: SteffJay on 12 September, 2004, 18:52:44
:P Hello all. I am in need of three scripts, i have looked over the entire site but none will fulfill my needs unless i use a multi-bot, which i do not want to use......  Firstly, i need a working "welcome" script that can be adjusted for Masters, OP's & VIP's. in and out. Secondly, i need a working copy of the joining IP address, slots open, shared amount and in other hubs and lastly, a date time bot that will show D/M/YY (UK style). Too much to ask for ?, i don't think so with all you Einstiens here...  lol.  TIA !!
Title:
Post by: nErBoS on 15 September, 2004, 00:09:45
Hi,

First Script...

You want a welcome bot with several possible messeges to Master, OP or VIPs, choose by random, right ???

Second Script...

Didn't understood, you want a offlien userinfo or a hub stat ???

Last Script...

Here you go...

--## Simple Time Bot
--## Requested by SteffJay
--## Made by nErBoS
--## Commands:
--## !time - Gives the current time

sBot = "Time-Bot"

function DataArrival(user, data)
if (strsub(data,1,1)=="<") or (strsub(data,1,5+strlen(sBot))=="$To: "..sBot) then
data = strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd == "!time") then
user:SendData(sBot, GetTime())
end
end
end

function GetTime()
s = date("%S")
h = date("%H")
m = date("%M")
d = date("%d")
mm = date("%m")
y = date("%y")
Date = "Date: "..d.."/"..mm.."/20"..y.." Hour "..h..":"..m..":"..s
return Date
end

Best regards, nErBoS
Title:
Post by: SteffJay on 15 September, 2004, 10:35:41
Hello nErBoS. Thank you for the time bot. Is there a way of making the time bot auto display in main chat with an adjustable time sequence?, say every half an hour ?. The "Welcome" bot needs not  to be random. I would like to make custom log in and log out messages for OP's, VIP's and Masters. The second script is for everyone  joining the hub with hub stats, ie: How much tey are sharing, Mb, Gb and Tb. Their IP address, How many slots open, connection type (cable, 56k, etc), and type of client ie: dc++ v0.401 etc. Hope this helps. Thanks again.  ;)
Title:
Post by: nErBoS on 16 September, 2004, 00:14:30
Hi,

Just another question, the welcome BOT will have a message per user or a message to all Master, one to all OPs and one to all VIP or REG ???

Best regards, nErBoS
Title:
Post by: SteffJay on 16 September, 2004, 07:11:24
The Welcome message can include Reg as well but not necessary, mainly required for Master, OP's and VIP's.
Title:
Post by: nErBoS on 16 September, 2004, 11:53:08
Hi,

You didn't have respond to my question, i want to know if you want to have a message per user or a message per profile ???

Best regards, nErBoS
Title:
Post by: SteffJay on 16 September, 2004, 11:58:15
A message per user please nErBoS !!!
Title:
Post by: nErBoS on 16 September, 2004, 12:05:12
Hi,

OK i have to go know because i have a exam later at night i will give one script that does the 3 scripts.

Best regards, nErBoS
Title:
Post by: SteffJay on 16 September, 2004, 14:56:00
Ok nErBoS, that's great. Good luck with your exam but will not be a problem for you i think....  !!!   :P
Title:
Post by: nErBoS on 17 September, 2004, 03:20:03
Hi,

Well the exam... better not even talk about  ;( .
Here are the 3 scripts...

--## Multi BOT Adds
--## Requested by SteffJay
--## Time showed from 30 minutes to 30 minutes
--## Made by nErBoS
--## Commands:
--## !time - Gives the current time

sBot = "M-Bot"

sec = 1000
min = 60*sec

-- Use this table to put the welcome msg to each user, it must be like i made for nErBoS
arrW = {
["nErBoS"] = {
["IN"] = "MSG ON LOGIN",
["OUT"] = "MSG ON LOGOUT",
},
}


function Main()
frmHub:RegBot(sBot)
frmHub:EnableFullData(1)
SetTimer(30*min)
StartTimer()
end

function OnTimer()
SendToAll(sBot, GetTime())
end

function NewUserConnected(user)
local s,e,tag,con,mail,share = strfind(user.sMyInfoString, "%$MyINFO%s+%$ALL%s+%S+%s+([^$]+)%$%s+%$([^$]*)%$([^$]*)%$([^$]+)%$")
local sTmp = "\t--## YOUR STATS ##--\r\n\r\n"
sTmp = sTmp.."\t?Your Nick: "..user.sName.."\r\n"
sTmp = sTmp.."\t?Your IP: "..user.sIP.."\r\n"
if (tag == nil) then
sTmp = sTmp.."\t?Client: UNKNOW\r\n"
sTmp = sTmp.."\t?Version: UNKNOW\r\n"
sTmp = sTmp.."\t?Slots Open: UNKNOW\r\n"
else
local s,e,tag1 = strfind(tag, "(%b<>%b<>)")
if (tag1 == nil) then
local s,e,client,version,slots = strfind(tag, "<(.+)%s+V:(.+),M.+S:(%d+)")
sTmp = sTmp.."\t?Client: <"..client.."\r\n"
sTmp = sTmp.."\t?Version: "..version.."\r\n"
sTmp = sTmp.."\t?Slots Open: "..slots.."\r\n"
else
local s,e,client,version,slots = strfind(tag, "<(%S+)(%x+.%x+)><.+S:(%d+)")
sTmp = sTmp.."\t?Client: <"..client.."\r\n"
sTmp = sTmp.."\t?Version: "..version.."\r\n"
sTmp = sTmp.."\t?Slots Open: "..slots.."\r\n"
end
end
if (con == "" or con == nil) then
sTmp = sTmp.."\t?Connection: UNKNOW\r\n"
else
con = strsub(con,1,strlen(con)-1)
sTmp = sTmp.."\t?Connection: "..con.."\r\n"

end
if (share == nil or tonumber(share) == nil) then
sTmp = sTmp.."\t?Share: UNKNOW\r\n"
else
if (tonumber(share) < 1) then
share = format("%0.2f", tonumber(share)*(1024)).." MB"
elseif (iUserShare > 1000) then
share = format("%0.2f", tonumber(share)/(1024)).." TB"
else
share = share.." GB"
end
sTmp = sTmp.."\t?Share: "..share.."\r\n"
end
if (mail == nil or mail == "") then
sTmp = sTmp.."\t?Mail: UNKNOW\r\n"
else
sTmp = sTmp.."\t?Mail: "..mail.."\r\n"
end
user:SendData(sBot, sTmp)
if (arrW[user.sName] ~= nil) then
SendToAll(sBot, arrW[user.sName]["IN"])
end
end

function UserDisconnected(user)
if (arrW[user.sName] ~= nil) then
SendToAll(sBot, arrW[user.sName]["OUT"])
end
end

OpConnected = NewUserConnected
OpDisconnected = UserDisconnected

function DataArrival(user, data)
if (strsub(data,1,1)=="<") or (strsub(data,1,5+strlen(sBot))=="$To: "..sBot) then
data = strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd == "!time") then
user:SendData(sBot, GetTime())
end
end
end

function GetTime()
s = date("%S")
h = date("%H")
m = date("%M")
d = date("%d")
mm = date("%m")
y = date("%y")
Date = "Date: "..d.."/"..mm.."/20"..y.." Hour "..h..":"..m..":"..s
return Date
end

Best regards, nErBoS
Title:
Post by: SteffJay on 17 September, 2004, 08:57:48
Hi nErBoS. I have run the script, the time section is fine but there is a problem with the joining stat. When Ptokax runs, there are no errors, No syntax errors in script file C:\Program Files\Ptokax\scripts\Multi.lua but when i enter the hub this error occurs: Syntax Error: attempt to compare nil with number......  Any ideas ??. Thanks m8y.   :rolleyes:
Title:
Post by: nErBoS on 17 September, 2004, 15:58:07
Hi,

I have fixed in the script above, try out.

Best regards, nErBoS
Title:
Post by: SteffJay on 17 September, 2004, 16:41:34
Hmmmmm..... still getting: Syntax Error: attempt to compare nil with number   from the script above !!
Title:
Post by: nErBoS on 17 September, 2004, 18:23:54
Hi,

I have fixed another one in the script above, i belive that you haven't mail in your settings, it should fix.

Best regards, nErBoS
Title:
Post by: SteffJay on 17 September, 2004, 19:06:57
:(  Hello nErBoS. I have copied/pasted and tried the above script again but still the same error: Syntax Error: attempt to compare nil with number    I do have an email addy in my dc++ settings. The time bot is still working ok though. Thanks m8y.
Title:
Post by: bastya_elvtars on 17 September, 2004, 19:14:08
aint that a "version" value bug?
Title:
Post by: nErBoS on 17 September, 2004, 23:25:16
Hi,

Which DC are you using SteffJay ??

Best regards, nErBoS
Title:
Post by: SteffJay on 17 September, 2004, 23:48:45
Hello nErBoS. I run dc ++ v0.401    Robocop v7.0a  and Ptokax v0.3.2.6 Test drive 4.99
Title:
Post by: nErBoS on 18 September, 2004, 01:45:32
Hi,

Well...

1) I would recommend you to get ptokax TD4 and not 4.99 it has a lot of bad bugs and is not a public release.

2) Have you added any welcome msg ??? If yes show me your table please.

3) I have tested with several clients and i didn't get any error. (included dc++ 0.401).

Best regards, nErBoS
Title:
Post by: SteffJay on 18 September, 2004, 09:42:01
The only Ptokax version i can find (public release) is the one i'm using now....  Ptokax v0.3.2.6 Test drive 4.99. When i d/load TD4 it is 4.99. If you have a link to 4.00 i would like to have it.... Thanks....
Title:
Post by: Psycho_Chihuahua on 18 September, 2004, 09:47:39
here you go

http://uknnet.com/dl_engine/index.php?subcat=2
Title:
Post by: SteffJay on 18 September, 2004, 10:23:45
8o  Thank's Psycho_Chihuahua for the link. After i loaded it up, its the same one i'm using !!   lol  :(  Thanks anyway.
Title:
Post by: SteffJay on 18 September, 2004, 10:25:37
Hello nErBoS. Here is the script as amended bor use in the hub...................

----- Script Start --------------------

--## Multi BOT Adds
--## Requested by SteffJay
--## Time showed from 30 minutes to 30 minutes
--## Made by nErBoS
--## Commands:
--##   !time - Gives the current time

sBot = "Welcome"

sec = 1000
min = 60*sec

-- Use this table to put the welcome msg to each user, it must be like i made for nErBoS
arrW = {
   ["SteffJay"] = {
      ["IN"] = "Hello SteffJay",
      ["OUT"] = "Goodbye SteffJay",  },
                 ["Tommy"] = {
      ["IN"] = "Hello Tommy",
      ["OUT"] = "Goodbye Tommy",  },
                 ["Fred"] = {
      ["IN"] = "Hello Fred",
      ["OUT"] = "Goodbye Fred",  },
                 ["Jim"] = {
      ["IN"] = "Hello Jim",
      ["OUT"] = "Goodbye Jim",  },
                 ["Mino"] = {
      ["IN"] = "Hello Mino",
      ["OUT"] = "Goodbye Mino",  },
                 ["Reg"] = {
      ["IN"] = "Hello Reg",
      ["OUT"] = "Goodbye Reg",  },

}


function Main()
   frmHub:RegBot(sBot)
   frmHub:EnableFullData(1)
   SetTimer(30*min)
   StartTimer()
end

function OnTimer()
   SendToAll(sBot, GetTime())
end

function NewUserConnected(user)
   local s,e,tag,con,mail,share = strfind(user.sMyInfoString, "%$MyINFO%s+%$ALL%s+%S+%s+([^$]+)%$%s+%$([^$]

*)%$([^$]*)%$([^$]+)%$")
   local sTmp = "\t--## YOUR STATS ##--\r\n\r\n"
   sTmp = sTmp.."\t?Your Nick: "..user.sName.."\r\n"
   sTmp = sTmp.."\t?Your IP: "..user.sIP.."\r\n"
   if (tag == nil) then
      sTmp = sTmp.."\t?Client: UNKNOW\r\n"
      sTmp = sTmp.."\t?Version: UNKNOW\r\n"
      sTmp = sTmp.."\t?Slots Open: UNKNOW\r\n"
   else
      local s,e,tag1 = strfind(tag, "(%b<>%b<>)")
      if (tag1 == nil) then
         local s,e,client,version,slots = strfind(tag, "<(.+)%s+V:(.+),M.+S:(%d+)")
         sTmp = sTmp.."\t?Client: <"..client.."\r\n"
         sTmp = sTmp.."\t?Version: "..version.."\r\n"
         sTmp = sTmp.."\t?Slots Open: "..slots.."\r\n"
      else
         local s,e,client,version,slots = strfind(tag, "<(%S+)(%x+.%x+)><.+S:(%d+)")
         sTmp = sTmp.."\t?Client: <"..client.."\r\n"
         sTmp = sTmp.."\t?Version: "..version.."\r\n"
         sTmp = sTmp.."\t?Slots Open: "..slots.."\r\n"
      end
   end   
   if (con == "" or con == nil) then
      sTmp = sTmp.."\t?Connection: UNKNOW\r\n"
   else
      con = strsub(con,1,strlen(con)-1)
      sTmp = sTmp.."\t?Connection: "..con.."\r\n"
   
   end
   if (share == nil or tonumber(share) == nil) then
      sTmp = sTmp.."\t?Share: UNKNOW\r\n"
   else
      if (tonumber(share) < 1) then
         share = format("%0.2f", tonumber(share)*(1024)).." MB"
      elseif (iUserShare > 1000) then
         share = format("%0.2f", tonumber(share)/(1024)).." TB"
      else
         share = share.." GB"
      end
      sTmp = sTmp.."\t?Share: "..share.."\r\n"   
   end
   if (mail == nil or mail == "") then
      sTmp = sTmp.."\t?Mail: UNKNOW\r\n"
   else
      sTmp = sTmp.."\t?Mail: "..mail.."\r\n"   
   end
   user:SendData(sBot, sTmp)
   if (arrW[user.sName] ~= nil) then
      SendToAll(sBot, arrW[user.sName]["IN"])
   end
end   

function UserDisconnected(user)
   if (arrW[user.sName] ~= nil) then
      SendToAll(sBot, arrW[user.sName]["OUT"])
   end
end

OpConnected = NewUserConnected
OpDisconnected = UserDisconnected

function DataArrival(user, data)
   if (strsub(data,1,1)=="<") or (strsub(data,1,5+strlen(sBot))=="$To: "..sBot) then
      data = strsub(data,1,strlen(data)-1)
      s,e,cmd = strfind(data,"%b<>%s+(%S+)")
      if (cmd == "!time") then
         user:SendData(sBot, GetTime())
      end
   end
end

function GetTime()
   s = date("%S")
   h = date("%H")
   m = date("%M")
   d = date("%d")
   mm = date("%m")
   y = date("%y")
   Date = "Date: "..d.."/"..mm.."/20"..y.." Hour "..h..":"..m..":"..s
   return Date
end

-------------------  Script end --------------------
Title:
Post by: SteffJay on 18 September, 2004, 10:28:49
Hmmmmmmmmm........ try again without the Smilies !!

--------------------------- Script Start -------------------------
--## Multi BOT Adds
--## Requested by SteffJay
--## Time showed from 30 minutes to 30 minutes
--## Made by nErBoS
--## Commands:
--##   !time - Gives the current time

sBot = "Welcome"

sec = 1000
min = 60*sec

-- Use this table to put the welcome msg to each user, it must be like i made for nErBoS
arrW = {
   ["SteffJay"] = {
      ["IN"] = "Hello SteffJay",
      ["OUT"] = "Goodbye SteffJay",  },
                 ["Tommy"] = {
      ["IN"] = "Hello Tommy",
      ["OUT"] = "Goodbye Tommy",  },
                 ["Fred"] = {
      ["IN"] = "Hello Fred",
      ["OUT"] = "Goodbye Fred",  },
                 ["Jim"] = {
      ["IN"] = "Hello Jim",
      ["OUT"] = "Goodbye Jim",  },
                 ["Mino"] = {
      ["IN"] = "Hello Mino",
      ["OUT"] = "Goodbye Mino",  },
                 ["Reg"] = {
      ["IN"] = "Hello Reg",
      ["OUT"] = "Goodbye Reg",  },

}


function Main()
   frmHub:RegBot(sBot)
   frmHub:EnableFullData(1)
   SetTimer(30*min)
   StartTimer()
end

function OnTimer()
   SendToAll(sBot, GetTime())
end

function NewUserConnected(user)
   local s,e,tag,con,mail,share = strfind(user.sMyInfoString, "%$MyINFO%s+%$ALL%s+%S+%s+([^$]+)%$%s+%$([^$]

*)%$([^$]*)%$([^$]+)%$")
   local sTmp = "\t--## YOUR STATS ##--\r\n\r\n"
   sTmp = sTmp.."\t?Your Nick: "..user.sName.."\r\n"
   sTmp = sTmp.."\t?Your IP: "..user.sIP.."\r\n"
   if (tag == nil) then
      sTmp = sTmp.."\t?Client: UNKNOW\r\n"
      sTmp = sTmp.."\t?Version: UNKNOW\r\n"
      sTmp = sTmp.."\t?Slots Open: UNKNOW\r\n"
   else
      local s,e,tag1 = strfind(tag, "(%b<>%b<>)")
      if (tag1 == nil) then
         local s,e,client,version,slots = strfind(tag, "<(.+)%s+V:(.+),M.+S:(%d+)")
         sTmp = sTmp.."\t?Client: <"..client.."\r\n"
         sTmp = sTmp.."\t?Version: "..version.."\r\n"
         sTmp = sTmp.."\t?Slots Open: "..slots.."\r\n"
      else
         local s,e,client,version,slots = strfind(tag, "<(%S+)(%x+.%x+)><.+S:(%d+)")
         sTmp = sTmp.."\t?Client: <"..client.."\r\n"
         sTmp = sTmp.."\t?Version: "..version.."\r\n"
         sTmp = sTmp.."\t?Slots Open: "..slots.."\r\n"
      end
   end   
   if (con == "" or con == nil) then
      sTmp = sTmp.."\t?Connection: UNKNOW\r\n"
   else
      con = strsub(con,1,strlen(con)-1)
      sTmp = sTmp.."\t?Connection: "..con.."\r\n"
   
   end
   if (share == nil or tonumber(share) == nil) then
      sTmp = sTmp.."\t?Share: UNKNOW\r\n"
   else
      if (tonumber(share) < 1) then
         share = format("%0.2f", tonumber(share)*(1024)).." MB"
      elseif (iUserShare > 1000) then
         share = format("%0.2f", tonumber(share)/(1024)).." TB"
      else
         share = share.." GB"
      end
      sTmp = sTmp.."\t?Share: "..share.."\r\n"   
   end
   if (mail == nil or mail == "") then
      sTmp = sTmp.."\t?Mail: UNKNOW\r\n"
   else
      sTmp = sTmp.."\t?Mail: "..mail.."\r\n"   
   end
   user:SendData(sBot, sTmp)
   if (arrW[user.sName] ~= nil) then
      SendToAll(sBot, arrW[user.sName]["IN"])
   end
end   

function UserDisconnected(user)
   if (arrW[user.sName] ~= nil) then
      SendToAll(sBot, arrW[user.sName]["OUT"])
   end
end

OpConnected = NewUserConnected
OpDisconnected = UserDisconnected

function DataArrival(user, data)
   if (strsub(data,1,1)=="<") or (strsub(data,1,5+strlen(sBot))=="$To: "..sBot) then
      data = strsub(data,1,strlen(data)-1)
      s,e,cmd = strfind(data,"%b<>%s+(%S+)")
      if (cmd == "!time") then
         user:SendData(sBot, GetTime())
      end
   end
end

function GetTime()
   s = date("%S")
   h = date("%H")
   m = date("%M")
   d = date("%d")
   mm = date("%m")
   y = date("%y")
   Date = "Date: "..d.."/"..mm.."/20"..y.." Hour "..h..":"..m..":"..s
   return Date
end

------------------------ Script End ---------------------------
Title:
Post by: SteffJay on 18 September, 2004, 11:09:48
My apologies Psycho_Chihuahua....  Yes that is the v4.0.00b but still getting the error even when running that.... even with the original script or the one I adapted. I have even tried reg?ing nErBoS as a Master, OP, VIP and Reg, logging him in and out with each tag using both scripts and still get the same error every time......  Most confusing !!!
Title:
Post by: nErBoS on 18 September, 2004, 15:10:02
Hi,

I have found the problem was in the share verification, fixed...

--## Multi BOT Adds
--## Requested by SteffJay
--## Time showed from 30 minutes to 30 minutes
--## Made by nErBoS
--## Commands:
--## !time - Gives the current time

sBot = "M-Bot"

sec = 1000
min = 60*sec

-- Use this table to put the welcome msg to each user, it must be like i made for nErBoS
arrW = {
["nErBoS"] = {
["IN"] = "MSG ON LOGIN",
["OUT"] = "MSG ON LOGOUT",
},
}


function Main()
frmHub:RegBot(sBot)
frmHub:EnableFullData(1)
SetTimer(30*min)
StartTimer()
end

function OnTimer()
SendToAll(sBot, GetTime())
end

function NewUserConnected(user)
local s,e,tag,con,mail,share = strfind(user.sMyInfoString, "%$MyINFO%s+%$ALL%s+%S+%s+([^$]+)%$%s+%$([^$]*)%$([^$]*)%$([^$]+)%$")
local sTmp = "\t--## YOUR STATS ##--\r\n\r\n"
sTmp = sTmp.."\t?Your Nick: "..user.sName.."\r\n"
sTmp = sTmp.."\t?Your IP: "..user.sIP.."\r\n"
if (tag == nil) then
sTmp = sTmp.."\t?Client: UNKNOW\r\n"
sTmp = sTmp.."\t?Version: UNKNOW\r\n"
sTmp = sTmp.."\t?Slots Open: UNKNOW\r\n"
else
local s,e,tag1 = strfind(tag, "(%b<>%b<>)")
if (tag1 == nil) then
local s,e,client,version,slots = strfind(tag, "<(.+)%s+V:(.+),M.+S:(%d+)")
sTmp = sTmp.."\t?Client: <"..client.."\r\n"
sTmp = sTmp.."\t?Version: "..version.."\r\n"
sTmp = sTmp.."\t?Slots Open: "..slots.."\r\n"
else
local s,e,client,version,slots = strfind(tag, "<(%S+)(%x+.%x+)><.+S:(%d+)")
sTmp = sTmp.."\t?Client: <"..client.."\r\n"
sTmp = sTmp.."\t?Version: "..version.."\r\n"
sTmp = sTmp.."\t?Slots Open: "..slots.."\r\n"
end
end
if (con == "" or con == nil) then
sTmp = sTmp.."\t?Connection: UNKNOW\r\n"
else
con = strsub(con,1,strlen(con)-1)
sTmp = sTmp.."\t?Connection: "..con.."\r\n"

end
if (share == nil or tonumber(share) == nil) then
sTmp = sTmp.."\t?Share: UNKNOW\r\n"
else
share = format("%0.2f", tonumber(share)/(1024*1024*1024))
if (tonumber(share) < 1) then
share = format("%0.2f", tonumber(share)*(1024)).." MB"
elseif (tonumber(share) > 1000) then
share = format("%0.2f", tonumber(share)/(1024)).." TB"
else
share = share.." GB"
end
sTmp = sTmp.."\t?Share: "..share.."\r\n"
end
if (mail == nil or mail == "") then
sTmp = sTmp.."\t?Mail: UNKNOW\r\n"
else
sTmp = sTmp.."\t?Mail: "..mail.."\r\n"
end
user:SendData(sBot, sTmp)
if (arrW[user.sName] ~= nil) then
SendToAll(sBot, arrW[user.sName]["IN"])
end
end

function UserDisconnected(user)
if (arrW[user.sName] ~= nil) then
SendToAll(sBot, arrW[user.sName]["OUT"])
end
end

OpConnected = NewUserConnected
OpDisconnected = UserDisconnected

function DataArrival(user, data)
if (strsub(data,1,1)=="<") or (strsub(data,1,5+strlen(sBot))=="$To: "..sBot) then
data = strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd == "!time") then
user:SendData(sBot, GetTime())
end
end
end

function GetTime()
s = date("%S")
h = date("%H")
m = date("%M")
d = date("%d")
mm = date("%m")
y = date("%y")
Date = "Date: "..d.."/"..mm.."/20"..y.." Hour "..h..":"..m..":"..s
return Date
end

Best regards, nErBoS
Title:
Post by: SteffJay on 19 September, 2004, 11:20:39
:D  Hey nErBoS.....  Your a STAR...  The script now works great, thanks for your help with this, its much appreciated m8y !!. Good luck with your exams... !!  :))
Title:
Post by: SteffJay on 19 September, 2004, 12:51:51
Hello nErBoS. I have one question: this welcome message for Test has been added to the script:

-----------------------  Script  ----------------------------

--## Multi BOT Adds
--## Requested by SteffJay
--## Time showed from 30 minutes to 30 minutes
--## Made by nErBoS
--## Commands:
--##   !time - Gives the current time

sBot = "Admin"

sec = 1000
min = 60*sec

-- Use this table to put the welcome msg to each user, it must be like i made for nErBoS
arrW = {
   ["nErBoS"] = {
      ["IN"] = "Welcome back nErBoS",
      ["OUT"] = "Goodbye nErBoS",
},

arrW = {
   ["Test"] = {
      ["IN"] = "Welcome Test",
      ["OUT"] = "Goodbye Test",
}

function Main()
   frmHub:RegBot(sBot)
   frmHub:EnableFullData(1)
   SetTimer(30*min)
   StartTimer()
end

function OnTimer()
   SendToAll(sBot, GetTime())
end

function NewUserConnected(user)
   local s,e,tag,con,mail,    etc, etc .......

------------------------- end of script --------------------

Syntax Error: `}' expected (to close `{' at line 20);
  last token read: `function' at line 26 in file `C:\Program Files\Ptokax\scripts\Test.lua'            Why ?

It was copy/pasted from above. Can you give me the proper syntax for the above script please !!.  Thanks m8y.
Title:
Post by: BottledHate on 19 September, 2004, 13:12:20
here's an example of how a table should look for this script....


arrW = {
   ["nErBoS"] = {
      ["IN"] = "Welcome back nErBoS",
      ["OUT"] = "Goodbye nErBoS",
   },
   ["Test"] = {
      ["IN"] = "Welcome Test",
      ["OUT"] = "Goodbye Test",
   },
   ["Test2"] = {
      ["IN"] = "Welcome Test2",
      ["OUT"] = "Goodbye Test2",
   },
   ["Test3"] = {
      ["IN"] = "Welcome Test3",
      ["OUT"] = "Goodbye Test3",
   },
   ["Test4"] = {
      ["IN"] = "Welcome Test4",
      ["OUT"] = "Goodbye Test4",
   },
}


hope this helps!

-BH
Title:
Post by: SteffJay on 19 September, 2004, 14:35:45
Hmmmmm....  don't work.....
Title:
Post by: nErBoS on 19 September, 2004, 16:31:36
Hi,

This is wrong....

arrW = {
["nErBoS"] = {
["IN"] = "Welcome back nErBoS",
["OUT"] = "Goodbye nErBoS",
},

arrW = {
["Test"] = {
["IN"] = "Welcome Test",
["OUT"] = "Goodbye Test",
}

Should be like this...

arrW = {
["nErBoS"] = {
["IN"] = "Welcome back nErBoS",
["OUT"] = "Goodbye nErBoS",
},
["Test"] = {
["IN"] = "Welcome Test",
["OUT"] = "Goodbye Test",
},
}

Just like BH has written.

Best regards, nErBoS
Title:
Post by: SteffJay on 19 September, 2004, 18:06:24
I will give it a bash.........
Title:
Post by: SteffJay on 19 September, 2004, 22:34:53
Hello, nErBoS & BottledHate......  success !!!!   The script works a dream !!   Thanks to you two guy's...   ;)  Thank's again !!