Jump to content
  • 0
HisokaMachi

Help to put auto repair on my healer and indentify

Question

8 answers to this question

Recommended Posts

  • 0
-	script	healtest	-1,{	.@price = 0;	// Zeny required for heal	.@Buffs = 1;	// Also buff players? (1: yes / 0: no)	.@Delay = 1;	// Heal delay, in seconds	if( getbrokenid(1) ) repairall;	getinventorylist;	while( .@i < @inventorylist_count ){		if ( !@inventorylist_identify[.@i] ){		delitem2 @inventorylist_id[.@i],1,0,0,0,0,0,0,0;		getitem @inventorylist_id[.@i],1;		}		.@i++;	}	if (@HD > gettimetick(2)) end;	if (.@price) {		message strcharinfo(0),"Healing costs "+.@price+" Zeny.";		if (Zeny < .@price) end;		if(select("^0055FFHeal^000000:^777777Cancel^000000") == 2) close;		Zeny -= .@price;	}	specialeffect2 EF_HEAL2; percentheal 100,100;	if (.@Buffs) {		specialeffect2 EF_INCAGILITY; sc_start SC_INC_AGI,360000,10;		specialeffect2 EF_BLESSING; sc_start SC_BLESSING,360000,10;	}	if (.@Delay) @HD = gettimetick(2)+.@Delay;	close;OnInit:	waitingroom "Healer",0;}

Share this post


Link to post
Share on other sites
  • 0
getinventorylist;for( set .@i,0; .@i < @inventorylist_count; set .@i, .@i + 1 ) {        if ( @inventorylist_identify[.@i] == 1 ) continue;		delitem2 @inventorylist_id[.@i],1,0,0,0,0,0,0,0;		getitem @inventorylist_id[.@i],1;}if ( !getbrokenid(1) ) close;atcommand "@repairall"; 

Add this 

Share this post


Link to post
Share on other sites
  • 0

 

 

getinventorylist;for( set .@i,0; .@i < @inventorylist_count; set .@i, .@i + 1 ) { if ( @inventorylist_identify[.@i] == 1 ) continue; delitem2 @inventorylist_id[.@i],1,0,0,0,0,0,0,0; getitem @inventorylist_id[.@i],1;}if ( !getbrokenid(1) ) close;atcommand "@repairall";

Add this

where would i add that? can you make it a whole script?


SOLVED

 

getinventorylist;for( set .@i,0; .@i < @inventorylist_count; set .@i, .@i + 1 ) { if ( @inventorylist_identify[.@i] == 1 ) continue; delitem2 @inventorylist_id[.@i],1,0,0,0,0,0,0,0; getitem @inventorylist_id[.@i],1;}if ( !getbrokenid(1) ) close;atcommand "@repairall";

Add this

i thought i already solved it but i dunno where to add the script Edited by Mhalicot
Post Merged!

Share this post


Link to post
Share on other sites
  • 0

 

	if( getbrokenid(1) ) repairall;	getinventorylist;	while( .@i < @inventorylist_count ){		if ( !@inventorylist_identify[.@i] ){		delitem2 @inventorylist_id[.@i],1,0,0,0,0,0,0,0;		getitem @inventorylist_id[.@i],1;		}		.@i++;	}

 

I'm just nitpicking, but why not use a for loop since it's counter-controlled anyway?

 

	for (.@i = 0; .@i < @inventorylist_count; .@i++) {		if (!@inventorylist_identify[.@i]) {			delitem2 @inventorylist_id[.@i],1,0,0,0,0,0,0,0;			getitem @inventorylist_id[.@i],1;		}	}

 

Also, it might be nice to add in a visual effect for that repair (and enclose it in curly braces, because one-liners is just bad coding habit):

 

	if (getbrokenid(1)) {		specialeffect2 EF_REPAIRWEAPON;		repairall;	}

Share this post


Link to post
Share on other sites
  • 0

Probably an absurd answer : his while loop is much slightly faster than your for loop in terms of execution time :D

Edited by Patskie

Share this post


Link to post
Share on other sites
  • 0

Probably an absurd answer : his while loop is much slightly faster than your for loop in terms of execution time :D

 

Faster isn't necessarily better lol

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

×
×
  • Create New...

Important Information

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