Jump to content
  • 0

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


punit

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  01/06/13
  • Last Seen:  

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>
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

you can try this

http://upaste.me/r/9b49f9

 

but change ALL

if( !@inventorylist_identify[.@i] ){

to

if( !@inventorylist_equip[.@i] ){
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  01/06/13
  • Last Seen:  

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;
}
Link to comment
Share on other sites

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.

×
×
  • Create New...