map,x,y,z script Cash Point Exchanger 100,{ set .@n$, "[Cashpoint Exchanger]"; set .@TCG, 7227; mes .@n$; mes "How can I help you?"; set .@menu$, "Cash Points > TCG:TCG > Cash Points"; set .@j, select ( .@menu$ ) - 1; explode(.@menu$,.@menu$,":"); next; mes .@n$; mes .@menu$[.@j]; mes " "; mes "^FF0000Input " +((!.@j)?"Cash Points":"TCG")+ " amount to be exchanged.^000000"; input .@amt; next; mes .@n$; mes "Are you sure you want to trade away " +.@amt+ " " +((!.@j)?"Cash Points":"TCG")+ "?"; if ( select ( "Yes:No" ) == 2 ) close; switch (.@j) { Case 0: if ( #CASHPOINTS >= .@amt ) { close2; set #CASHPOINTS, #CASHPOINTS - .@amt; getitem .@TCG, .@amt; dispbottom "You have gained " +.@amt+ " x " +getitemname(.@TCG)+ "."; end; } break; Case 1: if ( countitem(.@TCG) >= .@amt ) { close2; set #CASHPOINT, #CASHPOINTS + .@amt; delitem .@TCG, .@amt; dispbottom "You have gained " +.@amt+ " Cash Points."; end; } break; } next; mes .@n$; mes "Invalid amount..."; close; }