Jump to content

selecting items in inventory [question]


taco shack

Recommended Posts

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
Link to comment
Share on other sites

 

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.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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