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.