pharaoh 130 Share Posted May 28, 2016 how use this @Override public void onItemChange(Item[] items) { } Link to comment Share on other sites More sharing options...
Eclipseop 194 Share Posted May 28, 2016 haha nice post.iter through the array and see what items changed, find the one you at look for by either the name or id, and then do whatever you need. Link to comment Share on other sites More sharing options...
Explicit 213 Share Posted May 28, 2016 haha nice post. iter through the array and see what items changed, find the one you at look for by either the name or id, and then do whatever you need. I'm going to make the assumption that only items that have changed will be passed to an onItemChange event handler.... Link to comment Share on other sites More sharing options...
Constuck 13 Share Posted May 28, 2016 the Item[] items consists of the items that have changed. If nothing has changed, I assume you either get an empty array or null. Link to comment Share on other sites More sharing options...
Mad 86 Share Posted May 28, 2016 It should return a single Item and fire it multiple times if multiple items change, that seems weird Link to comment Share on other sites More sharing options...
Hopewelljnj 46 Share Posted May 28, 2016 It should return a single Item and fire it multiple times if multiple items change, that seems weird Do what we all do to figure out code. Build yourself a test script. Iterate through the array and log information and see what happens. Link to comment Share on other sites More sharing options...
pharaoh 130 Author Share Posted May 29, 2016 haha nice post. iter through the array and see what items changed, find the one you at look for by either the name or id, and then do whatever you need. I'm going to make the assumption that only items that have changed will be passed to an onItemChange event handler.... the Item[] items consists of the items that have changed. If nothing has changed, I assume you either get an empty array or null. It should return a single Item and fire it multiple times if multiple items change, that seems weird Do what we all do to figure out code. Build yourself a test script. Iterate through the array and log information and see what happens. hi everyone i am just trying to get the total amount of logs cut/fish cut/items gained etc idk how to do that Link to comment Share on other sites More sharing options...
Constuck 13 Share Posted May 29, 2016 Oh, you can use a message listener for that. Whenever you get logs from a tree, the game sends you a message that says "You get some ____ logs." Just listen for that message and +1 to logs every time you get it. A similar thing happens in fishing but I can't remember if it is the same message. Ex: "You get some shrimp." Link to comment Share on other sites More sharing options...
Hopewelljnj 46 Share Posted May 29, 2016 You can also do int fish = getInventory().count("Raw shrimps"); sleepUntil(() -> getInventory().count("Raw shrimps") > fish, 10000); int fishCaught ++; Its better to do it with a message listener but I believe some things do not give a message. Link to comment Share on other sites More sharing options...
pharaoh 130 Author Share Posted May 30, 2016 got it working, ty all Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.