prontera,155,181,5 script Sample#coin_bank 757,{
switch( select( "Deposit "+.coin_name$,"Withdraw "+.coin_name$ ) ){
case 1:
mes "How many "+.coin_name$+" to Deposit ??";
mes "Max : "+countitem( .coin_id )+" "+.coin_name$;
input .@amount,0,countitem( .coin_id );
if( .@amount ){
delitem .coin_id,.@amount;
#coin_bank += .@amount;
}
else{
mes "Deposit cancelled.";
}
break;
case 2:
mes "How many "+.coin_name$+" to Withdraw ??";
mes "Max : "+#coin_bank+" "+.coin_name$;
input .@amount,0,#coin_bank;
if( .@amount ){
getitem .coin_id,.@amount;
#coin_bank -= .@amount;
}
else{
mes "Withdraw cancelled.";
}
break;
}
close;
OnInit:
.coin_id = 671;
.coin_name$ = getitemname( .coin_id );
end;
}