Cardozz 46 Posted December 28, 2014 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 ?
solution 4 Posted December 28, 2014 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.
Cardozz 46 Author Posted December 28, 2014 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
Pandemic 2853 Posted December 28, 2014 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?
Cardozz 46 Author Posted December 28, 2014 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
Pandemic 2853 Posted December 29, 2014 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).
Recommended Posts
Archived
This topic is now archived and is closed to further replies.