mIRC Homepage
Posted By: Lucres Bracket Error?!?!? - 22/03/03 12:53 AM
Sometimes, a bracket error appears if you dont add brackets in certain spots...

But, i've been getting this error over and over! Whats wrong?

on *:text:!a *:#: {
if........
if.....
}
mad frown confused
Posted By: MTech Re: Bracket Error?!?!? - 22/03/03 12:56 AM
nothing there... it must be in the rest of the script there
Posted By: c0ldfusi0n Re: Bracket Error?!?!? - 22/03/03 12:57 AM
Nothing's wrong with the code you pasted. If you'd paste the actual real code, we may be able to help you, but we can't do anything with a real problem and a fake exemple. Make sure you check the following:

1) Make sure you have no brackets error in your if statements
2) Make sure you have no brackets error BEFORE or AFTER that part of the script.
Posted By: Lucres Re: Bracket Error?!?!? - 22/03/03 12:59 AM
Well, i click on the find and it says its that line...
as for the script, its a bit long but...

on *:text:!a *:#: {
if { % [ $+ [ $nick ] $+ equip ] == Double Blade ) {set %t1 $rand(1,20) | set %cur $sub(%cur [ $+ [ $2 ] ],%t1) | msg $chan $nick hits $2 for %t1 ! $2 $+ 's current hp: %cur [ $+ [ $2 ] ] $+ / $+ %max [ $+ [ $2 ] ] }
if { % [ $+ [ $nick ] $+ equip ] == Grandigo ) { msg $chan 4BOOM! $nick hits $2 for %max [ $+ [ $2 ] ] $+ ! $2 falls flat on his feet! $2 $+ 's current hp: 0/ $+ %max [ $+ [ $2 ] ] }
}
i know some of the vars are a bet messed up, but this is after all a test :P
Posted By: MTech Re: Bracket Error?!?!? - 22/03/03 12:59 AM
on *:text:!a *:#: {
if { % [ $+ [ $nick ] $+ equip ] == Double Blade ) { set %t1 $rand(1,20) | set %cur $sub(%cur [ $+ [ $2 ] ],%t1) | msg $chan $nick hits $2 for %t1 ! $2 $+ 's current hp: %cur [ $+ [ $2 ] ] $+ / $+ %max [ $+ [ $2 ] ] }
if { % [ $+ [ $nick ] $+ equip ] == Grandigo ) { msg $chan 4BOOM! $nick hits $2 for %max [ $+ [ $2 ] ] $+ ! $2 falls flat on his feet! $2 $+ 's current hp: 0/ $+ %max [ $+ [ $2 ] ] }
}
Posted By: MTech Re: Bracket Error?!?!? - 22/03/03 01:00 AM
you forget a space
Double Blade ) { set
---------------^ there
Posted By: Lucres Re: Bracket Error?!?!? - 22/03/03 01:02 AM
arg lol
now it says its the first "if" line lol help... frown
Posted By: MTech Re: Bracket Error?!?!? - 22/03/03 01:03 AM
on *:text:!a *:#: {
if (% [ $+ [ $nick ] $+ equip ] == Double Blade ) { set %t1 $rand(1,20) | set %cur $sub(%cur [ $+ [ $2 ] ],%t1) | msg $chan $nick hits $2 for %t1 ! $2 $+ 's current hp: %cur [ $+ [ $2 ] ] $+ / $+ %max [ $+ [ $2 ] ] }
if (% [ $+ [ $nick ] $+ equip ] == Grandigo) { msg $chan 4BOOM! $nick hits $2 for %max [ $+ [ $2 ] ] $+ ! $2 falls flat on his feet! $2 $+ 's current hp: 0/ $+ %max [ $+ [ $2 ] ] }
}

its
if (
not
if {
Posted By: MTech Re: Bracket Error?!?!? - 22/03/03 01:05 AM
try this
on *:text:!a *:#: {
if (% [ $+ [ $nick ] $+ equip ] == Double Blade ) { set %t1 $rand(1,20) | set %cur $sub(%cur [ $+ [ $2 ] ],%t1) | msg $chan $nick hits $2 for %t1 ! $2 $+ 's current hp: %cur [ $+ [ $2 ] ] $+ / $+ %max [ $+ [ $2 ] ] }
elseif (% [ $+ [ $nick ] $+ equip ] == Grandigo) { msg $chan 4BOOM! $nick hits $2 for %max [ $+ [ $2 ] ] $+ ! $2 falls flat on his feet! $2 $+ 's current hp: 0/ $+ %max [ $+ [ $2 ] ] }
}
Posted By: Lucres Re: Bracket Error?!?!? - 22/03/03 01:27 AM
ty for helping and putting up with my incompetince!

but, i have another question
as you may of guessed, im making a 'battle' script.
is there a way to make it to where if a users current ( %cur ) HP goes zero OR BELOW, make it reset the current hp?
b/c for now with me it has to land on 0 exactly for me frown
Posted By: MTech Re: Bracket Error?!?!? - 22/03/03 01:28 AM
if (%cur <= 0) { /set %cur 100 }
Posted By: Lucres Re: Bracket Error?!?!? - 22/03/03 01:36 AM
is there a way to get around the fact that that activates only after you use the command again?

( translation )
when i type it once
Lucres's current HP: -7/49
type it again
Lucres is dead

can i make it say Lucres is dead on the first time?
© mIRC Discussion Forums