Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Resolved Inventory item isVisible returning false

s̶c̶r̶i̶p̶t̶ bot*
Joined
Aug 23, 2015
Messages
2,232
@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.

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();
        }
    }

uLv6EQl.png
 
s̶c̶r̶i̶p̶t̶ bot*
Joined
Aug 23, 2015
Messages
2,232
It seems to always be false if I am not in legacy interface mode.
 
@Cloud A little update, I'm not sure how or why this happened, but my bot got this last night when trying to drop an object in the inventory. This was also in the Legacy client mode.

Keycode 112 is F1. Maybe it was trying to open Inventory with a button press? (If that's the hotkey for inventory? Idk, just a guess)


Code:
Attemping DropItemsTask
Has Action: Craft
Has Action: Light
Has Action: Drop
Item is Visible: false
Item is Valid: true
java.lang.IllegalArgumentException: Action keys such as '? (keycode 112)' are not currently supported.
        at com.runemate.game.api.hybrid.input.Keyboard.pressKey(gdc:195)
        at com.runemate.game.api.hybrid.input.Keyboard.typeKey(gdc:86)
        at com.runemate.game.api.hybrid.input.Keyboard.typeKey(gdc:193)
        at com.runemate.game.api.hybrid.input.Keyboard.typeKey(gdc:276)
        at com.runemate.game.api.rs3.local.hud.interfaces.legacy.LegacyTab.open(mub:207)
        at com.runemate.game.api.rs3.local.hud.interfaces.legacy.LegacyTab.open(mub:125)
        at com.runemate.game.api.hybrid.local.hud.interfaces.SpriteItem.new(uyb:183)
        at com.runemate.game.api.hybrid.local.hud.interfaces.SpriteItem.interact(uyb:272)
        at com.runemate.game.api.hybrid.entities.details.Interactable.interact(ak:263)
        at com.runemate.game.api.hybrid.entities.details.Interactable.interact(ak:222)
        at com.Sudo.Spectre.bots.SudoDivination.tasks.DropItemsTask.Loop(DropItemsTask.java:36)
        at com.Sudo.Spectre.bots.SudoDivination.SudoDivination.onLoop(SudoDivination.java:141)
        at com.runemate.game.api.script.framework.LoopingScript.run(cqb:184)
        at com.runemate.game.api.script.framework.AbstractScript.start(ymb:276)
        at nul.IIIIiIiIiIiI.run(odc:79)
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
It seems to always be false if I am not in legacy interface mode.
 
@Cloud A little update, I'm not sure how or why this happened, but my bot got this last night when trying to drop an object in the inventory. This was also in the Legacy client mode.

Keycode 112 is F1. Maybe it was trying to open Inventory with a button press? (If that's the hotkey for inventory? Idk, just a guess)


Code:
Attemping DropItemsTask
Has Action: Craft
Has Action: Light
Has Action: Drop
Item is Visible: false
Item is Valid: true
java.lang.IllegalArgumentException: Action keys such as '? (keycode 112)' are not currently supported.
        at com.runemate.game.api.hybrid.input.Keyboard.pressKey(gdc:195)
        at com.runemate.game.api.hybrid.input.Keyboard.typeKey(gdc:86)
        at com.runemate.game.api.hybrid.input.Keyboard.typeKey(gdc:193)
        at com.runemate.game.api.hybrid.input.Keyboard.typeKey(gdc:276)
        at com.runemate.game.api.rs3.local.hud.interfaces.legacy.LegacyTab.open(mub:207)
        at com.runemate.game.api.rs3.local.hud.interfaces.legacy.LegacyTab.open(mub:125)
        at com.runemate.game.api.hybrid.local.hud.interfaces.SpriteItem.new(uyb:183)
        at com.runemate.game.api.hybrid.local.hud.interfaces.SpriteItem.interact(uyb:272)
        at com.runemate.game.api.hybrid.entities.details.Interactable.interact(ak:263)
        at com.runemate.game.api.hybrid.entities.details.Interactable.interact(ak:222)
        at com.Sudo.Spectre.bots.SudoDivination.tasks.DropItemsTask.Loop(DropItemsTask.java:36)
        at com.Sudo.Spectre.bots.SudoDivination.SudoDivination.onLoop(SudoDivination.java:141)
        at com.runemate.game.api.script.framework.LoopingScript.run(cqb:184)
        at com.runemate.game.api.script.framework.AbstractScript.start(ymb:276)
        at nul.IIIIiIiIiIiI.run(odc:79)
You're right about that second part, it was trying to open the inventory with a hotkey but for some reason we don't support "action keys", I'm investigating this part now.

Edit: Okay that's patched for the next release, now investigating the other bug.
 
Both issues have been fixed in the newly released V1.0.42
 
Top