Liv?-Tim?r
 

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

Liv?-Tim?r

Started by kepp, 07 January, 2004, 00:01:48

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kepp

--// 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
Guarding    

DoJIN

nice ....

whut it do?

BlazeXxX

nice one but wen u have bit less memory, its skipping seconds.. like after 24:30:12 it goes like 24:30:14

kepp

like i said... it may use alot, maybe not... i haven't experience any problems but that may be because im huge on memory
Guarding    

c h i l l a

#4
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.

kepp

: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.
Guarding    

yepyepyep4711

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

c h i l l a

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

c h i l l a

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

Woody

Great Idea you guys

Woody

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 ??????

kepp

You want the topic to stay the same after restarting hub or something?
Guarding    

Woody

yeh!

or

Can it be changes so that you have an option withing the .lua that ou change it by, no commands

kepp

im not sure what you want, can you explain a little more specific!?
Guarding    

Woody

#14
--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????

kepp

--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
Guarding    

Woody

#16
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

kepp

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
Guarding    

Woody

nope still with a hub restart, the topic resets itself

plop

try sending the same as on the timer on function main and on connecting users.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

kepp

--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 :)
Guarding    

Woody

#21
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 ?????

kepp

#22
--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
Guarding    

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)
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

kepp

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
Guarding    

SMF spam blocked by CleanTalk