cattycatcat Posted August 21, 2016 Share Posted August 21, 2016 Hello guys i finished my shop buying script it works just fine, made simple paint which shows time and money spent but i;m struggling to create buys/hr in my paint.Currently i do it like this: once i bank i just do increase in 27 but due some lagg it can add upto 80+.So if sombody could post flawless solution that would be damn good Quote Link to comment Share on other sites More sharing options...
Xerion Posted August 21, 2016 Share Posted August 21, 2016 Why don't you just increase the counter every time you buy the item? Quote Link to comment Share on other sites More sharing options...
House Posted August 21, 2016 Share Posted August 21, 2016 (edited) int itemCount = (int) getScript().getInventory().getAmount("Beer"); public int getIncrease(String name) { int count = 0; for (Item item : getScript().getInventory().getItems()) { if (item == null) break; if (item.getName().equals(name)) count++; } int increaseAmount = count - itemCount; itemCount = count; return increaseAmount; } Don't forget to handle when you bank and the increase becomes negative Edited August 21, 2016 by House Quote Link to comment Share on other sites More sharing options...
cattycatcat Posted August 21, 2016 Author Share Posted August 21, 2016 ty house just implented and now it works just as i wanted Quote Link to comment Share on other sites More sharing options...