Script to display time
#1
I have recently been looking through the reference.xml file and I came across a command that returns a string giving the time in hh:mm:ss. This has helped me a lot because I have a tendency to lose track of time easily.
The script that I am currently using is very short and goes like this:

bind 9 [echo (timestring)]

This makes it so that whenever I press "9", it returns the current time in the format "23:23:53". I would like some help with getting to know how I would be able to have this "echo (timestring)" command be executed every two minutes because I am still very new to using cubescript.
Thanks given by:
#2
try looping and using the sleep command
Thanks given by:
#3
Once the command is complete please inform me :)
Thanks given by:
#4
It is completed, but I would like to thank IAF|Lucas for helping me through my noobyness when it comes to cubescript. I was still used to making infinite loops like I do in python with something like
i = 0
while i == 0:
    command
Of course that didn't work, but here's the script. Just put it into your autoexec.cfg file.

alias Habluka [            //Go ahead and call me vain
    echo (timestring)      //
    ; sleep 60000 [        //I would like to thank IAF|Lucas for
        Habluka          //helping me with my cubescript n00biness
    ]
]
Habluka
Thanks given by:
#5
Not working for me?
Thanks given by:
#6
That was a stupid mistake. I forgot to change the one small part. It should be fixed now
edit: also, you need to type in /Habluka or bind it to a key to start it.
Thanks given by:
#7
apart from the obvious error where it runs 'minutely' and not 'Habluka', the command seems to not repeat on opening the game. If you run /Habluka ingame, it works right. So, I suggest
alias echotime [ echo (timestring); bind MOUSE1 attack; sleep 10000 [ echotime ] ]
bind MOUSE1 [attack; echotime]
In which, after shooting once, it will be triggered, and then rebinded so it doesn't activate it again.
Thanks given by:
#8
Actually... You will find it stops working once the map changes, or you connect to a server. This is because script loops are reset on changing the map. To overcome this, put your commands into the alias mapstartonce and manually loop "mapstartonce" in the script, probably using a menu or another native alias, "sbconnect", to perpetuate your scripts. This will make it so it activates automatically when you join a server through the server browser.
uh.
Let me help you with that...
Thanks given by:
#9
I think this was a good post. It shows the true power of community work. What started out as just an idea eventually, with the input of several people, became fully functional and in a way, better than the original idea. This is why I love these forums.
Thanks given by:
#10
look at script on here:http://akimbo.in/forum/viewtopic.php?f=12&t=360

that hours one soughta does some thing yer?

edit: i know you got it figured..just mentioning..
Thanks given by:
#11
Okay. Here's what I was talking about.
http://www.akimbo.in/files/index.php?act=view&id=581
Thanks given by: