HisokaMachi
New member
how to put auto repair broken equips and auto identify unidentified items
http://upaste.me/7e931027215f058e5 New
http://upaste.me/7e931027215f058e5 New
where would i add that? can you make it a whole script?Add thisCode: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";
i thought i already solved it but i dunno where to add the scriptAdd thisCode: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";
- 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;}
I'm just nitpicking, but why not use a for loop since it's counter-controlled anyway?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 (getbrokenid(1)) { specialeffect2 EF_REPAIRWEAPON; repairall; }
Faster isn't necessarily better lolProbably an absurd answer : his while loop is much slightly faster than your for loop in terms of execution time![]()
We use essential cookies to make this site work, and optional cookies to enhance your experience.