Jump to content
  • 0

sell all the inventory items (except equiped equips) in one click


Question

Posted (edited)

what am i doing wrong?

 

case 1:
mes "[Trader]";
mes "Please remove your items from inventory which u want and store them safe!";
next;
switch(select("I know:Thx for help")) {
case 1:
deletearray @inventorylist_id;
deletearray @inventorylist_amount;
getinventorylist();
for(set .@i, 0; .@i <  @inventorylist_count; set .@i, .@i + 1);
       set .@payment, .@payment + getiteminfo(@inventorylist_id[.@i], 1) * @inventorylist_amount[.@i];
    atcommand "@itemreset ";
     set Zeny, Zeny + .@payment;
     end; 
case 2:
mes "[Trader]";
mes "Talk to me again when you are ready";
close;
}
 
does nothing just removes the item but no zeny changes are made can anyone help me!!
Edited by Patskie
<code>

2 answers to this question

Recommended Posts

Posted

u r mine man dude thx a lots you are very good at your work No.1


prontera,96,231,6 script Trader 999,{
 // Remove Previous Arrays @arrays only clear on relog
  deletearray @inventorylist_id[0], @inventorylist_count;
  deletearray @inventorylist_amount[0], @inventorylist_count;
  deletearray @inventorylist_refine[0], @inventorylist_count;
  deletearray @inventorylist_card1[0], @inventorylist_count;
  deletearray @inventorylist_card2[0], @inventorylist_count;
  deletearray @inventorylist_card3[0], @inventorylist_count;
  deletearray @inventorylist_card4[0], @inventorylist_count;
getinventorylist;
.@overcharge_lv = getskilllv( "MC_OVERCHARGE" );
if( .@overcharge_lv )
.@overcharge_rate = 105 + ( 2  * .@overcharge_lv ) - ( ( .@overcharge_lv >= 10 )? 1:0 );
while( .@i < @inventorylist_count ){
if( !@inventorylist_equip[.@i] ){
.@item_sell_price = getiteminfo( @inventorylist_id[.@i],1 );
if( .@overcharge_lv )
.@item_sell_price = ( ( .@item_sell_price * .@overcharge_rate ) / 100 );
mes " > "+getitemname( @inventorylist_id[.@i] )+" : "+.@item_sell_price+"z";
.@cost += .@item_sell_price;
}
.@i++;
}
if( .@cost ){
if( select( "Sell all items for "+.@cost+" zeny ?","Cancel" ) == 1 ){
.@i = 0;
while( .@i < @inventorylist_count ){
if( !@inventorylist_equip[.@i] )
delitem @inventorylist_id[.@i],@inventorylist_amount[.@i];
.@i++;
}
Zeny += .@cost;
mes "Gained "+.@cost+" zeny.";
specialeffect2 563;
}
}else{
mes "You dont have any Items to sell.";
}
close;
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...