mIRC Home    About    Download    Register    News    Help

Print Thread
#16360 22/03/03 12:53 AM
Joined: Mar 2003
Posts: 34
L
Lucres Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Mar 2003
Posts: 34
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


Heh..
#16361 22/03/03 12:56 AM
Joined: Mar 2003
Posts: 437
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Mar 2003
Posts: 437
nothing there... it must be in the rest of the script there

#16362 22/03/03 12:57 AM
Joined: Mar 2003
Posts: 272
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Mar 2003
Posts: 272
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.


- cF
Dedicated helper for rent.
#16363 22/03/03 12:59 AM
Joined: Mar 2003
Posts: 34
L
Lucres Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Mar 2003
Posts: 34
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


Heh..
#16364 22/03/03 12:59 AM
Joined: Mar 2003
Posts: 437
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Mar 2003
Posts: 437
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 ] ] }
}

#16365 22/03/03 01:00 AM
Joined: Mar 2003
Posts: 437
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Mar 2003
Posts: 437
you forget a space
Double Blade ) { set
---------------^ there

Last edited by MTech; 22/03/03 01:01 AM.
#16366 22/03/03 01:02 AM
Joined: Mar 2003
Posts: 34
L
Lucres Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Mar 2003
Posts: 34
arg lol
now it says its the first "if" line lol help... frown


Heh..
#16367 22/03/03 01:03 AM
Joined: Mar 2003
Posts: 437
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Mar 2003
Posts: 437
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 {

Last edited by MTech; 22/03/03 01:04 AM.
#16368 22/03/03 01:05 AM
Joined: Mar 2003
Posts: 437
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Mar 2003
Posts: 437
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 ] ] }
}

#16369 22/03/03 01:27 AM
Joined: Mar 2003
Posts: 34
L
Lucres Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Mar 2003
Posts: 34
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


Heh..
#16370 22/03/03 01:28 AM
Joined: Mar 2003
Posts: 437
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Mar 2003
Posts: 437
if (%cur <= 0) { /set %cur 100 }

#16371 22/03/03 01:36 AM
Joined: Mar 2003
Posts: 34
L
Lucres Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Mar 2003
Posts: 34
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?


Heh..

Link Copied to Clipboard