Jump to content
  • 0
Sign in to follow this  
papazola

Buffer Script Working Fine But Crashed

Question

when i click this buffer suddenly crash

 

 

 

prontera,149,182,4 script Healer#h1-1::Healer 100,{
// mes "[Healer]";
// mes "I have amazing healing powers!!";
// mes "You look like a person who needs them";
// mes "Want some?";
// next;
// menu "Heal",-,"No thanks",CANCEL;
percentheal 100,100;
sc_start SC_BLESSING,600000,10;
sc_start SC_INCREASEAGI,600000,10;
//sc_start SC_MAGNIFICAT,600000,5;
//sc_start SC_ASSUMPTIO,600000,5;
//sc_start SC_GLORIA,600000,5;
//sc_start SC_IMPOSITIO,600000,5;
//sc_start SC_SUFFRAGIUM,600000,3;
//sc_start SC_GLORIA,600000,5;
sc_start SC_ASPDPOTION2,600000,0;
dispbottom "Thanks Use My Service.";
OnClick:
atcommand "@repairall";
close;
mes "[Healer]";
mes "I will buff you with my own power";
mes "Wonderfull, You are now healed!.";
mes "Have fun adventuring!!";
close;
 
CANCEL:
mes "[Healer]";
mes "thanks for use me";
next;
close;
 
OnInit:
setarray .Name$,"H","E","A","L","E","R";
while( 1 ){
set .Display$,"";
for( set .i,0; .i < getarraysize( .Name$ ); set .i,.i + 1 ){
set .Display$,.Display$ + .Name$[.i];
delwaitingroom;
waitingroom .Display$,0;
sleep ( rand( 300 ) );
}
sleep 1000;
}
end;
 
 
}
 
morocc,159,96,5 duplicate(Healer) Healer#h1-2 531

 

 

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I don't know if that's because the small error at the beginning of the OnInit label (sorry no error there):
 

OnInit:setarray .Name$,"H","E","A","L","E","R";

Should be:
 

OnInit:setarray .Name$[0],"H","E","A","L","E","R";

And there's some unnecessary code in that label. Those loops and even the construction of the waiting room title aren't necessary. Also you don't use most of the code, why you don't remove what isn't on use?

Sorry for not being of further help since I'm on my cellphone.

Share this post


Link to post
Share on other sites
  • 0

@jabote

any array that declared without specify the index number ... will alway start at 0 ...

 

@TS

for the script problems... i believe you should change close to end .....

Share this post


Link to post
Share on other sites
  • 0

Whops, my habit betrayed me.

 

Emistry is right: that first close is used without an active NPC conversation window and that's not allowed in scripting.

 

But I'd make a major cleanup to that NPC anyways, making it look like this:

prontera,149,182,4	script	Healer#h1-1::Healer	100,{	percentheal 100,100;	sc_start SC_BLESSING,600000,10;	sc_start SC_INCREASEAGI,600000,10;	// sc_start SC_MAGNIFICAT,600000,5;	// sc_start SC_ASSUMPTIO,600000,5;	// sc_start SC_GLORIA,600000,5;	// sc_start SC_IMPOSITIO,600000,5;	// sc_start SC_SUFFRAGIUM,600000,3;	// sc_start SC_GLORIA,600000,5;	sc_start SC_ASPDPOTION2,600000,0;	atcommand "@repairall";	dispbottom "Thanks for using my service.";	end;OnInit:	waitingroom "HEALER",0;	end;} morocc,159,96,5	duplicate(Healer)	Healer#h1-2	531

Look at it: it's more readable and I've removed any unnecessary code: I've left the other buffs in case you want to use the rest of buffs and it's still half its original size. This one has no errors that I know, but I haven't tested it.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.