viewing paste coin bank | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
 
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;
}
 
Viewed 1235 times, submitted by Emistry.