|
Joined: Mar 2003
Posts: 34
Ameglian cow
|
OP
Ameglian cow
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..... }
Heh..
|
|
|
|
Joined: Mar 2003
Posts: 437
Fjord artisan
|
Fjord artisan
Joined: Mar 2003
Posts: 437 |
nothing there... it must be in the rest of the script there
|
|
|
|
Joined: Mar 2003
Posts: 272
Fjord artisan
|
Fjord artisan
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.
|
|
|
|
Joined: Mar 2003
Posts: 34
Ameglian cow
|
OP
Ameglian cow
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..
|
|
|
|
Joined: Mar 2003
Posts: 437
Fjord artisan
|
Fjord artisan
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 ] ] } }
|
|
|
|
Joined: Mar 2003
Posts: 437
Fjord artisan
|
Fjord artisan
Joined: Mar 2003
Posts: 437 |
you forget a space Double Blade ) { set ---------------^ there
Last edited by MTech; 22/03/03 01:01 AM.
|
|
|
|
Joined: Mar 2003
Posts: 34
Ameglian cow
|
OP
Ameglian cow
Joined: Mar 2003
Posts: 34 |
arg lol now it says its the first "if" line lol help...
Heh..
|
|
|
|
Joined: Mar 2003
Posts: 437
Fjord artisan
|
Fjord artisan
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.
|
|
|
|
Joined: Mar 2003
Posts: 437
Fjord artisan
|
Fjord artisan
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 ] ] } }
|
|
|
|
Joined: Mar 2003
Posts: 34
Ameglian cow
|
OP
Ameglian cow
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
Heh..
|
|
|
|
Joined: Mar 2003
Posts: 437
Fjord artisan
|
Fjord artisan
Joined: Mar 2003
Posts: 437 |
if (%cur <= 0) { /set %cur 100 }
|
|
|
|
Joined: Mar 2003
Posts: 34
Ameglian cow
|
OP
Ameglian cow
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..
|
|
|
|
|