Eclipseop 194 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.
Explicit 213 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....
Constuck 13 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.
Mad 86 Posted May 28, 2016 It should return a single Item and fire it multiple times if multiple items change, that seems weird
Hopewelljnj 46 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.
pharaoh 135 Author 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
Constuck 13 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."
Hopewelljnj 46 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.