My script is currently a 1-click item exchanger breaking elemental stones back into ores, but I want to expand it to swapping multiple dead branches to bloody banches.
Atm, it's a case of doing '100 DBs -> 1 BB' one at a time, but I would like to have it exchange as many as possible in one go, eg. '320 DBs -> 3 BBs'. How can I make it do that, but only remove DBs in multiples of 100 and leave the remainder? So in that example, 320 DBs yields 3 BBs w/ 20 DBs still in inventory.
prontera,162,193,4 script Vending Machine#vender01 564,{
setarray .@i[0],countitem(994),countitem(995),countitem(996),countitem(997),countitem(604);
if (.@i[0] > 0 || .@i[1] > 0 || .@i[2] > 0 || .@i[3] > 0 || .@i[4] > 99)
EL1:
delitem 994,.@i[0];
getitem 990,.@i[0]*5;
EL2:
delitem 995,.@i[1];
getitem 991,.@i[1]*5;
EL3:
delitem 996,.@i[2];
getitem 992,.@i[2]*5;
EL4:
delitem 997,.@i[3];
getitem 993,.@i[3]*5;
DB:
delitem 604,100;
getitem 12103,1;
}