--// Live Timer By Kepp
--//
--// Im not so sure how much
--// recources this neat script use
--// So use with brain!!!
RemHub = "[BBB][Sweden[Network]"
function Main()
SetTimer(1000)
StartTimer()
end
function OnTimer()
frmHub:SetHubName(RemHub)
local arg = date("%H:%M:%S")
local arg2 = frmHub:GetHubName()
local OutPut = arg2.." - The Time Is : "..arg
frmHub:SetHubName(OutPut)
SendToAll("$HubName "..OutPut)
end
nice ....
whut it do?
nice one but wen u have bit less memory, its skipping seconds.. like after 24:30:12 it goes like 24:30:14
like i said... it may use alot, maybe not... i haven't experience any problems but that may be because im huge on memory
nice idea kepp...
just you can do this a little simpler
--// Live Timer By Kepp
--//
--// Im not so sure how much
--// recources this neat script use
--// So use with brain!!!
RemHub = "[BBB][Sweden[Network]"
function Main()
frmHub:SetHubName(RemHub)
SetTimer(1000)
StartTimer()
end
function OnTimer()
SendToAll("$HubName "..RemHub.." - The Time Is : "..date("%H:%M:%S"))
end
since you update the hub name every second anyways..
you actually don't even need to reg it at Main()
but I agree, maybe better set the timer to a minute, so when your hub is laggy, or the time till one gets the message differs. each second, won't make much difference.
:O lol... Nice one..
makes me feel stupid..
I noticed a little delay myself today so yea, i would say every minute or so, maybe 30 sec.
hey guys, just for the sake of it: how about a Timer-Bot, called "time", for example, which Description would show the time. You know, like the away-bot that actualises the description with your away status.
I just think that could be a nice challenge.
On this very bot: I'm using it now ;) but I replaced the original "time is" with my former Hub-Topic. So my suggestion: could you replace the "time is" by an argument that would be the hubtopic, and maybe read it from the hub, or if not possible, integrate the !topic command in the script, so that it would still be possible to change the topic using !topic in the mainchat?
I hope you get me :)
cheers
one thing.. like this :))
--Live Timer bot by kepp
--Idea yepyepyep4711
--modded me.
bot = "TimE"
function Main()
frmHub:RegBot(bot)
SetTimer(1*1000)
StartTimer()
end
function OnTimer()
SendToAll("$MyINFO $ALL "..bot.." Local Time : "..date("%H:%M:%S").."$ $"..date("%H:%M:%S").."$Local Time : "..date("%H:%M:%S").."$$|")
end
take 2
--Live Timer by kepp
--Idea yepyepyep4711
--modded me.
HubName = frmHub:GetHubName()
topic = "type !topic "
function Main()
SetTimer(1*1000)
StartTimer()
end
function OnTimer()
SendToAll("$HubName "..HubName.." - "..topic.." - Local Time : "..date("%H:%M:%S"))
end
function DataArrival(curUser,data)
if curUser.bOperator and strsub(data,1,1) == "<" then
local _,_,cmd,curtopic = strfind( data, "%b<>%s(%S+)%s+(.*)%|$" )
if cmd and cmd == "!topic" then
topic = curtopic
curUser:SendData("Topic has been set to "..topic..".")
SendToAll("$HubName "..HubName.." - "..topic.." - Local Time : "..date("%H:%M:%S"))
return 1
end
end
end
Great Idea you guys
c h i l l a
i was wondering could you make it so the topic stayed permanent rather that you being able to change it using cmd !topic ??????
You want the topic to stay the same after restarting hub or something?
yeh!
or
Can it be changes so that you have an option withing the .lua that ou change it by, no commands
im not sure what you want, can you explain a little more specific!?
--Live Timer by kepp
--Idea yepyepyep4711
--modded me.
HubName = frmHub:GetHubName()
topic = "type !topic "
function Main()
SetTimer(1*1000)
StartTimer()
end
function OnTimer()
SendToAll("$HubName "..HubName.." - "..topic.." - Local Time : "..date("%H:%M:%S"))
end
function DataArrival(curUser,data)
if curUser.bOperator and strsub(data,1,1) == "<" then
local _,_,cmd,curtopic = strfind( data, "%b<>%s(%S+)%s+(.*)%|$" )
if cmd and cmd == "!topic" then
topic = curtopic
curUser:SendData("Topic has been set to "..topic..".")
SendToAll("$HubName "..HubName.." - "..topic.." - Local Time : "..date("%H:%M:%S"))
return 1
end
end
end
the topic, you are able to change it rite?? by using the command !topic
What i want (if possible) is for the topic to be permanent, and have no ability to change it through commands.
only have the ability to change it throught the .lua, asif it was a bot name??????
now do u get me????
--Live Timer by kepp
--Idea yepyepyep4711
--modded me.
HubName = frmHub:GetHubName()
topic = "type !topic "
function Main()
SetTimer(1*1000)
StartTimer()
end
function OnTimer()
SendToAll("$HubName "..HubName.." - "..topic.." - Local Time : "..date("%H:%M:%S"))
end
function DataArrival(curUser,data)
if curUser.bOperator and strsub(data,1,1) == "<" then
local _,_,cmd,curtopic = strfind( data, "%b<>%s(%S+)%s+(.*)%|$" )
if cmd and cmd == "!topic" then
topic = curtopic
frmHub:SetHubName(topic)
curUser:SendData("Topic has been set to "..topic..".")
SendToAll("$HubName "..HubName.." - "..topic.." - Local Time : "..date("%H:%M:%S"))
return 1
end
end
end
Set topic once and it should be there forever
unfortunatly, when the hub restarts, you still have to re enter the topic
and whatever you entered as the topic is now the hub name
Oh, i see
--Live Timer by kepp
--Idea yepyepyep4711
--modded me.
HubName = frmHub:GetHubName().." - "..topic.." - Local Time :"
topic = "Topic text here"
function Main()
SetTimer(1*1000)
frmHub:SetHubName(HubName)
StartTimer()
end
function OnTimer()
SendToAll("$HubName "..HubName.." "..date("%H:%M:%S"))
end
This should do it
nope still with a hub restart, the topic resets itself
try sending the same as on the timer on function main and on connecting users.
plop
--Live Timer by kepp
--Idea yepyepyep4711
--modded me.
HubName = frmHub:GetHubName().." - "..topic.." - Local Time :"
topic = "Topic text here"
function Main()
SetTimer(1*1000)
frmHub:SetHubName(HubName)
SendToAll("$HubName "..HubName.." "..date("%H:%M:%S"))
StartTimer()
end
function OnTimer()
SendToAll("$HubName "..HubName.." "..date("%H:%M:%S"))
end
function NewUserConnected(user)
SendToAll("$HubName "..HubName.." "..date("%H:%M:%S"))
end
function OpConnected(user)
NewUserConnected(user)
end
Thanks for the tip Plop, let's hope this work :)
i have no idea how to edit .lua
plop how did u learn???
btw i get
Syntax Error: attempt to concat global `topic' (a nil value)
whatever that means ?????
--Live Timer by kepp
--Idea yepyepyep4711
--modded me.
topic = [[Topic text here]]
HubName = frmHub:GetHubName().." - "..topic.." - Local Time :"
function Main()
SetTimer(1*1000)
frmHub:SetHubName(HubName)
SendToAll("$HubName "..HubName.." "..date("%H:%M:%S"))
StartTimer()
end
function OnTimer()
SendToAll("$HubName "..HubName.." "..date("%H:%M:%S"))
end
function NewUserConnected(user)
SendToAll("$HubName "..HubName.." "..date("%H:%M:%S"))
end
function OpConnected(user)
NewUserConnected(user)
end
Try now, I actually tested it this time :P
QuoteOriginally posted by Woody
i have no idea how to edit .lua
plop how did u learn???
well ehm, the day before a trip 2 my g/f i browsed the lua site a bit and found a book there.
during the 1st week of that holiday i read about 50-75% of that book in the rare few moments i was alone.
came home and looked on this forum for some scripts witch i knew had bugs (more then 1 pref).
i tryed 2 fix them bug for bug myself, after 2-3 scripts like that i started 2 make my 1st kick counter.
gues you can say i learned just by trail and error, making lots and lots of mistakes.
and have 2 say that i learned really a lot from the help of notrabitwombat.
he gave me hints not straigth answers, i love that as you learn a lot more that way.
i'm still learning myself everyday, everytime i try 2 do things in another way.
i don't really feel comfy when ppl call me smart, i rather say i'm creative.
if i know some1 is trying 2 learn lua i try just 2 give hints, kepp knows that by now.
if you wanne learn it 2 i'll try 2 remember your name and do the same with you (hope also the other folks whill do or start doing that).
plop
the place where you can download that book is posted here on the forum somewhere a couple times, keep forgetting it myself. (should be the proof that i'm not smart. lol)
QuoteOriginally posted by plop
QuoteOriginally posted by Woody
i have no idea how to edit .lua
plop how did u learn???
well ehm, the day before a trip 2 my g/f i browsed the lua site a bit and found a book there.
during the 1st week of that holiday i read about 50-75% of that book in the rare few moments i was alone.
came home and looked on this forum for some scripts witch i knew had bugs (more then 1 pref).
i tryed 2 fix them bug for bug myself, after 2-3 scripts like that i started 2 make my 1st kick counter.
gues you can say i learned just by trail and error, making lots and lots of mistakes.
and have 2 say that i learned really a lot from the help of notrabitwombat.
he gave me hints not straigth answers, i love that as you learn a lot more that way.
i'm still learning myself everyday, everytime i try 2 do things in another way.
i don't really feel comfy when ppl call me smart, i rather say i'm creative.
if i know some1 is trying 2 learn lua i try just 2 give hints, kepp knows that by now.
if you wanne learn it 2 i'll try 2 remember your name and do the same with you (hope also the other folks whill do or start doing that).
plop
the place where you can download that book is posted here on the forum somewhere a couple times, keep forgetting it myself. (should be the proof that i'm not smart. lol)
Yea... You learn alot to browse these forums, getting hints from plop, read the manual, and have fun... :)
by the way.. The book is also here (http://theabyss2.no-ip.org:8080/luabook.pdf)
maby im an idiot but the last posted one does not change the topic on !topic...
Doen't have to do with any command ... look for your self ... :)
No DataArrival function in there ...
It is meant to sent (the hub Name - the time )
That means it is sending the $Hubname string every second ... (bandwidth)
if u want u can change
...
function Main()
SetTimer(1*1000) <=-to-=> SetTimer(60*1000)
seconds ^^^------------------minutes ^^^
and as u are in Notepad press Ctrl+H and replace :
date("%H:%M:%S")) <=-to-=> date("%H:%M"))
So it sents only the minutes ....
Let's code ... :)