Posts: 50
Threads: 3
Joined: Jun 2010
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.
Posts: 30
Threads: 3
Joined: Jun 2010
try looping and using the sleep command
Posts: 162
Threads: 8
Joined: Jun 2010
Once the command is complete please inform me :)
Posts: 50
Threads: 3
Joined: Jun 2010
23 Jun 10, 10:08AM
(This post was last modified: 23 Jun 10, 10:55AM by iOD|Habluka.)
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
Posts: 162
Threads: 8
Joined: Jun 2010
Posts: 50
Threads: 3
Joined: Jun 2010
23 Jun 10, 10:45AM
(This post was last modified: 23 Jun 10, 10:55AM by iOD|Habluka.)
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.
Posts: 100
Threads: 6
Joined: Jun 2010
23 Jun 10, 10:49AM
(This post was last modified: 23 Jun 10, 10:49AM by R4zor.)
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.
Posts: 3,780
Threads: 33
Joined: Jun 2010
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...
Posts: 50
Threads: 3
Joined: Jun 2010
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.
Posts: 271
Threads: 7
Joined: Jun 2010
01 Jul 10, 11:40AM
(This post was last modified: 01 Jul 10, 11:42AM by yata.)
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..
Posts: 3,780
Threads: 33
Joined: Jun 2010