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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Sat Jun 14, 2003 5:09 pm   

Syntax Error
 
Hi, I'm new to scripting in zMUD so pardon if its a stupid question.
I'm using the database and finished setting triggers to record the values from a regular Identify output from my mud. Everything worked well with that. Now I made a command so that when I type " find "something" " (the command name is find of corse) It would search through the database names and show the stats of the item the same way as the mud does if it matches only 1 item by that keyword or list all items that have that keyword in their names. I succesfully made it work, but in some parts of the script, zMUD is giving me "Syntax error" that I cant find. I'll post the part where the syntax error occurs:

#IF (%db( @busqueda,cast) != %null) {#SAY Casts spell: %db(@busqueda,cast);#COLOR white}

^syntax error

Now, as far as I know there shouldnt be a syntax error there, but somehow I cant get to make it clean. I think it has something to do with the #COLOR function, couse when I take it out, it shows as ok, but every other #IF that has a color on it shows syntax error.
Now this is the complete alias so if anyone would like to check it out and point me the errors can do so. The variable names are written in spanish as it is my mother tongue.
Alias find:


@busqueda = %null
@itemname = %null
#DBload eq
@busqueda = %find( %1, all)
#IF (@busqueda=%null) {
#ECHO No hay equipment con ese nombre
#color 12
}
#IF (@busqueda=~%deq|%deq) {
#SAY Items en el database
#echo ------------------------------------
@hasta = 50
#until (@hasta <= 0) {
@Itemname = %db( %item( @busqueda, @hasta), name)
#IF (@itemname = %null) {} {
#say %db( %item( @busqueda, @hasta), name)
#co 12
}
#ADD hasta -1
}
@busqueda = %null
#echo ------------------------------------
}
#Echo @busqueda
#IF (%db(@busqueda, type)=WEAPON) {
#SAY Name: '%db( @busqueda, Name)', Item type: %db( @busqueda, type)
#COLOR white
#SAY Item is: %db( @busqueda, flags)
#COLOR white
#SAY Weight: %db( @busqueda, weight), Value: %db( @busqueda, value)
#COLOR white
#SAY Material of construction: %db( @busqueda, material), Ideal level of use: %db( @busqueda, Level)
#COLOR white
#SAY Damage Dice is '%db( @busqueda, damage)' for an average per-round damage of %diceavg(%db(@busqueda,damage))
#COLOR white
#IF (%db( @busqueda,cast) != %null) {#SAY Casts spell: %db(@busqueda,cast);#COLOR white}
#SAY Can affect you as :
#CO white
#IF (%db(@busqueda,str) != 0) {#SAY %null %null %null Affects STR By %db(@busqueda,str);#COLOR white}
#IF (%db(@busqueda,dex) != 0) {#SAY %null %null %null Affects DEX By %db(@busqueda,dex);#COLOR white}
#IF (%db(@busqueda,con) != 0) {#SAY %null %null %null Affects CON By %db(@busqueda,con);#COLOR white}
#IF (%db(@busqueda,int) != 0) {#SAY %null %null %null Affects INT By %db(@busqueda,int);#COLOR white}
#IF (%db(@busqueda,wis) != 0) {#SAY %null %null %null Affects WIS By %db(@busqueda,wis);#COLOR white}
#IF (%db(@busqueda,cha) != 0) {#SAY %null %null %null Affects CHA By %db(@busqueda,cha);#COLOR white}
#IF (%db(@busqueda,damroll) != 0) {#SAY %null %null %null Affects DAMROLL By %db(@busqueda,damroll);#COLOR white}
#IF (%db(@busqueda,hitroll) != 0) {#SAY %null %null %null Affects HITROLL By %db(@busqueda,hitroll);#COLOR white}
#IF (%db(@busqueda,hits) != 0) {#SAY %null %null %null Affects MAXHIT By %db(@busqueda,hits);#COLOR white}
#IF (%db(@busqueda,mana) != 0) {#SAY %null %null %null Affects MAXMANA By %db(@busqueda,mana);#COLOR white}
#IF (%db(@busqueda,move) != 0) {#SAY %null %null %null Affects MOVE By %db(@busqueda,move);#COLOR white}
}
#IF (%db( @busqueda, type)=ARMOR or %db( @busqueda, type)=WORN or %db( @busqueda, type)=AFFECT_EQ or %db( @busqueda, type)=OTHER) {
#SAY Name: '%db( @busqueda, Name)', Item type: %db( @busqueda, type)
#COLOR white
#SAY Item is: %db( @busqueda, flags)
#COLOR white
#SAY Weight: %db( @busqueda, weight), Value: %db( @busqueda, value)
#COLOR white
#SAY Material of construction: %db( @busqueda, material), Ideal level of use: %db( @busqueda, Level)
#COLOR white
#SAY AC-apply is %db( @busqueda, ac)
#COLOR white
#SAY Can affect you as :
#COLOR white
#IF (%db(@busqueda,str) != 0) {#SAY %null %null %null Affects STR By %db(@busqueda,str);#COLOR white}
#IF (%db(@busqueda,dex) != 0) {#SAY %null %null %null Affects DEX By %db(@busqueda,dex);#COLOR white}
#IF (%db(@busqueda,con) != 0) {#SAY %null %null %null Affects CON By %db(@busqueda,con);#COLOR white}
#IF (%db(@busqueda,int) != 0) {#SAY %null %null %null Affects INT By %db(@busqueda,int);#COLOR white}
#IF (%db(@busqueda,wis) != 0) {#SAY %null %null %null Affects WIS By %db(@busqueda,wis);#COLOR white}
#IF (%db(@busqueda,cha) != 0) {#SAY %null %null %null Affects CHA By %db(@busqueda,cha);#COLOR white}
#IF (%db(@busqueda,damroll) != 0) {#SAY %null %null %null Affects DAMROLL By %db(@busqueda,damroll);#COLOR white}
#IF (%db(@busqueda,hitroll) != 0) {#SAY %null %null %null Affects HITROLL By %db(@busqueda,hitroll);#COLOR white}
#IF (%db(@busqueda,hits) != 0) {#SAY %null %null %null Affects MAXHIT By %db(@busqueda,hits);#COLOR white}
#IF (%db(@busqueda,mana) != 0) {#SAY %null %null %null Affects MAXMANA By %db(@busqueda,mana);#COLOR white}
#IF (%db(@busqueda,move) != 0) {#SAY %null %null %null Affects MOVE By %db(@busqueda,move);#COLOR white}
}




--------------end of script-----------

spaces in a new line
Well thats about it, I just want to get rid of the damn syntax error
Thanx a lot.
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Sun Jun 15, 2003 6:39 pm   
 
Does this work ok? Are there any problems with it?

If not don't mind the syntax error message it does that from time to time , just a glitch in the program Zugg did not get to yet I am sure it will get adressed in another update :)

I am running the newest version of zmud 6.06 and I did not have this problem.
I put your script in and it worked just fine.

megamog75
I will do this.Nothing in my life matters except this.No moment in my life exists except this moment.I am born in this moment, and if I fail, I will die in this moment.
-Raistlin Majere
Reply with quote
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Sun Jun 15, 2003 11:17 pm   
 
Thanx a lot for taking the time to check it, i'll just stick to it as it is then.
Hope someday the syntax erros will vanish.
Thanx again.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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