Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
  • How do i use 2 items on each other?


    Cardozz
     Share

    Recommended Posts

    Hi there,

     

    In example i want to burn some logs, so i have a tinderbox and a pile of logs.

     

    How do i use the tinderbox on the logs? I mean, there is no interact() in the inventory api, i can only manage to interact with the tinderbox via getInventory().interactWithItem("Tinderbox", "Use").

     

     

    Any tips :)?

    Link to comment
    Share on other sites

    I was going to post that there is a useItemOn() method but it seems dreambot doesn't have that for some reason. I'd suggest adding that to them since it's alot simpler.

     

     

    but I suppose you use getItem(id)  and then use that for interaction.

    Link to comment
    Share on other sites

    You can't interact after the .getItem() call. I've made a rectangle box and let my mouse click it as i only have to click once, but damn its hard :P

    Link to comment
    Share on other sites

    I guess this:

    getInventory().interactWithItem("Tinderbox", "Use");
    getInventory().interactWithItem("Logs", "Use");
    

    We'll add an item on item method though, weird we haven't thought of that already :)

     

    Edit: Just added a base one, going to add a few others like it tomorrow when I'm awake, but here's what I came up with:

    getInventory().getItem("Tinderbox").useOn("Logs")
    

    How's that look?

    Link to comment
    Share on other sites

    Thanks pandemic! Lovely, i really appreciated that!
     
    though i cant use it yet, does the jar need to be updated first?
     
     
    oh and btw: the logs don't have an action if you have the tinderbox selected, that's why a second interactWithItem doesn't work.
     
     

    Edit: for now i've solved it the other way around, just to get my script moving on while the useOn() is being updated. It's working for one slot because i've made a rectangle via the getMouse() api.

    Rectangle logRect = new Rectangle(653, 225, 20, 20);
    
                    if (getPlayers().myPlayer().getAnimation() == -1) {
                        if (getInventory().interactWithItem("Tinderbox", "Use")) {
                            getMouse().move(logRect);
                            getMouse().click();
    
    

    EDIT 2: OHH STUPID ME.. if you use this code below it works! The action for using a tinderbox in a log pile is just "Use".  Still i think the useOn method will make life easier ^^.

    if (getInventory().interactWithItem("Tinderbox", "Use")){
       logPile.interact("Use");
    
    //logPile is a local variable i made for the normal Logs
    
    Edited by Cardozz
    Link to comment
    Share on other sites

     

    Thanks pandemic! Lovely, i really appreciated that!

     

    though i cant use it yet, does the jar need to be updated first?

     

     

    oh and btw: the logs don't have an action if you have the tinderbox selected, that's why a second interactWithItem doesn't work.

     

     

    Edit: for now i've solved it the other way around, just to get my script moving on while the useOn() is being updated. It's working for one slot because i've made a rectangle via the getMouse() api.

    Rectangle logRect = new Rectangle(653, 225, 20, 20);
    
                    if (getPlayers().myPlayer().getAnimation() == -1) {
                        if (getInventory().interactWithItem("Tinderbox", "Use")) {
                            getMouse().move(logRect);
                            getMouse().click();
    
    

    EDIT 2: OHH STUPID ME.. if you use this code below it works! The action for using a tinderbox in a log pile is just "Use".  Still i think the useOn method will make life easier ^^.

    if (getInventory().interactWithItem("Tinderbox", "Use")){
       logPile.interact("Use");
    
    //logPile is a local variable i made for the normal Logs
    

     

    No problem!

     

    You won't be able to use this method until we release a new update (probably later today since we have quite a few updates in it).

    Link to comment
    Share on other sites

     Share

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.