|
Articval Novice
Joined: 01 Jun 2005 Posts: 47
|
Posted: Sun Oct 19, 2008 9:09 am
About repeating #alarm in Cmud |
Hey! Its about coming to Cmud from Zmud:
I have noticed that when u have an alarm set up in an alias,like this:
#alias test {
#alarm testing {+1} {#echo This is a test;test}
}
It will only work Twice!!
This was basic on my scripting back on Zmud, and now I find I will have to check all alarms and change this ones from {+1} to {1} being carefull of not changing an alarm which is not meant to autorepeat!!
Or is there any way to rephrase all alarms so they work as I used them back in Zmud??
Thankyou!! |
|
|
|
Tarken Aurelius Apprentice
Joined: 23 Oct 2008 Posts: 120 Location: Cincinnati, Ohio
|
Posted: Sun Oct 26, 2008 11:25 pm |
Not exactly sure what you were trying to accomplish, but if you do something like this, the alarm will repeat itself. I would also advise not using an alias in its own alias to avoid accidentally creating nasty trigger loops.
Code: |
#ALARM testing {-1} {#ECHO THIS IS A TEST}
|
or if you needed it to be initiated by the alias 'test' for some reason:
Code: |
#ALIAS test {#ALARM testing {-1} {#ECHO THIS IS A TEST}}
|
Hope this helps :) |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Oct 27, 2008 12:57 am |
You don't even need to do that - #alarm 1 {something} will run an alarm once every second over and over. If you want to stop it, you can give it an ID and use #t- or #suspend.
|
|
|
|
Articval Novice
Joined: 01 Jun 2005 Posts: 47
|
Posted: Fri Oct 31, 2008 1:06 pm |
Problem is hard to explain.. lets try it:
What I had on Zmud was:
- Alarm with alias inside
-On some thoose alarms, there are aliases which force them, depending on the classes wich are active, to repeat themselves or to switch off (Same alarm ID, no order inside).
Thoose alarms, will autorepeat ONLY when the alias inside them are 'active'. And since some of them have alias which have other aliases inside of em, its too hard to know if they are to repeat or not, so its hard to decide if I should use -1 or +1.
I cant just change them all, because for thoose of them who do not have to repeat themselves, will start to fire when i dont want to.
Thats why im asking a way to set an alarm into an alias which will work infinite number of times, not like the example i put on the starting on the post, which will only repeat 2 times on Cmud, unlike it did back in Zmud where it repeated continously.
If I fix the aliases which give the order to autorepeat, everything is fixed.
Isnt there a way for an alias to auto repeat itself with an alarm like they did back in Zmud with this syntax, without having to set an alarm to repeat for ever???
#alias test {#alarm testing {+1} {#echo This is a test;test}}
(I just need what it did back in Zmud to work for me in Cmud, on Cmud it fires twice, while con Zmud it worked forever)
Hope I was clearer :)
And thankyou btw, thought this post was gona get no answers, thats why I didnt answer earlyer :) |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri Oct 31, 2008 1:36 pm |
Easiest way is not to use an execution loop (which is pretty much always a questionable practice) but to use #t- and #t+ to enable and disable them. So you do:
#alarm testing 1 {#echo this is a test}
and then construct an alias or set of aliases like:
#alias teston {#t+ testing}
#alias testoff {#t- testing}
Or a single alias with "on" and "off" options, a toggle or whatever. There're also the #suspend and #resume commands, but I can't remember right now how they differ from #t+ and #t- and can't test. This way you can also return the on/off status of the alarm easily, using %trigger(testing). |
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Fri Oct 31, 2008 4:34 pm |
An alarm loop that uses temporary alarms (the +) is pretty inefficient too.
|
|
|
|
Articval Novice
Joined: 01 Jun 2005 Posts: 47
|
Posted: Fri Oct 31, 2008 4:38 pm |
ok thank you all guys, ill change that then :)
|
|
|
|
|
|