|
Apolyon Newbie
Joined: 23 Apr 2007 Posts: 4
|
Posted: Mon Apr 23, 2007 8:51 pm
Script Error - Please Help |
I've received this script from a friend; it's working in his zMud but doesn't work in mine cMud. I know nothing about scripting, please help me.
TRIGGER ^Undulating waves of heat give everything a sudden tinge of redness.
Value:
#color bold,orange
timerritual
#if (@throwit = 1) {
get dagger
throw dagger at @target
#var throwit 0
}
ALIASE timerritual
Value:
#var ritualtimer 9
#ALARM "ritualtimer" {*1} {
#ADD ritualtimer -1
#IF (@ritualtimer = 1) {#say ~[TDD~]}
#IF (@ritualtimer < 1) {#T- ritualtimer}
}
ALIASE TDD
get dagger
throw @dagger at @target
#var throwit 1
cMUD keeps on duplicating ritualtimer as variable/trigger.
EDIT: Also, this is suppose to be a script loop on trigger state. |
|
Last edited by Apolyon on Tue Apr 24, 2007 4:46 pm; edited 2 times in total |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Tue Apr 24, 2007 1:00 pm |
Right off the bat, I can tell you that "@throwit = 1" is not correct syntax for setting the value of the variable in either zMUD or CMUD. You want to do it without the @ in this case.
Not sure about the ritualtimer issue, but maybe try using different names for the variable and alarm instead of re-using the same name for both? |
|
|
|
Apolyon Newbie
Joined: 23 Apr 2007 Posts: 4
|
Posted: Tue Apr 24, 2007 4:08 pm |
Thank you for your reply. I have fixed the @throwit like you suggested and try to use some different names for ritualtimer variable and alarm but the script still doesn't work.
|
|
|
|
Zwartje Novice
Joined: 08 Feb 2007 Posts: 45
|
Posted: Tue Apr 24, 2007 4:13 pm |
try changing the #VAR assignment to
#var throwit 0
(removing the =) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Apr 24, 2007 6:10 pm |
The problem is with your "#T- ritualtimer" statement. This is disabling the variable @ritualtimer. So the next time your trigger runs and it does:
#VAR ritualtimer 9
it creates a *new* variable, because the previous variable is disabled and is no longer accessible.
You shouldn't be using #T- with a variable. Normally you put stuff within a Class Folder and then enable/disable the class folder.
What it looks like you are trying to do is to disable the Alarm. But your Alarm has the same name as the Variable, and so it's ambiguous what you are trying to disable. If you changed the name of the alarm, then it would work. Or, you can use the command:
#T- ritualtimer Trigger
to disable the alarm trigger instead of the variable. |
|
|
|
Apolyon Newbie
Joined: 23 Apr 2007 Posts: 4
|
Posted: Tue Apr 24, 2007 9:20 pm |
Hi Zugg, thank you for taking your time and helping me with my problem. I tried both suggestion and it still doesn't work. What I need is having the ritualtimer sets itself as a variable at 9 second then starts subtracting to 0 second everytime the trigger call it. When the trigger stops calling or when the ritualtimer has count to 0 second, it stops there. I think that is why a #T- ritualtimer was use, to disable/stop the countdown at 0 until the next trigger hits and restarts the variable at 9 seconds count down again.
|
|
|
|
Zwartje Novice
Joined: 08 Feb 2007 Posts: 45
|
Posted: Wed Apr 25, 2007 9:13 am |
What I don't understand is why you use that complex alias 'ritualtimer' while, as far as I see it, you could just replace it with a simple #alarm to get the functionality you want:
#ALARM +8 {#say ~[TDD~]} |
|
|
|
Apolyon Newbie
Joined: 23 Apr 2007 Posts: 4
|
Posted: Wed Apr 25, 2007 3:02 pm |
because there is a status bar that uses the variable @ritualtimer to give the head up on the countdown.
|
|
|
|
|
|