PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: antonio on 16 October, 2005, 14:26:25

Title: timerannuncer?????
Post by: antonio on 16 October, 2005, 14:26:25
I wish one script type timeannouncer thanks
Title:
Post by: Dessamator on 16 October, 2005, 21:50:19
search the forum.
Title:
Post by: 6Marilyn6Manson6 on 17 October, 2005, 00:07:10
Mmmm I things this is ok:

--## Simple Time Bot
--## Requested by SteffJay
--## Made by nErBoS
--## Converted in LUA 5 by 6Marilyn6Manson6
--## Commands:
--## !time - Gives the current time

sBot = "Time-Bot"

function ChatArrival(user, data)
if (string.sub(data,1,1)=="<") or (string.sub(data,1,5+string.len(sBot))=="$To: "..sBot) then
data = string.sub(data,1,string.len(data)-1)
s,e,cmd = string.find(data,"%b<>%s+(%S+)")
if (cmd == "!time") then
user:SendData(sBot, GetTime())
end
end
end

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

Try this. c ya
Title:
Post by: Herodes on 17 October, 2005, 18:09:32
havent tested due to inability to do so.
--## Simple Time Bot
--## Requested by SteffJay
--## Made by nErBoS
--## Converted in LUA 5 by 6Marilyn6Manson6
--## Commands:
--## !time - Gives the current time
--- touched by Herodes ( rmvd GetTime() )

sBot = "Time-Bot"

function ChatArrival(user, data)
if (string.sub(data,1,1)=="<") or (string.sub(data,1,5+string.len(sBot))=="$To: "..sBot) then
data = string.sub(data,1,string.len(data)-1)
s,e,cmd = string.find(data,"%b<>%s+(%S+)")
if (cmd == "!time") then
user:SendData(sBot, os.date( "Date: %d/%m"/%Y Hour %H:%M:%S" ) )
end
end
end
Title:
Post by: bastya_elvtars on 17 October, 2005, 18:20:14
--## Simple Time Bot
--## Requested by SteffJay
--## Made by nErBoS
--## Converted in LUA 5 by 6Marilyn6Manson6
--## Commands:
--## !time - Gives the current time
--- touched by Herodes ( rmvd GetTime() )

-- Now it really works in PM. -- // bastya_elvtars
-- Also hacked & optimized a bit.

sBot = "Time-Bot"

function ChatArrival(user, data, bool)
    data = string.sub(data,1,string.len(data)-1)
    local s,e,cmd = string.find(data,"%b<>%s+(%S+)")
    if (cmd == "!time") then
      send=user.SendData
      if bool then send=user.SendPM end
      send(user,sBot, os.date( "Date: %d/%m/%Y Hour %H:%M:%S" ) )
      return 1
    end
end

function ToArrival(user,data)
  if string.sub(data,1,5+string.len(sBot))=="$To: "..sBot then ChatArrival(user,data,true) return 1 end
end



BTW this is not what he wanted. He wanted a timed ad or so.
Title:
Post by: 6Marilyn6Manson6 on 18 October, 2005, 02:21:32
bastya change in your script:

-- Now it really works in PM. -- // basyta_elvtars

with

-- Now it really works in PM. -- // bastya_elvtars

hihihi now tour nick in comment is correct :P c ya
Title:
Post by: bastya_elvtars on 18 October, 2005, 09:45:24
Done. Looks like I am unfamiliar with names. :D
Title:
Post by: 6Marilyn6Manson6 on 18 October, 2005, 10:46:45
Now script is correct :P
Title: timerannuncer
Post by: antonio on 18 October, 2005, 20:11:26
excused but and this that I meant the timerannucer I did not say that I had to write to the inside of the script a phrase that it would have sended in main every tot of time thanks