Jump to content

selecting items in inventory [question]


Recommended Posts

Posted (edited)

Hello, hopefully this is the right section for this question.   I've been working on my first script which is a woodcutting/ firemaking script.

 

I am having trouble selecting items in my inventory, I want to select the Tinderbox . I have tried the following

 
inventory.interact("Tinderbox", "Use");
&
inventory.interactWithNameThatContains("Tinderbox"); 
 
neither of these have been able to select the Tinderbox for me. Am I using them wrong? 
 
I've also seen people use 
 
    client.getInventory().interactWithId(tinderbox, "Use");
    client.getInventory().interactWithNameThatContains(strLogType, "Use");
 
 Ive tried it this way too, however, using client.getInventory gives me the following error "The method getInventory() is undefined for the type Client"  .  is this an outdated method?
Edited by taco shack
Posted

 

Hello, hopefully this is the right section for this question.   I've been working on my first script which is a woodcutting/ firemaking script.

 

I am having trouble selecting items in my inventory, I want to select the Tinderbox . I have tried the following

 
inventory.interact("Tinderbox", "Use");
&
inventory.interactWithNameThatContains("Tinderbox"); 
 
neither of these have been able to select the Tinderbox for me. Am I using them wrong? 
 
I've also seen people use 
 
    client.getInventory().interactWithId(tinderbox, "Use");
    client.getInventory().interactWithNameThatContains(strLogType, "Use");
 
 Ive tried it this way too, however, using client.getInventory gives me the following error "The method getInventory() is undefined for the type Client"  .  is this an outdated method?

 

 

The signature for the interact method you're trying to use is:

public boolean interact(java.lang.String action,                        java.lang.String... names)

Which means that what you're doing is trying to select the action "Tinderbox" on the item "Use"

Swap these around and you should be good.

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...