- Joined
- Aug 23, 2015
- Messages
- 2,232
- Thread Author
- #1
@Cloud for when you wake up <3
It appears that under certain conditions an Inventory SpriteItem's isVisible is false. This is causing failure for interaction.
I've attached my code along with a screenshot of how my client was set up. Also note, that putting my client in legacy interface mode fixed isVisible to return correct values.
It appears that under certain conditions an Inventory SpriteItem's isVisible is false. This is causing failure for interaction.
I've attached my code along with a screenshot of how my client was set up. Also note, that putting my client in legacy interface mode fixed isVisible to return correct values.
Code:
public DropItemsTask(SudoDivination bot){
super();
this.bot = bot;
pattern = Pattern.compile("(?i)^(logs|wooden knot)");
}
@Override
public void Loop(){
SpriteItemQueryResults inventoryResults = Inventory.newQuery().names(pattern).results();
SpriteItem inventoryFirst = inventoryResults.first();
if((inventoryResults).size() > 0){
Methods.debugAndUpdate("Attemping DropItemsTask", bot);
for(int i = 0; i < inventoryFirst.getDefinition().getInventoryActions().size(); i++)
Methods.debug("Has Action: " + inventoryFirst.getDefinition().getInventoryActions().get(i));
Methods.debug("Item is Visible: " + inventoryFirst.isVisible());
Methods.debug("Item is Valid: " + inventoryFirst.isValid());
inventoryFirst.interact("Drop");
}
else{
Methods.debugAndUpdate("DropItemsTask Complete", bot);
Complete();
}
}
