hendra814 Posted April 19, 2016 Share Posted April 19, 2016 (edited) please help me fix this script this one can't refine to safe limit for armor only *Solved prontera,171,226,4 script Great Refiner 826,{ setarray [email protected][0],1,2,3,4,5,6,9,10; //change into setarray [email protected][0],2,3,4,5,6,7,8,9,10; for( set [email protected],0; [email protected] < getarraysize([email protected]); set [email protected],[email protected] + 1 ) { if( getequipisequiped([email protected][[email protected]]) ) { if( [email protected][[email protected]] == 3 || [email protected][[email protected]] == 4) { switch( getequipweaponlv([email protected][[email protected]]) ) { case 0: set [email protected], 4; break; default: set [email protected], 8 - getequipweaponlv([email protected][[email protected]]); break; } } else { set [email protected], 4; } set [email protected],[email protected]([email protected][[email protected]]); if(getequiprefinerycnt([email protected][[email protected]]) < [email protected] && getequipisenableref([email protected][[email protected]]) ) { for( set [email protected],0; [email protected] < [email protected]finefix; set [email protected],[email protected] + 1) successrefitem [email protected][[email protected]]; } } sleep2 100; } } and this one for armor slot with shoes, so can't refine armor equipment too *Solved prt_in,61,54,3 script Refiner 826,{ OnUsed: set .Mode,0; // Refine mode [ 0 = Refine +1 Each time / 1 = Refine to Max Limit ] set .EquipCheck,1; // Check Equips is refineable or not. [ 0 = Disable / 1 = Enable ] set .MaxRefine,4; // Max Refine Limit set .MaxRefine2,7; // Max Refine Limit [ for Mode 2 Max Refine ] set .TicketID,7539; // Ticket ID if( countitem(.TicketID) < 1 ){ mes "you don't have "+getitemname(.TicketID)+" to continue refine."; end; } switch(select( ( getequiprefinerycnt(6) >= .MaxRefine2 || getequipisequiped(1) == 0 )?"":"Headgear [ ^4EEE94"+getequipname(1)+"^000000 ]", ( getequiprefinerycnt(2) >= .MaxRefine2 || getequipisequiped(2) == 0 )?"":"Armor [ ^4EEE94"+getequipname(2)+"^000000 ]", ( getequiprefinerycnt(3) >= .MaxRefine2 || getequipisequiped(3) == 0 )?"":"Left Hand [ ^4EEE94"+getequipname(3)+"^000000 ]", ( getequiprefinerycnt(4) >= .MaxRefine2 || getequipisequiped(4) == 0 )?"":"Right Hand [ ^4EEE94"+getequipname(4)+"^000000 ]", ( getequiprefinerycnt(5) >= .MaxRefine2 || getequipisequiped(5) == 0 )?"":"Garment [ ^4EEE94"+getequipname(5)+"^000000 ]", ( getequiprefinerycnt(6) >= .MaxRefine2 || getequipisequiped(6) == 0 )?"":"Shoes [ ^4EEE94"+getequipname(6)+"^000000 ]", "^FF0000end^000000")) { Case 1: if ( .Mode == 0 ) { callsub RefineSystem,1; } if ( .Mode == 1 ) { callsub MaxRefineSystem,1; } if ( .Mode == 2 ) { callsub NewRefineSystem,1; } Case 2: if ( .Mode == 0 ) { callsub RefineSystem,2; } if ( .Mode == 1 ) { callsub MaxRefineSystem,2; } if ( .Mode == 2 ) { callsub NewRefineSystem,2; } Case 3: if ( .Mode == 0 ) { callsub RefineSystem,3; } if ( .Mode == 1 ) { callsub MaxRefineSystem,3; } if ( .Mode == 2 ) { callsub NewRefineSystem,3; } Case 4: if ( .Mode == 0 ) { callsub RefineSystem,4; } if ( .Mode == 1 ) { callsub MaxRefineSystem,4; } if ( .Mode == 2 ) { callsub NewRefineSystem,4; } Case 5: if ( .Mode == 0 ) { callsub RefineSystem,5; } if ( .Mode == 1 ) { callsub MaxRefineSystem,5; } if ( .Mode == 2 ) { callsub NewRefineSystem,5; } Case 6: if ( .Mode == 0 ) { callsub RefineSystem,6; } if ( .Mode == 1 ) { callsub MaxRefineSystem,6; } if ( .Mode == 2 ) { callsub NewRefineSystem,6; } Case 7: end; } RefineSystem: if ( .EquipCheck == 1 && getequipisenableref(getarg(0)) == 0 ){ mes "this item is unrefinable."; end; } if(getequiprefinerycnt(getarg(0)) < .MaxRefine) { mes "i'm can't refine this item."; mes "you must upgrade ^0000FF+4^000000"; mes "before bring it to me."; end; } successrefitem (getarg(0)); message strcharinfo(0),"done."; delitem .TicketID,1; end; MaxRefineSystem: if ( .EquipCheck == 1 && getequipisenableref(getarg(0)) == 0 ){ mes "this item is unrefinable."; end; } for ( set [email protected],getequiprefinerycnt(getarg(0)); getequiprefinerycnt(getarg(0)) < .MaxRefine; set [email protected],getequiprefinerycnt(getarg(0)) ){ successrefitem (getarg(0)); } message strcharinfo(0),"done."; delitem .TicketID,1; end; NewRefineSystem: if ( .EquipCheck == 1 && getequipisenableref(getarg(0)) == 0 ){ mes "this item is unrefinable."; end; } mes "i'm only refine +4 ~ +7."; next; while ( countitem(.TicketID) > 0 && getequiprefinerycnt(getarg(0)) < .MaxRefine ){ successrefitem (getarg(0)); delitem .TicketID,1; } while ( countitem(.TicketID) > 1 && getequiprefinerycnt(getarg(0)) > .MaxRefine && getequiprefinerycnt(getarg(0)) < .MaxRefine2 ){ successrefitem (getarg(0)); delitem .TicketID,1; } message strcharinfo(0),"done."; end; } Edited April 20, 2016 by hendra814 Quote Link to comment Share on other sites More sharing options...
0 hendra814 Posted April 20, 2016 Author Share Posted April 20, 2016 (edited) prt_in,61,54,3 script Refiner 826,{ OnUsed: set .Mode,0; // Refine mode [ 0 = Refine +1 Each time / 1 = Refine to Max Limit ] set .EquipCheck,1; // Check Equips is refineable or not. [ 0 = Disable / 1 = Enable ] set .MaxRefine,4; // Max Refine Limit set .MaxRefine2,7; // Max Refine Limit [ for Mode 2 Max Refine ] set .TicketID,7539; // Ticket ID if( countitem(.TicketID) < 1 ){ mes "you don't have "+getitemname(.TicketID)+" to continue refine."; end; } switch(select( ( getequiprefinerycnt(6) >= .MaxRefine2 || getequipisequiped(6) == 0 )?"":"Upper Headgear [ ^4EEE94"+getequipname(6)+"^000000 ]", ( getequiprefinerycnt(5) >= .MaxRefine2 || getequipisequiped(5) == 0 )?"":"Middle Headgear [ ^4EEE94"+getequipname(5)+"^000000 ]", ( getequiprefinerycnt(4) >= .MaxRefine2 || getequipisequiped(4) == 0 )?"":"Lower Headgear [ ^4EEE94"+getequipname(4)+"^000000 ]", ( getequiprefinerycnt(7) >= .MaxRefine2 || getequipisequiped(7) == 0 )?"":"Armor [ ^4EEE94"+getequipname(7)+"^000000 ]", ( getequiprefinerycnt(8) >= .MaxRefine2 || getequipisequiped(8) == 0 )?"":"Left Hand [ ^4EEE94"+getequipname(8)+"^000000 ]", ( getequiprefinerycnt(9) >= .MaxRefine2 || getequipisequiped(9) == 0 )?"":"Right Hand [ ^4EEE94"+getequipname(9)+"^000000 ]", ( getequiprefinerycnt(3) >= .MaxRefine2 || getequipisequiped(3) == 0 )?"":"Garment [ ^4EEE94"+getequipname(3)+"^000000 ]", ( getequiprefinerycnt(2) >= .MaxRefine2 || getequipisequiped(2) == 0 )?"":"Shoes [ ^4EEE94"+getequipname(2)+"^000000 ]", ( getequiprefinerycnt(1) >= .MaxRefine2 || getequipisequiped(1) == 0 )?"":"Accessory [ ^4EEE94"+getequipname(1)+"^000000 ]", ( getequiprefinerycnt(0) >= .MaxRefine2 || getequipisequiped(0) == 0 )?"":"Accessory [ ^4EEE94"+getequipname(0)+"^000000 ]", "^FF0000end^000000")) { Case 1: if ( .Mode == 0 ) { callsub RefineSystem,6; } if ( .Mode == 1 ) { callsub MaxRefineSystem,6; } if ( .Mode == 2 ) { callsub NewRefineSystem,6; } Case 2: if ( .Mode == 0 ) { callsub RefineSystem,5; } if ( .Mode == 1 ) { callsub MaxRefineSystem,5; } if ( .Mode == 2 ) { callsub NewRefineSystem,5; } Case 3: if ( .Mode == 0 ) { callsub RefineSystem,4; } if ( .Mode == 1 ) { callsub MaxRefineSystem,4; } if ( .Mode == 2 ) { callsub NewRefineSystem,4; } Case 4: if ( .Mode == 0 ) { callsub RefineSystem,7; } if ( .Mode == 1 ) { callsub MaxRefineSystem,7; } if ( .Mode == 2 ) { callsub NewRefineSystem,7; } Case 5: if ( .Mode == 0 ) { callsub RefineSystem,8; } if ( .Mode == 1 ) { callsub MaxRefineSystem,8; } if ( .Mode == 2 ) { callsub NewRefineSystem,8; } Case 6: if ( .Mode == 0 ) { callsub RefineSystem,9; } if ( .Mode == 1 ) { callsub MaxRefineSystem,9; } if ( .Mode == 2 ) { callsub NewRefineSystem,9; } Case 7: if ( .Mode == 0 ) { callsub RefineSystem,3; } if ( .Mode == 1 ) { callsub MaxRefineSystem,3; } if ( .Mode == 2 ) { callsub NewRefineSystem,3; } Case 8: if ( .Mode == 0 ) { callsub RefineSystem,2; } if ( .Mode == 1 ) { callsub MaxRefineSystem,2; } if ( .Mode == 2 ) { callsub NewRefineSystem,2; } Case 9: if ( .Mode == 0 ) { callsub RefineSystem,1; } if ( .Mode == 1 ) { callsub MaxRefineSystem,1; } if ( .Mode == 2 ) { callsub NewRefineSystem,1; } Case 10: if ( .Mode == 0 ) { callsub RefineSystem,0; } if ( .Mode == 1 ) { callsub MaxRefineSystem,0; } if ( .Mode == 2 ) { callsub NewRefineSystem,0; } Case 11: end; } RefineSystem: if ( .EquipCheck == 1 && getequipisenableref(getarg(0)) == 0 ){ mes "this item is unrefinable."; end; } if(getequiprefinerycnt(getarg(0)) < .MaxRefine) { mes "I'm can't upgrade this item."; mes "you must upgrade into ^0000FF+4^000000"; mes "berfore you bring it to me."; end; } successrefitem (getarg(0)); message strcharinfo(0),"done."; delitem .TicketID,1; end; MaxRefineSystem: if ( .EquipCheck == 1 && getequipisenableref(getarg(0)) == 0 ){ mes "This item is unrefinable."; end; } for ( set [email protected],getequiprefinerycnt(getarg(0)); getequiprefinerycnt(getarg(0)) < .MaxRefine; set [email protected],getequiprefinerycnt(getarg(0)) ){ successrefitem (getarg(0)); } message strcharinfo(0),"done."; delitem .TicketID,1; end; NewRefineSystem: if ( .EquipCheck == 1 && getequipisenableref(getarg(0)) == 0 ){ mes "this item is unrefinable."; end; } mes "i'm just upgrade from +4 ~ +7."; next; while ( countitem(.TicketID) > 0 && getequiprefinerycnt(getarg(0)) < .MaxRefine ){ successrefitem (getarg(0)); delitem .TicketID,1; } while ( countitem(.TicketID) > 1 && getequiprefinerycnt(getarg(0)) > .MaxRefine && getequiprefinerycnt(getarg(0)) < .MaxRefine2 ){ successrefitem (getarg(0)); delitem .TicketID,1; } message strcharinfo(0),"Done."; end; } prontera,171,226,4 script Great Refiner 826,{ setarray [email protected][0],2,3,4,5,6,7,8,9,10; for( set [email protected],0; [email protected] < getarraysize([email protected]); set [email protected],[email protected] + 1 ) { if( getequipisequiped([email protected][[email protected]]) ) { if( [email protected][[email protected]] == 3 || [email protected][[email protected]] == 4) { switch( getequipweaponlv([email protected][[email protected]]) ) { case 0: set [email protected], 4; break; default: set [email protected], 8 - getequipweaponlv([email protected][[email protected]]); break; } } else { set [email protected], 4; } set [email protected],[email protected]([email protected][[email protected]]); if(getequiprefinerycnt([email protected][[email protected]]) < [email protected] && getequipisenableref([email protected][[email protected]]) ) { for( set [email protected],0; [email protected] < [email protected]; set [email protected],[email protected] + 1) successrefitem [email protected][[email protected]]; } } sleep2 100; } } Edited August 7, 2020 by Mael Quote Link to comment Share on other sites More sharing options...
0 Lemongrass Posted April 19, 2016 Share Posted April 19, 2016 Consider using the EQI_* constants instead of hardcoding the numbers. We wont change them anytime soon again, but that is what constants are for. Take this commit as a reference: https://github.com/rathena/rathena/commit/6649d2e98dcd615ff79fdc8b47d7a9bdd313cec2 There's also a function provided now, which allows you to get the name of the equipment position to build your menu dynamically. Quote Link to comment Share on other sites More sharing options...
please help me fix this script
this one can't refine to safe limit for armor only *Solved
prontera,171,226,4 script Great Refiner 826,{ setarray [email protected][0],1,2,3,4,5,6,9,10; //change into setarray [email protected][0],2,3,4,5,6,7,8,9,10; for( set [email protected],0; [email protected] < getarraysize([email protected]); set [email protected],[email protected] + 1 ) { if( getequipisequiped([email protected][[email protected]]) ) { if( [email protected][[email protected]] == 3 || [email protected][[email protected]] == 4) { switch( getequipweaponlv([email protected][[email protected]]) ) { case 0: set [email protected], 4; break; default: set [email protected], 8 - getequipweaponlv([email protected][[email protected]]); break; } } else { set [email protected], 4; } set [email protected],[email protected]([email protected][[email protected]]); if(getequiprefinerycnt([email protected][[email protected]]) < [email protected] && getequipisenableref([email protected][[email protected]]) ) { for( set [email protected],0; [email protected] < [email protected]finefix; set [email protected],[email protected] + 1) successrefitem [email protected][[email protected]]; } } sleep2 100; } }and this one for armor slot with shoes, so can't refine armor equipment too *Solved
prt_in,61,54,3 script Refiner 826,{ OnUsed: set .Mode,0; // Refine mode [ 0 = Refine +1 Each time / 1 = Refine to Max Limit ] set .EquipCheck,1; // Check Equips is refineable or not. [ 0 = Disable / 1 = Enable ] set .MaxRefine,4; // Max Refine Limit set .MaxRefine2,7; // Max Refine Limit [ for Mode 2 Max Refine ] set .TicketID,7539; // Ticket ID if( countitem(.TicketID) < 1 ){ mes "you don't have "+getitemname(.TicketID)+" to continue refine."; end; } switch(select( ( getequiprefinerycnt(6) >= .MaxRefine2 || getequipisequiped(1) == 0 )?"":"Headgear [ ^4EEE94"+getequipname(1)+"^000000 ]", ( getequiprefinerycnt(2) >= .MaxRefine2 || getequipisequiped(2) == 0 )?"":"Armor [ ^4EEE94"+getequipname(2)+"^000000 ]", ( getequiprefinerycnt(3) >= .MaxRefine2 || getequipisequiped(3) == 0 )?"":"Left Hand [ ^4EEE94"+getequipname(3)+"^000000 ]", ( getequiprefinerycnt(4) >= .MaxRefine2 || getequipisequiped(4) == 0 )?"":"Right Hand [ ^4EEE94"+getequipname(4)+"^000000 ]", ( getequiprefinerycnt(5) >= .MaxRefine2 || getequipisequiped(5) == 0 )?"":"Garment [ ^4EEE94"+getequipname(5)+"^000000 ]", ( getequiprefinerycnt(6) >= .MaxRefine2 || getequipisequiped(6) == 0 )?"":"Shoes [ ^4EEE94"+getequipname(6)+"^000000 ]", "^FF0000end^000000")) { Case 1: if ( .Mode == 0 ) { callsub RefineSystem,1; } if ( .Mode == 1 ) { callsub MaxRefineSystem,1; } if ( .Mode == 2 ) { callsub NewRefineSystem,1; } Case 2: if ( .Mode == 0 ) { callsub RefineSystem,2; } if ( .Mode == 1 ) { callsub MaxRefineSystem,2; } if ( .Mode == 2 ) { callsub NewRefineSystem,2; } Case 3: if ( .Mode == 0 ) { callsub RefineSystem,3; } if ( .Mode == 1 ) { callsub MaxRefineSystem,3; } if ( .Mode == 2 ) { callsub NewRefineSystem,3; } Case 4: if ( .Mode == 0 ) { callsub RefineSystem,4; } if ( .Mode == 1 ) { callsub MaxRefineSystem,4; } if ( .Mode == 2 ) { callsub NewRefineSystem,4; } Case 5: if ( .Mode == 0 ) { callsub RefineSystem,5; } if ( .Mode == 1 ) { callsub MaxRefineSystem,5; } if ( .Mode == 2 ) { callsub NewRefineSystem,5; } Case 6: if ( .Mode == 0 ) { callsub RefineSystem,6; } if ( .Mode == 1 ) { callsub MaxRefineSystem,6; } if ( .Mode == 2 ) { callsub NewRefineSystem,6; } Case 7: end; } RefineSystem: if ( .EquipCheck == 1 && getequipisenableref(getarg(0)) == 0 ){ mes "this item is unrefinable."; end; } if(getequiprefinerycnt(getarg(0)) < .MaxRefine) { mes "i'm can't refine this item."; mes "you must upgrade ^0000FF+4^000000"; mes "before bring it to me."; end; } successrefitem (getarg(0)); message strcharinfo(0),"done."; delitem .TicketID,1; end; MaxRefineSystem: if ( .EquipCheck == 1 && getequipisenableref(getarg(0)) == 0 ){ mes "this item is unrefinable."; end; } for ( set [email protected],getequiprefinerycnt(getarg(0)); getequiprefinerycnt(getarg(0)) < .MaxRefine; set [email protected],getequiprefinerycnt(getarg(0)) ){ successrefitem (getarg(0)); } message strcharinfo(0),"done."; delitem .TicketID,1; end; NewRefineSystem: if ( .EquipCheck == 1 && getequipisenableref(getarg(0)) == 0 ){ mes "this item is unrefinable."; end; } mes "i'm only refine +4 ~ +7."; next; while ( countitem(.TicketID) > 0 && getequiprefinerycnt(getarg(0)) < .MaxRefine ){ successrefitem (getarg(0)); delitem .TicketID,1; } while ( countitem(.TicketID) > 1 && getequiprefinerycnt(getarg(0)) > .MaxRefine && getequiprefinerycnt(getarg(0)) < .MaxRefine2 ){ successrefitem (getarg(0)); delitem .TicketID,1; } message strcharinfo(0),"done."; end; }Edited by hendra814Link to comment
Share on other sites