Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Apolyon
Newbie


Joined: 23 Apr 2007
Posts: 4

PostPosted: 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. Confused

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
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: 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?
Reply with quote
Apolyon
Newbie


Joined: 23 Apr 2007
Posts: 4

PostPosted: 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. Mad
Reply with quote
Zwartje
Novice


Joined: 08 Feb 2007
Posts: 45

PostPosted: Tue Apr 24, 2007 4:13 pm   
 
try changing the #VAR assignment to
#var throwit 0

(removing the =)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: 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.
Reply with quote
Apolyon
Newbie


Joined: 23 Apr 2007
Posts: 4

PostPosted: 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.
Reply with quote
Zwartje
Novice


Joined: 08 Feb 2007
Posts: 45

PostPosted: 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~]}
Reply with quote
Apolyon
Newbie


Joined: 23 Apr 2007
Posts: 4

PostPosted: 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. Smile
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net